Context
At origin/dev@85be75ab12200e5ae57df38fe3b111ad8942605d, ai/mcp/client/config.mjs still declares the built-in Memory Core and Knowledge Base clients as stdio commands. The literal repo CLI path therefore starts a checkout-local server instead of consuming the canonical Docker plane through loopback ingress.
The canonical local topology already publishes authenticated MC/KB Streamable HTTP at 127.0.0.1:3102, and src/ai/fleet/mcpServers.mjs already owns the remote credential slot as REMOTE_MCP_CREDENTIAL_ENV_VAR (NEO_MCP_REMOTE_TOKEN). The repository-workflow credential is a separate authority and must not be substituted.
This is the one-PR client-default leaf of the larger machine cutover. It does not replay the cutover or close its parent.
Live latest-open sweep: checked the newest 20 open issues and the latest 30 A2A messages at 2026-08-08T10:23Z. No equivalent ticket or competing claim exists; #16671 owns deploy-composition admission, not repo-client transport defaults.
Structure-map result: ai/mcp/client is the owning folder, with the existing Client.mjs, config.mjs, CLI, and bridge siblings. No new file or ownership move is needed.
The Problem
The built-in defaults contradict the accepted single-plane topology:
- an unconfigured MC/KB client can spawn another host process and observe or mutate a different store;
- the generic remote transports accept static
transportOptions, but there is no instance-scoped, just-in-time Bearer injection contract;
- storing a resolved token in the shared client config would leak authority across instances;
- accepting both a literal
Authorization header and an environment slot would create two competing authorities; and
- replacing every stdio default would erase intentional host-local capabilities such as Neural Link.
The parent #16167 ledger names GH_TOKEN for these rows. That spelling is obsolete: the canonical remote-plane credential is NEO_MCP_REMOTE_TOKEN, while GH_TOKEN remains repository workflow authority.
The Architectural Reality
Neo.ai.mcp.client.Client#createTransport() owns SDK transport construction.
Client#loadServerConfig() maps one built-in server row onto one client instance.
ai/mcp/client/config.mjs owns the repo-native default server map.
src/ai/fleet/mcpServers.mjs owns the canonical remote MCP credential environment name.
- ADR 0019 requires one configuration authority, use-site resolution, no shared-singleton mutation, and no fallback chain.
- ADR 0019 §10.7 keeps MC/KB behind authenticated loopback HTTP while Neural Link remains a host-edge capability.
The Fix
- Add a nullable
bearerTokenEnvVar client config.
- For SSE and Streamable HTTP only, resolve the named slot from the instance environment first and
process.env second.
- Clone request options and headers before injecting
Authorization: Bearer …; never write the token into shared ClientConfig.
- Fail before connection when the slot is missing or empty.
- Reject a row that declares both
bearerTokenEnvVar and a literal Authorization header.
- Point built-in MC and KB rows at the canonical loopback ingress with
REMOTE_MCP_CREDENTIAL_ENV_VAR; remove their command and args.
- Keep Neural Link on explicit local stdio.
- Remove the obsolete sibling-isolation spec whose subject is independently spawned MC/KB host servers.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge Case |
Docs |
Evidence |
Client#bearerTokenEnvVar |
ADR 0019; existing remote transport contract from #10900 |
Resolve one named Bearer slot just in time for remote transport construction |
Missing/empty fails before connect; literal header plus slot is rejected |
JSDoc on the config and method |
Focused unit tests for precedence, cloning, non-mutation, collision, and failure |
Built-in memory-core row |
ADR 0019 §10.7; parent #16167 transport matrix |
streamable-http to http://127.0.0.1:3102/mc/mcp using REMOTE_MCP_CREDENTIAL_ENV_VAR |
No stdio or GH_TOKEN fallback |
Client config schema note |
Static contract plus authenticated routed health/read probes |
Built-in knowledge-base row |
ADR 0019 §10.7; parent #16167 transport matrix |
streamable-http to http://127.0.0.1:3102/kb/mcp using REMOTE_MCP_CREDENTIAL_ENV_VAR |
No stdio or GH_TOKEN fallback |
Client config schema note |
Static contract plus authenticated routed health/query probes |
Built-in neural-link row |
ADR 0014 host-edge boundary |
Retain explicit local stdio |
No inheritance from adjacent MC/KB rows |
None |
Focused regression assertion |
McpServersIsolation.spec.mjs |
The removed per-process topology |
Delete the obsolete host-server sibling-isolation test |
Canonical service health belongs to deployment/integration coverage |
None |
Focused client contract remains green |
Decision Record impact
Aligned with ADR 0019, especially §§2, 3, 5, and 10.7. No ADR amendment is required.
Acceptance Criteria
Out of Scope
- Rebuilding or restarting the canonical container cohort.
- MC heap saturation, healthcheck-process distortion, backup, or restore.
- Fleet-generated seat adapters and provisioning templates already delivered by #16181 and #16205.
- Deploy-pipeline composition admission owned by #16671.
- Removing stdio from file-system, repository-workflow, or Neural Link families.
- Closing the broader cutover, deletion ledger, roadmap, reboot, or persistence ACs in parent #16167.
Avoided Traps
- No credential literal in config or durable state.
- No
GH_TOKEN compatibility fallback.
- No universal no-stdio rule.
- No mutation of shared
ClientConfig.
- No inference that
runtimeFreshness: current proves deployed revision freshness.
- No data restore or container mutation based on a transient timeout.
Related
Parent: #16167
Related: #10900
Related: #16181
Related: #16205
Related: #16671
Origin Session ID: abdf06f7-5c90-4124-ad28-f0e2897214ee
Retrieval Hint: "repo-native MCP client defaults canonical HTTP remote credential authority"
Context
At
origin/dev@85be75ab12200e5ae57df38fe3b111ad8942605d,ai/mcp/client/config.mjsstill declares the built-in Memory Core and Knowledge Base clients asstdiocommands. The literal repo CLI path therefore starts a checkout-local server instead of consuming the canonical Docker plane through loopback ingress.The canonical local topology already publishes authenticated MC/KB Streamable HTTP at
127.0.0.1:3102, andsrc/ai/fleet/mcpServers.mjsalready owns the remote credential slot asREMOTE_MCP_CREDENTIAL_ENV_VAR(NEO_MCP_REMOTE_TOKEN). The repository-workflow credential is a separate authority and must not be substituted.This is the one-PR client-default leaf of the larger machine cutover. It does not replay the cutover or close its parent.
Live latest-open sweep: checked the newest 20 open issues and the latest 30 A2A messages at 2026-08-08T10:23Z. No equivalent ticket or competing claim exists; #16671 owns deploy-composition admission, not repo-client transport defaults.
Structure-map result:
ai/mcp/clientis the owning folder, with the existingClient.mjs,config.mjs, CLI, and bridge siblings. No new file or ownership move is needed.The Problem
The built-in defaults contradict the accepted single-plane topology:
transportOptions, but there is no instance-scoped, just-in-time Bearer injection contract;Authorizationheader and an environment slot would create two competing authorities; andThe parent #16167 ledger names
GH_TOKENfor these rows. That spelling is obsolete: the canonical remote-plane credential isNEO_MCP_REMOTE_TOKEN, whileGH_TOKENremains repository workflow authority.The Architectural Reality
Neo.ai.mcp.client.Client#createTransport()owns SDK transport construction.Client#loadServerConfig()maps one built-in server row onto one client instance.ai/mcp/client/config.mjsowns the repo-native default server map.src/ai/fleet/mcpServers.mjsowns the canonical remote MCP credential environment name.The Fix
bearerTokenEnvVarclient config.process.envsecond.Authorization: Bearer …; never write the token into sharedClientConfig.bearerTokenEnvVarand a literalAuthorizationheader.REMOTE_MCP_CREDENTIAL_ENV_VAR; remove theircommandandargs.Contract Ledger
Client#bearerTokenEnvVarmemory-corerowstreamable-httptohttp://127.0.0.1:3102/mc/mcpusingREMOTE_MCP_CREDENTIAL_ENV_VARGH_TOKENfallbackknowledge-baserowstreamable-httptohttp://127.0.0.1:3102/kb/mcpusingREMOTE_MCP_CREDENTIAL_ENV_VARGH_TOKENfallbackneural-linkrowMcpServersIsolation.spec.mjsDecision Record impact
Aligned with ADR 0019, especially §§2, 3, 5, and 10.7. No ADR amendment is required.
Acceptance Criteria
commandorargs.REMOTE_MCP_CREDENTIAL_ENV_VAR; neither names or falls back toGH_TOKEN.process.env, without mutating shared config.Authorizationheader plusbearerTokenEnvVarfails as ambiguous authority.neo-local-canonical; transient service saturation is reported separately and is not misclassified as token failure.Out of Scope
Avoided Traps
GH_TOKENcompatibility fallback.ClientConfig.runtimeFreshness: currentproves deployed revision freshness.Related
Parent: #16167
Related: #10900
Related: #16181
Related: #16205
Related: #16671
Origin Session ID: abdf06f7-5c90-4124-ad28-f0e2897214ee
Retrieval Hint: "repo-native MCP client defaults canonical HTTP remote credential authority"