fix: update to @anthropic-ai/claude-agent-sdk 0.3.326 (#1646)

## Summary

Updates `@anthropic-ai/claude-agent-sdk` from 0.3.325 to 0.3.326, which
bundles Claude Code 2.1.326. The new version needs one adapter change,
included here: the adapter now sets the SDK's new `mcpServersDelivery`
option. Its value keeps today's behavior. A follow-up PR changes the
value, so that MCP servers no longer reach Claude Code on its command
line.

Also bumps these dev dependencies: `@anthropic-ai/sdk` 1.8.0 → 1.9.0,
and `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`
8.72.2 → 8.73.0.

`npm update` brings the in-range lockfile bumps: `hono` 4.13.18 →
4.13.19, `@hono/node-server` 2.1.8 → 2.1.9, `router` 2.2.0 → 2.3.0,
`ignore` 7.0.14 → 7.0.16 and `@tybys/wasm-util` 0.10.4 → 0.10.5.
typescript-eslint 8.73.0 depends on `minimatch` 11, so the lockfile now
holds one `minimatch`, 11.0.9, in place of 10.2.6 and two nested copies
of 11.0.8. That clears the advisory GHSA-g3hv-75wg-m249: `npm audit`
finds nothing.

TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser`
8.73.0 still requires `typescript <6.1.0`.

## `mcpServersDelivery`

SDK 0.3.326 adds the option `mcpServersDelivery`, which says how a
session's MCP servers reach Claude Code:

- `'argv'`, the default: in one `--mcp-config` flag. A server's `env`
and `headers` are then on Claude Code's command line.
- `'initialize'`: over stdin, in the initialize request.

Without a change, the new SDK breaks the adapter in two ways:

- The build fails. `OPTION_REBUILDS_SESSION` in
`src/v1/session-fingerprint.ts` must classify every SDK option. The new
one is read when the process starts, so a changed value rebuilds the
query.
- The SDK prints a `DeprecationWarning`
(`CLAUDE_SDK_MCP_SERVERS_ARGV_DEPRECATED`) on stderr, once per process,
when an app names the Claude Code to start, a session has MCP servers
and the option is unset. The adapter always passes
`pathToClaudeCodeExecutable`, so every adapter process with an MCP
server would print it.

The adapter now sets `'argv'`, so MCP servers reach Claude Code as they
did before. The value is one constant, `MCP_SERVERS_DELIVERY` in
`src/claude-cli.ts`, which both cores set before the client's options: a
client's `_meta.claudeCode.options.mcpServersDelivery` wins.

## Changelog review

Read the SDK changelog for 0.3.326 and the Claude Code changelog for
2.1.326. No other entry needs a code change:

- **Types.** Besides `mcpServersDelivery`: doc text, new optional
members, and `BUILTIN_TOOL_NAMES` lists `SetGoal` in place of
`ProposeGoal`. The adapter names neither tool.
- **A warning for a tool list entry that does not look like a complete
rule**, on stderr and as a `system/informational` message. The adapter
adds only `AskUserQuestion` to `disallowedTools` and passes the
`claude_code` preset or `[]` as `tools`, so only a client's own list can
cause it. Both cores send an `informational` warning to the client as a
notice.
- **The `managed_mcp_arrived` warning** is an `informational` warning
too, and is sent the same way.
- **Some tool calls now ask in bypass permissions mode.** Such a call
reaches `canUseTool`. Neither core allows a call there because of the
session's mode, so the user is asked.
- **Bash permission checks ask before more commands.** These reach
`canUseTool` as any other request.
- **`modelUsage` and `total_cost_usd` count billed permission classifier
calls and calls that were stopped or cut.** Both cores take the row of
the turn's model and the increment over the last reading, so a new row
or a larger total needs no change.
- **`message_uuid` on `cancel_async_message` responses.**
`Query.cancelAsyncMessage()` still returns only `cancelled`, and the
adapter does not read the response.
- **`rewindFiles()` skips some files when the sandbox is on.** The
adapter only calls it with `dryRun: true`, for the file-change report.
- **`setMcpServers()`, `resumeSessionAt` and startup hook fixes.**
Picked up as they are: the adapter has no workaround for the old
behavior.
- **`getSessionInfo` and `listSessions`** read a transcript as before: a
differential run of 0.3.325 against 0.3.326 over 4,500 generated
transcripts gave no mismatch. The run is not part of this PR.
- **`@anthropic-ai/sdk` 1.9.0.** The adapter uses its types only. The
release changes API resources and tool helpers that the adapter does not
use.
- **typescript-eslint 8.73.0.** One new rule, which the config does not
turn on, and a narrower report location for `consistent-type-imports`.
`npm run lint` reports nothing.

## Not in this PR

- `mcpServersDelivery: 'initialize'`, which keeps a server's `env` and
`headers` off Claude Code's command line. It changes how a session with
MCP servers starts, and a Claude Code older than 2.1.326 cannot take it,
so it is its own PR, on top of this one.

## Testing

- `npm run build`, `npm run check`, `npm run test:run` (4,283 tests
pass)
- Real CLI: the integration tests (`RUN_INTEGRATION_TESTS=true`, with
`CLAUDE_CODE_ENTRYPOINT` unset), 914 tests pass. They include an MCP
server served over ACP, the output of a foreground Bash command and the
model list.
- Real CLI, without a prompt: with `'argv'`, Claude Code 2.1.326 and
2.1.323 both start a session with a stdio and an HTTP MCP server, and
the SDK prints no deprecation warning.
This commit is contained in:
Ben Brandt
2026-11-17 14:33:51 +01:00
committed by GitHub
parent 451bc04ae0
commit 4a076397c6
8 changed files with 187 additions and 157 deletions

279
package-lock.json generated
View File

@@ -10,7 +10,7 @@
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "2.7.0",
"@anthropic-ai/claude-agent-sdk": "0.3.325",
"@anthropic-ai/claude-agent-sdk": "0.3.326",
"diff": "9.0.0",
"zod": "4.6.7"
},
@@ -18,12 +18,12 @@
"claude-agent-acp": "dist/index.js"
},
"devDependencies": {
"@anthropic-ai/sdk": "1.8.0",
"@anthropic-ai/sdk": "1.9.0",
"@eslint/js": "10.0.1",
"@tsconfig/node22": "22.0.7",
"@types/node": "26.6.6",
"@typescript-eslint/eslint-plugin": "8.72.2",
"@typescript-eslint/parser": "8.72.2",
"@typescript-eslint/eslint-plugin": "8.73.0",
"@typescript-eslint/parser": "8.73.0",
"ajv": "8.20.0",
"ajv-formats": "3.0.1",
"eslint": "10.15.0",
@@ -53,22 +53,22 @@
}
},
"node_modules/@anthropic-ai/claude-agent-sdk": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.325.tgz",
"integrity": "sha512-MhSm2Fhk3DA/hhjdCKXDZWlnykpPWJjX42SogllAHMplY9ZKT+Ltb8QPtQxpe225Imfs4A8IKaNE4biivA+fHg==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.326.tgz",
"integrity": "sha512-BUTSky/4YWfL/MxC+4kV0NDbJFjbJPoQMFEk/s9G6hV9LUfYPMbsWz94bFQ7ZIo2ubj2xwJ2c2NVxkNlQhVw+Q==",
"license": "SEE LICENSE IN README.md",
"engines": {
"node": ">=18.14.0"
},
"optionalDependencies": {
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.325",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.325",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.325",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.325",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.325",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.325",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.325",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.325"
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.326",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.326",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.326"
},
"peerDependencies": {
"@anthropic-ai/sdk": ">=0.93.0",
@@ -77,9 +77,9 @@
}
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.325.tgz",
"integrity": "sha512-0u8bTug2zH+zWE8CMiFrm/ldmH20uA9B/zhXpI7ATHFJnpPMdwTqE56CFM0m3LOwnNum0jpRn7XV1dn6Pf2pqA==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.326.tgz",
"integrity": "sha512-D3ZbowCMdKNet0YPZlsJxdJUW1t1Q8KLy1BwNd+5eilf18TlCRtWZlm8DrewFLmu/gxBK7gcsq6uysrIVbPyQg==",
"cpu": [
"arm64"
],
@@ -90,9 +90,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.325.tgz",
"integrity": "sha512-HD3YRFyM5H5QH2usS/WD6gobk3BEp2jq9dKyrkhAVdQIqFMlrcSrRhGA0i3R1IOLxtPAYkmDGepZ62k1kMOW9Q==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.326.tgz",
"integrity": "sha512-m8K3Im2S8STdAVBrriuDZyJcnjsu/Vc3476wIOqTAefnCCdtdZ4AHcOcWxt+4KIHE5Vx1qT2qacTRrQBaVVweA==",
"cpu": [
"x64"
],
@@ -103,9 +103,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.325.tgz",
"integrity": "sha512-28oVrCEN6M6MJP8Od4SK/scal1QdLbn5Sci+qL8j55l6csHtPeUYF9zdjWLniFKph43pejfZf5te/Vf/bwehkw==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.326.tgz",
"integrity": "sha512-nYVN8jCcH490DCXIvby7rllzQFxLzKeKClfo2u/yv7mx3ipZQv344caULL/amwZ8w8GUzYyZ8hnS6pI9goSq+A==",
"cpu": [
"arm64"
],
@@ -119,9 +119,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.325.tgz",
"integrity": "sha512-72y6QNRZC4eMCxne/wNsuwNHsViSkgFKlYMCUVXxmiR9gpIMd3rf++oJMIsSuEAQqzqT7jwCrdtibv6R4bx5PA==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.326.tgz",
"integrity": "sha512-baSsuP2/wuWujRpHjKT4WkJB5lhttqKq9jcTfY2KRtQpylbk8E5PWcct/pmwJfNCKIUoE8CD+JpmoWzsdd5Ajw==",
"cpu": [
"arm64"
],
@@ -135,9 +135,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.325.tgz",
"integrity": "sha512-wXEWbDmNYiorY5EKASYjvQct8zHShUPmAS9N/IAsgPA/cx2vsOFqPQw8jRQKeaW6AmFgx7k/Wf7THalNXbMEkQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.326.tgz",
"integrity": "sha512-WMhDY07gk2O0E8FXTbrVYmPjSLFaYPDCPwsNueVxm6vZ7ek+lPaKuOMAxTb1K07TzSmTOexoWeX2Y9VrbVDMpw==",
"cpu": [
"x64"
],
@@ -151,9 +151,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.325.tgz",
"integrity": "sha512-BHewYUTd7mDLR5iHTVt6Q28gJKLC5C24b1H3NM0qGt9dxnjVUh1Lza52GzHY2Rb9hAPQymLSXWuVh1OFoFQatA==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.326.tgz",
"integrity": "sha512-kK9VO3uFqNd4wgeU0Cefluam5AdPu6mvF1nn6aboGy8TA5NoxlWTmA4/AwMhK39zK1S9Q2OjeX0JtAahYlIchw==",
"cpu": [
"x64"
],
@@ -167,9 +167,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.325.tgz",
"integrity": "sha512-NH3I2o105oKK8lfJ5RlzCp+YTZn3qncwQ1xSzQ4jqn7LUddThIidpFU7B+TKQxh1X9eayAp7EtrBQ36mXflQwQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.326.tgz",
"integrity": "sha512-S+Ai+HhGRVFfTDmYWRfTrdWF3b4KMsfLSThZCqRJ0WCOKOXrRShMKV1hqqHBljx/wkMDPCpY0V/9S/e6w57eGQ==",
"cpu": [
"arm64"
],
@@ -180,9 +180,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
"version": "0.3.325",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.325.tgz",
"integrity": "sha512-pjqVL++V/2oMJ6u1HdB608bcTUvzts1e8hX93Q8khasy2JB+R823bnvpQapcOurOWB3+v1X2JXIjXyWcGPJCQQ==",
"version": "0.3.326",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.326.tgz",
"integrity": "sha512-Yn1gZXYFuHmjHz7SpHx4TqDcRDsC8TfwWcntJdYjFzMWm+caPAp6QRqr/aTvirjqVA1D+D8Rd29xhuytpE3xTQ==",
"cpu": [
"x64"
],
@@ -193,9 +193,9 @@
]
},
"node_modules/@anthropic-ai/sdk": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.8.0.tgz",
"integrity": "sha512-yDOArk2+Qpd/djEKmZjrv7JZ+pn5iBHARJ9PAdvfhGf4H5wNqTgY/2K0/yDKdQdm8G8hrNQchMlBAHpPK7yBfg==",
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.9.0.tgz",
"integrity": "sha512-xDu4za3B+rK+5ZI8wLLoosiIuwi1ktZk/3L3KKNahwO50O34H+622hly8JdXzaEerLQDhsqwVzp81Nrw80BYHg==",
"license": "Apache-2.0",
"dependencies": {
"@opentelemetry/api": "^1.4.1",
@@ -328,23 +328,6 @@
"node": "^20.19.0 || ^22.13.0 || >=24"
}
},
"node_modules/@eslint/config-array/node_modules/minimatch": {
"version": "11.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/@eslint/config-helpers": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
@@ -417,9 +400,9 @@
}
},
"node_modules/@hono/node-server": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
"integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.9.tgz",
"integrity": "sha512-Sk4NQd3GFY0WZWCzndwFMPwJhtD0y9qjsQ+pjID0/03nK9pxyBCUoUHCho8QYBLBVhi0ssL8UkNPHqbgSOFPIQ==",
"license": "MIT",
"peer": true,
"engines": {
@@ -968,9 +951,9 @@
"license": "MIT"
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz",
"integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -1029,17 +1012,17 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.2.tgz",
"integrity": "sha512-222PKFXKihmFpi/pS5njoBgdAqsPhj2/GBmFbrNw8Tq8gEG9Sv+kSlKFy4u2q+mJv9ZzJgM2Gkv/bUzRZwZw5g==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz",
"integrity": "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.72.2",
"@typescript-eslint/type-utils": "8.72.2",
"@typescript-eslint/utils": "8.72.2",
"@typescript-eslint/visitor-keys": "8.72.2",
"@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/type-utils": "8.73.0",
"@typescript-eslint/utils": "8.73.0",
"@typescript-eslint/visitor-keys": "8.73.0",
"ignore": "^7.0.5",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0"
@@ -1052,22 +1035,22 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.72.2",
"@typescript-eslint/parser": "^8.73.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.2.tgz",
"integrity": "sha512-llP+T1YuJOLlxEciP6OyQGtz5SMxyn+9LA2BvZw5RmToGVa1y4beEDVQL6Gje7T5WFYh19WREjDCN9Ev4gm5AA==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.73.0.tgz",
"integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/scope-manager": "8.72.2",
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/typescript-estree": "8.72.2",
"@typescript-eslint/visitor-keys": "8.72.2",
"@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.73.0",
"@typescript-eslint/visitor-keys": "8.73.0",
"debug": "^4.4.3"
},
"engines": {
@@ -1083,14 +1066,14 @@
}
},
"node_modules/@typescript-eslint/project-service": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.2.tgz",
"integrity": "sha512-6y5dLTZdHhI8Eh3yIQ/bfQhRKwn5e+TpJj64o18Cngc0iW/BCrVvrr6zGYqXPnYH31u6YXAYiFh0+qxX5mybJw==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.73.0.tgz",
"integrity": "sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.72.2",
"@typescript-eslint/types": "^8.72.2",
"@typescript-eslint/tsconfig-utils": "^8.73.0",
"@typescript-eslint/types": "^8.73.0",
"debug": "^4.4.3"
},
"engines": {
@@ -1105,14 +1088,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.2.tgz",
"integrity": "sha512-iIoMJ6/8c1/QpFNyFjU0d1YzPco4MsZjQw0k3V+vfzNWAFmUmvhlyMoYEoYYDQZXc+J6Gi1X5XcxlzW2taIIGQ==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz",
"integrity": "sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/visitor-keys": "8.72.2"
"@typescript-eslint/types": "8.73.0",
"@typescript-eslint/visitor-keys": "8.73.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1123,9 +1106,9 @@
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.2.tgz",
"integrity": "sha512-+h3iCgZXuTNtoLXcnnjP12ZUHLMqoUcIHPfQrFEXTUqvb9dF8QK9b5nv5VtSo5fLkdHuks8ehbTzZj3rImAm9w==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz",
"integrity": "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1140,15 +1123,15 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.2.tgz",
"integrity": "sha512-STfkR38qIdhfkLpgtXnUjAzsNy4xouqiBO0lrVc/Wpk9Kem5/aHXUx1J8dGC16zpdYN1+yc2ILQ28er1kXX7ag==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz",
"integrity": "sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/typescript-estree": "8.72.2",
"@typescript-eslint/utils": "8.72.2",
"@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.73.0",
"@typescript-eslint/utils": "8.73.0",
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0"
},
@@ -1165,9 +1148,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.2.tgz",
"integrity": "sha512-Xfn37OLZx03+PCU7qWx9DTv2FCRh1E6fk2+wONeNY15HXIwtcwuveaSwVpGAUptkNmPQegRxW5JyRel9T7wrog==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz",
"integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1179,18 +1162,18 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.2.tgz",
"integrity": "sha512-pQEGqIK/cqEvKivVWaFLYpe7XYejFxfuAOi4mu1oAWFvIo36aRHI9esRFTUxcIy/z8N482RJyH+LpZB0ZIU7Ow==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz",
"integrity": "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.72.2",
"@typescript-eslint/tsconfig-utils": "8.72.2",
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/visitor-keys": "8.72.2",
"@typescript-eslint/project-service": "8.73.0",
"@typescript-eslint/tsconfig-utils": "8.73.0",
"@typescript-eslint/types": "8.73.0",
"@typescript-eslint/visitor-keys": "8.73.0",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"minimatch": "^11.0.1",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
@@ -1203,20 +1186,26 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
"typescript": ">=4.8.4 <6.1.0"
},
"peerDependenciesMeta": {
"@typescript/native": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.2.tgz",
"integrity": "sha512-hv3eRYbpPbbpezuax1EfGrzpa3C4ySgNZkPUkLOWOAjU8HsOKowEDAr8C7nsNl1C+SBSKDpvno6VKHnlhvp9iA==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz",
"integrity": "sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.72.2",
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/typescript-estree": "8.72.2"
"@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.73.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1231,13 +1220,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.72.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.2.tgz",
"integrity": "sha512-NAGrjn0Pitjqzq/GkgMC4kBYm233PQ8GffyQ9+kTA3AlNQYEzOf25EIM02BAHZv5FRJSpHpJk+OGUxVkOB93GQ==",
"version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz",
"integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.72.2",
"@typescript-eslint/types": "8.73.0",
"eslint-visitor-keys": "^5.0.0"
},
"engines": {
@@ -1886,23 +1875,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/eslint/node_modules/minimatch": {
"version": "11.0.8",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/espree": {
"version": "11.2.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz",
@@ -2403,9 +2375,9 @@
}
},
"node_modules/hono": {
"version": "4.13.18",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
"version": "4.13.19",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.19.tgz",
"integrity": "sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==",
"license": "MIT",
"peer": true,
"engines": {
@@ -2458,9 +2430,9 @@
}
},
"node_modules/ignore": {
"version": "7.0.14",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz",
"integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==",
"version": "7.0.16",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
"integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2983,16 +2955,17 @@
}
},
"node_modules/minimatch": {
"version": "10.2.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
"version": "11.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.8"
"@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12"
},
"engines": {
"node": "18 || 20 || >=22"
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -3444,9 +3417,9 @@
}
},
"node_modules/router": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/router/-/router-2.3.0.tgz",
"integrity": "sha512-bpowRfGjEPe8t9R6fJIzhwmyCGAXwKvxBUsgJm+bJukwdcWmUXbMo7p22w7aYmQBPQTUMNqMV39YX0kMou3z8w==",
"license": "MIT",
"peer": true,
"dependencies": {
@@ -3458,6 +3431,10 @@
},
"engines": {
"node": ">= 18"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/safer-buffer": {

View File

@@ -69,17 +69,17 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "2.7.0",
"@anthropic-ai/claude-agent-sdk": "0.3.325",
"@anthropic-ai/claude-agent-sdk": "0.3.326",
"diff": "9.0.0",
"zod": "4.6.7"
},
"devDependencies": {
"@anthropic-ai/sdk": "1.8.0",
"@anthropic-ai/sdk": "1.9.0",
"@eslint/js": "10.0.1",
"@tsconfig/node22": "22.0.7",
"@types/node": "26.6.6",
"@typescript-eslint/eslint-plugin": "8.72.2",
"@typescript-eslint/parser": "8.72.2",
"@typescript-eslint/eslint-plugin": "8.73.0",
"@typescript-eslint/parser": "8.73.0",
"ajv": "8.20.0",
"ajv-formats": "3.0.1",
"eslint": "10.15.0",

View File

@@ -1,5 +1,6 @@
import { existsSync } from "node:fs";
import { join } from "node:path";
import type { Options } from "@anthropic-ai/claude-agent-sdk";
const CLI_FILE_NAME = process.platform === "win32" ? "claude.exe" : "claude";
@@ -30,6 +31,20 @@ export async function claudeCliPath(): Promise<string> {
return installedClaudeCliPath();
}
/**
* How a session's MCP servers reach the Claude CLI unless the client's options
* name a `mcpServersDelivery`: in the `--mcp-config` flag, as before SDK
* 0.3.326. A server's `env` and `headers` are then on the CLI's command line.
* `'initialize'` sends them over stdin instead, but with a CLI that cannot
* read them there (e.g. 2.1.323 through `CLAUDE_CODE_EXECUTABLE`) the session
* fails at startup.
*
* The adapter always sets the option. It names the CLI to start
* (`pathToClaudeCodeExecutable`), and for such an app the SDK prints a
* `DeprecationWarning` when a session has MCP servers and the option is unset.
*/
export const MCP_SERVERS_DELIVERY: NonNullable<Options["mcpServersDelivery"]> = "argv";
function bundledClaudeCliPath(directory: string): string {
const path = join(directory, CLI_FILE_NAME);
// Without this check, spawning a missing CLI fails with a bare ENOENT.

View File

@@ -615,6 +615,19 @@ describe("createSession options merging", () => {
expect(capturedOptions!.promptSuggestions).toBe(false);
});
it.each([
{ name: "sends MCP servers on the command line", delivery: undefined },
{ name: "lets a caller choose the MCP delivery", delivery: "initialize" as const },
])("$name", async ({ delivery }) => {
await agent.newSession({
cwd: process.cwd(),
mcpServers: [],
...(delivery && { _meta: { claudeCode: { options: { mcpServersDelivery: delivery } } } }),
});
expect(capturedOptions!.mcpServersDelivery).toBe(delivery ?? "argv");
});
it("defaults tools to claude_code preset when not provided", async () => {
await agent.newSession({
cwd: process.cwd(),

View File

@@ -878,6 +878,26 @@ describe("ACP v2 core", () => {
expect(claude.options.env?.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS).toBe("1");
});
it.each([
{ name: "sends MCP servers on the command line", delivery: undefined },
{ name: "lets the client choose the MCP delivery", delivery: "initialize" },
])("$name", async ({ delivery }) => {
const client = v2Client();
await client.connect(async (agent) => {
await agent.request(v2.methods.agent.initialize, {
protocolVersion: v2.PROTOCOL_VERSION,
info: { name: "v2-test-client", version: "1.0.0" },
capabilities: {},
});
await agent.request(v2.methods.agent.session.new, {
cwd,
...(delivery && { _meta: { claudeCode: { options: { mcpServersDelivery: delivery } } } }),
});
});
expect(sdk.processes[0].options.mcpServersDelivery).toBe(delivery ?? "argv");
});
it("answers a prompt when Claude Code starts it, and reports the work until the turn's result", async () => {
const client = v2Client();
await client.connect(async (agent) => {

View File

@@ -187,7 +187,7 @@ import {
import { AuthStatusReporter, cliLogout } from "../auth-status-reporter.js";
import { terminalAuthMethods as authMethodsForTerminal } from "../auth-methods.js";
import { McpOverAcp, sdkMcpServers } from "../mcp-servers.js";
import { claudeCliPath } from "../claude-cli.js";
import { claudeCliPath, MCP_SERVERS_DELIVERY } from "../claude-cli.js";
import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
import { randomUUID } from "node:crypto";
import type { Stats } from "node:fs";
@@ -10134,6 +10134,8 @@ export class ClaudeAcpAgent {
// Before `userProvidedOptions`, so a client that passes
// `promptSuggestions: false` keeps it off.
promptSuggestions: true,
// Before `userProvidedOptions`, so a client's own `mcpServersDelivery` wins.
mcpServersDelivery: MCP_SERVERS_DELIVERY,
...userProvidedOptions,
// Claude Code uses the same checkpoint store for /rewind. Enable it only
// for clients that negotiated per-turn file-change reports; this avoids

View File

@@ -38,6 +38,7 @@ const OPTION_REBUILDS_SESSION = {
maxThinkingTokens: true,
maxTurns: true,
mcpServers: true,
mcpServersDelivery: true,
model: true,
outputFormat: true,
pathToClaudeCodeExecutable: true,

View File

@@ -33,7 +33,7 @@ import packageJson from "../../package.json" with { type: "json" };
import { messageIdForGrouping } from "../sdk-to-acp.js";
import type { Logger } from "../logger.js";
import { customAgents } from "../session-config-options.js";
import { claudeCliPath } from "../claude-cli.js";
import { claudeCliPath, MCP_SERVERS_DELIVERY } from "../claude-cli.js";
import { clientSystemPrompt, sessionSystemPrompt } from "../client-system-prompt.js";
import type { ElicitationSupport } from "../elicitation.js";
import { forkSession } from "../fork-session.js";
@@ -1062,6 +1062,8 @@ class V2Agent implements AgentHandle, SessionConnection {
// AIR gets it, so no other client's session spends a request on it.
// Before the client's options: `promptSuggestions: false` turns it off.
...(this.air.client ? { promptSuggestions: true } : {}),
// Before the client's options: its own `mcpServersDelivery` wins.
mcpServersDelivery: MCP_SERVERS_DELIVERY,
...client,
// The checkpoints that AIR's file-change reports read (see
// `file-changes.ts`), only for a client that declared them, as on v1.