SDK-hosted MCP servers can each carry their own timeout, applied when registered.
What's wrong with this entry?
An SDK client can now attach a timeout to each MCP server it runs in-process, and the CLI applies that timeout when it registers the server. The setting travels in a new field on the initialize handshake that older CLIs ignore, so adding it does not break against v2.1.247, where the field does not exist at all. Changing a timeout on an already-registered server is deliberately ignored, and malformed configuration is skipped with a warning rather than failing the handshake.
- Timeouts travel in a new
sdkMcpServerConfigsmap on theinitializerequest, keyed by server name, and are echoed back in themcp_set_serverscontrol event that tells the CLI which servers exist. - The field is documented as settings for the SDK-hosted MCP servers named in
sdkMcpServers, keyed by server name; a timeout is the only setting it currently carries. - The client only sends the field when at least one in-process server actually declares a timeout, and nothing else gates it in this build: it is live for any SDK caller that sets one.
- A timeout is a per-server HTTP request timeout in milliseconds that raises both the fetch first-byte budget and the tool-call watchdog, capped at five minutes, and ignored when the existing
timeoutoption is also set. - A non-object value for the whole map is dropped and logged as
initialize: ignoring sdkMcpServerConfigs (not an object keyed by server name). - Re-sending a different timeout for a server that is already registered logs that the change is ignored until the server is removed and re-added; you must remove and re-add the server for a new timeout to take effect.
- Registered in-process servers are recorded as
type: "sdk"entries. - Internally the client's two parallel bookkeeping maps for transports and server instances collapsed into one
sdkMcpServersmap holding{ transport, timeout }, which is now also what the check for whether a bidirectional connection is needed reads.
initialize: ignoring sdkMcpServerConfigs (not an object keyed by server name), MCP server '${g}' is already registered; its timeout change is ignored until the server is removed and re-added, is already registered; its timeout change is ignored until the server is removed and re-added, Per-server HTTP request timeout in milliseconds, set by the host on the mcp_set_servers control event., sdkMcpServers, type: "sdk", Settings for the SDK-hosted MCP servers named in sdkMcpServers, keyed by server name.
Strings lifted out of the shipped bundle, so the claim above can be checked against them.