{"version":"2.1.326","anchor":"sdk-mcpserversdelivery-option-and-argv-deprecation-warning","canonical_anchor":"sdk-mcpserversdelivery-option-and-argv-deprecation-warning","heading":"Apps built on the SDK can send MCP servers at startup instead of on the command line","tier":"use","area":"Agents","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326\/e\/sdk-mcpserversdelivery-option-and-argv-deprecation-warning","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326","markdown":"### Apps built on the SDK can send MCP servers at startup instead of on the command line\n\nSDK apps can hand MCP servers to Claude Code in the initialize request with `mcpServersDelivery`, and the SDK checks `mcp_servers_applied` in reply\n\n**What**\n\nApps that embed Claude Code through its SDK (a software kit for building on top of Claude Code) start Claude Code as a separate program. Until now the SDK always passed MCP servers, the outside services that give Claude extra tools, on that program's command line with `--mcp-config`. They can now go in the initialize request instead, the first message the app sends Claude Code over its input.\n\n- New SDK option `mcpServersDelivery`, set to `'argv'` (command line) or `'initialize'`. Any other value throws \"Invalid mcpServersDelivery. Expected 'argv' or 'initialize'.\" An app that starts its own Claude Code without setting it gets the `CLAUDE_SDK_MCP_SERVERS_ARGV_DEPRECATED` warning.\n\n- When an option named `mcpServersViaInitialize` is set, the started program is no longer given `--mcp-config` with the servers.\n\n- The initialize request gains an optional `mcpServers` field, keyed by server name. It is the input form of `--mcp-config` items, keeps credentials off the command line, and is read only under `--await-initialize`.\n\n- The SDK checks the `mcp_servers_applied` reply. If the reply is not true or false, the session ends with an error saying this Claude Code is too old to read MCP servers from the initialize request. If it is false, the SDK warns that Claude Code did not load the MCP servers sent in the initialize request. Before, only `plugins_applied` was checked.\n\n- Hook callbacks now wait until the initialize request has been written before they run.\n\n- `claimSession` initialize results also carry `mcp_servers_applied`. Creating a remote session reports `runsOn: other_host` and `hasNothingToClone`, and launcher hooks can be registered for `SessionStart`.\n\n**Why**\n\nAnything on a command line can be seen by other users on the same machine, including the env values and headers in an MCP config. Sending servers in the initialize request keeps them out of view, and the deprecation warning tells app authors that command-line delivery is on its way out. An app also gets a clear failure instead of quietly running without its MCP servers.\n\n- Area: Agents\n- Names: `mcpServersDelivery`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}