How does an MCP server get registered and have its tools become available to the agent, from config file loading through client connection to tool merging

en
90.0% sentence pass·9/10 cited·11/12 citations valid·95 fn·0 dec·724 sem
Application Bootstrap & EntrypointsSettings & ConfigurationMCP IntegrationTool Framework

MCP server registration and tool availability

Overview

The provided source does not contain the MCP config-loading, client-connection, or tool-merging code paths needed to answer this question precisely .

Steps

  1. The whitelist exposes only a single MCP-related symbol, setAppState in entrypoints/mcp.ts, which is a no-op stub and not part of the registration pipeline .
  2. The closest visible touchpoint is the headless run loop, which reads already-populated MCP clients from app state by combining appState.mcp.clients, sdkClients, and dynamicMcpState.clients each turn .
  3. Those combined clients are then passed into buildAllTools(appState) so MCP tools merge with base tools before the turn executes, but buildAllTools itself is not in the whitelist .
  4. QueryEngine.submitMessage likewise consumes mcpClients from its config and forwards them into system-prompt assembly and the per-turn tool list, but does not itself load configs or connect clients .
  5. The config-file loader, MCP client connection logic, and tool-merge function (e.g. buildAllTools, useManageMCPConnections, MCP config parsing) are not present in the supplied whitelist or source, so the full flow from config file → client connect → tool merge cannot be traced here .

State touched

(The actual MCP client/config/tool state — appState.mcp, dynamicMcpState, SdkMcpState — is referenced by schema but not exposed as [state:...] tokens in the whitelist .)

Decisions

None available in the provided context .