Files
deepseek-harness/apps/cli/tests
gengruilin 30086a0c0a refactor(mcp): reach mcp-client only through the MCP client host
The MCP manager imported validation, probe, status, and authorization values
from the mcp-client plugin entry and mounted its servers through a static
import of that entry. Plugin entries may export only what the Loader loads,
and the static references break source reloads: when mcp-client also has its
own Loader entry, a reload replaces only mcp-client, and HMR replaces the
instances the manager mounted without the manager knowing, so it keeps the
old code, reports stale status, and cannot stop the replacement instance.

An mcp-client entry loaded with `host: true` now provides
`ctx.mcpClientHost`. The host validates a server configuration through its
transport's own schema, so refusals still name the field; mounts instances
below its own Fiber; probes; and creates OAuth authorization owners from its
own context. The manager injects the host, imports only mcp-client types, and
passes `reconnect` and `oauth` to the host unresolved. Replacing the host
disposes its instances and restarts the manager against the replacement.

The Web composition mounts the host row before the manager. The entry stops
exporting probeServer, connectionStatusOf, assertTemplateSyntax,
resolveReconnectPolicy, ReconnectSchema, SERVER_NAME_PATTERN,
McpOAuthAuthorization, and OAuthSchema, and the plugin entry export list keeps
only createMcpToolDefinition for it.
2026-11-06 03:18:23 +08:00
..