claude-agent-sdk-typescript v0.3.326
- Source
- github.com
- Author
- claude-code-publisher[bot]Top Viber
- Date

Context
Version 0.3.326 of Anthropic's Claude SDK for TypeScript, the library that lets an app run Claude Code as an agent inside its own program, adds a way to hand Claude Code the app's servers without putting their settings on a command line, and announces that this will become the default (release notes). MCP servers give the agent extra tools, and an app's configuration for them can include credentials, such as environment variables for a server Claude Code starts or HTTP headers for a remote one. Today the SDK passes that configuration to the Claude Code process in a single `--mcp-config` command-line flag. The SDK's type documentation warns that this puts the servers' `env` and `headers` on the command line, which other users of the machine can read.
The new setting, `mcpServersDelivery: 'initialize'`, sends the servers over standard input in the request that opens the session instead, so those values stay off the command line. Servers that run inside the app's own process, created with `createSdkMcpServer`, are not affected either way. The documentation describes the trade: the first prompt waits for Claude Code's answer, an error answer ends the session, and `initializationResult().mcp_servers_applied` reports whether Claude Code took the servers at launch, which does not mean each one connected. A launch given `--sdk-url` still uses the command line, because that session cannot read the request at launch.
Who needs to act depends on which Claude Code the app runs. Apps that use the copy bundled with the SDK need not change anything and can set `'initialize'` now; the release notes say this version matches Claude Code 2.1.326. Apps that start their own Claude Code through `pathToClaudeCodeExecutable` or `spawnClaudeCodeProcess` are the ones the deprecation is aimed at: a Claude Code older than 2.1.261 exits at startup with an unknown-option error when given the new setting, and other older versions have the session ended by the SDK with an error naming it. Because a future release changes the default to `'initialize'`, those apps should update Claude Code to at least the bundled version, or set `'argv'` to keep the current behavior. Until such an app sets the option, the SDK emits a DeprecationWarning once per process with the code `CLAUDE_SDK_MCP_SERVERS_ARGV_DEPRECATED`.
Several fixes make MCP tool calls more predictable. A tool call in a running turn that targets a server the app has just removed with `setMcpServers()` is now refused, instead of reconnecting to the removed server or reporting that it needs authentication. A result from an in-process SDK server is no longer lost, or delivered to a different call, when a long call overlaps a reconnect of those servers, and the JSON-RPC `id` of requests to such a server changes from a number to a string, which can matter to code that reads those messages.
- Setting mcpServersDelivery to 'initialize' sends MCP server config in the initialize request instead of on Claude Code's command line. The current 'argv' default is deprecated; apps on an older Claude Code must update it or set 'argv' explicitly.
- A fix stops a tool result from an SDK MCP server being lost, or delivered to a different call, when a long-running call overlapped a reconnect of the SDK MCP servers.
- resumeSessionAt no longer fails on an empty reply, and a session resumed after a crash no longer loses its recent turns when the previous turn ended with an empty reply.
- When an administrator's managed-mcp.json arrives mid-session, the user's own MCP servers stop loading. The SDK now reports this with a system/informational warning tagged managed_mcp_arrived.
- AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
- MCP — The Model Context Protocol — an open standard that lets any AI assistant plug into any tool or data source without custom integration code.
Checking sign-in…
Loading comments…





