@leo000001/claude-code-mcp 2.4.8 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -4
- package/NOTICE.md +2 -2
- package/README.md +91 -27
- package/dist/index.js +213 -22
- package/dist/index.js.map +1 -1
- package/package.json +96 -96
package/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Upgrade `@anthropic-ai/claude-agent-sdk` to `^0.2.81` and align exposed option passthrough with current SDK fields (`toolConfig`, `agentProgressSummaries`, `settings`).
|
|
8
|
+
- Expand SDK stream/event mapping for `rate_limit_event`, `system/api_retry`, `system/local_command_output`, `system/elicitation_complete`, `system/compact_boundary`, and partial `stream_event` output.
|
|
9
|
+
- Preserve newer SDK metadata in session/results, including `fastModeState` and richer permission prompt labels (`title`, `displayName`).
|
|
10
|
+
- Prefer SDK permission `suggestions` for `allow_for_session` responses and sync session metadata from `system/init` (for example actual model / permission mode).
|
|
11
|
+
|
|
12
|
+
### Documentation
|
|
13
|
+
|
|
14
|
+
- Add OpenCode-specific setup and usage guidance, including local MCP config examples and async polling recommendations.
|
|
15
|
+
- Sync README and DESIGN option/message matrices with the current SDK 0.2.81 surface.
|
|
16
|
+
|
|
17
|
+
## 2.5.0 (2026-02-27)
|
|
18
|
+
|
|
5
19
|
### Security
|
|
6
20
|
|
|
7
21
|
- Validate `resumeToken` using timing-safe comparison (`timingSafeEqual` for fixed-length HMAC tokens) to reduce timing side-channel risk.
|
|
22
|
+
- Refresh transitive dependencies via `npm audit fix` (0 known vulnerabilities after update).
|
|
8
23
|
|
|
9
24
|
### Improvements
|
|
10
25
|
|
|
11
|
-
- Upgrade `@anthropic-ai/claude-agent-sdk` to `^0.2.
|
|
12
|
-
-
|
|
26
|
+
- Upgrade `@anthropic-ai/claude-agent-sdk` to `^0.2.62` and align MCP-facing schemas with the current SDK surface.
|
|
27
|
+
- Upgrade `@modelcontextprotocol/sdk` to `^1.27.1`.
|
|
28
|
+
- Permission mode enum now follows SDK 0.2.62 (`default`, `acceptEdits`, `bypassPermissions`, `plan`, `dontAsk`; `delegate` removed).
|
|
13
29
|
- Session cleanup now marks timed-out running/waiting sessions as `cancelled` for consistent status semantics.
|
|
14
30
|
- `SessionManager.destroy()` now clears in-memory session/runtime maps after aborting active runs, so post-destroy reads are no longer stale.
|
|
15
31
|
- Event buffer eviction now uses batch compaction (instead of repeated `findIndex` + `splice`) and `readEvents` now uses binary search for cursor start.
|
|
@@ -18,7 +34,8 @@
|
|
|
18
34
|
- Enrich compatibility resources with package version, disk-resume diagnostics, and runtime limits.
|
|
19
35
|
- Remove deprecated `claude_code` parameter aliases: top-level `sessionInitTimeoutMs` and `advanced.effort` / `advanced.thinking`.
|
|
20
36
|
- Add support for SDK `promptSuggestions` option passthrough and expose `promptSuggestions` in `advanced`/`diskResumeConfig`.
|
|
21
|
-
- Query consumer now maps additional SDK stream messages (`system/task_started`, `rate_limit`, `prompt_suggestion`) to progress events.
|
|
37
|
+
- Query consumer now maps additional SDK stream messages (`system/task_started`, `system/task_progress`, `system/hook_*`, `system/files_persisted`, `rate_limit`, `prompt_suggestion`) to progress events.
|
|
38
|
+
- Event buffer eviction now prefers dropping noisy progress events before output events to reduce missed output under high-frequency streams.
|
|
22
39
|
|
|
23
40
|
### Documentation
|
|
24
41
|
|
|
@@ -41,7 +58,7 @@
|
|
|
41
58
|
- Add `CLAUDE_CODE_MCP_MAX_PENDING_PERMISSIONS` (default: `64`) to cap outstanding permission requests per session.
|
|
42
59
|
- Promote `effort` and `thinking` to top-level parameters on `claude_code` and `claude_code_reply` (deprecated aliases: `advanced.effort`, `advanced.thinking`).
|
|
43
60
|
- Tool responses now include `structuredContent` (in addition to JSON text) for easier MCP client consumption.
|
|
44
|
-
- Emit `tools/list_changed` and `resources/list_changed` once after connect; update `claude_code` tool description dynamically when runtime tool discovery changes.
|
|
61
|
+
- Emit `notifications/tools/list_changed` and `notifications/resources/list_changed` once after connect; update `claude_code` tool description dynamically when runtime tool discovery changes.
|
|
45
62
|
- Align declared MCP capabilities with implemented primitives (`logging`, `tools`, `resources`) and remove prompt primitive exposure.
|
|
46
63
|
- Add unit tests for `build-options.ts` and `race-with-abort.ts`.
|
|
47
64
|
|
package/NOTICE.md
CHANGED
|
@@ -9,8 +9,8 @@ requirements on redistribution and use.
|
|
|
9
9
|
|
|
10
10
|
### Direct dependencies (from `package.json`)
|
|
11
11
|
|
|
12
|
-
- `@anthropic-ai/claude-agent-sdk@0.2.
|
|
13
|
-
- `@modelcontextprotocol/sdk@1.
|
|
12
|
+
- `@anthropic-ai/claude-agent-sdk@0.2.81` — license is declared as “SEE LICENSE IN README.md” in the package metadata. This package bundles a Claude Code CLI; please review Anthropic's documentation and legal terms referenced by that project before redistributing or deploying.
|
|
13
|
+
- `@modelcontextprotocol/sdk@1.27.1` — MIT License
|
|
14
14
|
- `zod@4.3.6` — MIT License
|
|
15
15
|
|
|
16
16
|
For a complete dependency graph, see `package-lock.json`. When installed, each dependency’s
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/xihuai18/claude-code-mcp/blob/HEAD/LICENSE)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
|
|
7
|
-
MCP server that wraps [Claude Code (Claude Agent SDK)](https://docs.anthropic.com/en/docs/claude-code/overview) as tools, enabling any MCP client to invoke Claude Code for autonomous coding tasks. Designed for local use — the MCP server and client are expected to run on the same machine.
|
|
7
|
+
MCP server that wraps [Claude Code (Claude Agent SDK)](https://docs.anthropic.com/en/docs/claude-code/overview) as tools, enabling any MCP client to invoke Claude Code for autonomous coding tasks. Designed for local use — the MCP server and client are expected to run on the same machine. It works especially well with OpenCode/Codex-style clients that prefer async polling and explicit permission decisions.
|
|
8
8
|
|
|
9
9
|
Inspired by the [Codex MCP](https://developers.openai.com/codex/guides/agents-sdk/) design philosophy — minimum tools, maximum capability.
|
|
10
10
|
|
|
@@ -32,7 +32,7 @@ See `CHANGELOG.md` for release history.
|
|
|
32
32
|
|
|
33
33
|
This MCP server uses the [`@anthropic-ai/claude-agent-sdk`](https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk) package, which **bundles its own Claude Code CLI** (`cli.js`). It does not use the `claude` binary from your system PATH.
|
|
34
34
|
|
|
35
|
-
- The SDK
|
|
35
|
+
- The SDK bundles a Claude Code CLI; its version generally tracks the SDK package version, but the exact scheme is not guaranteed
|
|
36
36
|
- **Configuration is shared** — the bundled CLI reads API keys and settings from `~/.claude/`, same as the system-installed `claude`
|
|
37
37
|
- **All local settings are loaded by default** — unlike the raw SDK (which defaults to isolation mode), this MCP server loads `user`, `project`, and `local` settings automatically, including `CLAUDE.md` project context. Pass `advanced.settingSources: []` to opt out
|
|
38
38
|
- You must have Claude Code configured (API key set up) before using this MCP server: see [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/overview)
|
|
@@ -62,7 +62,7 @@ Add to your MCP client configuration (Claude Desktop, Cursor, etc.):
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
> Some clients cache tool/resource metadata at connect-time. This server emits `notifications/tools/list_changed` and
|
|
65
|
+
> Some clients cache tool/resource metadata at connect-time. This server emits `notifications/tools/list_changed` and `notifications/resources/list_changed` after runtime tool discovery so clients can refresh both the `claude_code` tool description and `internal-tools` resource.
|
|
66
66
|
|
|
67
67
|
### Anthropic Claude Code CLI (as an MCP client)
|
|
68
68
|
|
|
@@ -70,6 +70,26 @@ Add to your MCP client configuration (Claude Desktop, Cursor, etc.):
|
|
|
70
70
|
claude mcp add --transport stdio claude-code -- npx -y @leo000001/claude-code-mcp
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
### OpenCode
|
|
74
|
+
|
|
75
|
+
Add a local MCP entry in `opencode.json` / `opencode.jsonc` (project) or the global OpenCode config under `~/.config/opencode/`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcp": {
|
|
80
|
+
"claude-code": {
|
|
81
|
+
"type": "local",
|
|
82
|
+
"command": ["npx", "-y", "@leo000001/claude-code-mcp"],
|
|
83
|
+
"enabled": true
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
OpenCode tip: start with `claude_code`, keep the returned `sessionId`, then background-poll with `claude_code_check`. When approvals appear, `decision: "allow_for_session"` is usually the best UX because it reduces repeated prompts for the same tool in a session.
|
|
90
|
+
|
|
91
|
+
> OpenCode project configs can launch local commands. Only enable repository-level MCP configs in repos you trust.
|
|
92
|
+
|
|
73
93
|
### OpenAI Codex CLI
|
|
74
94
|
|
|
75
95
|
```bash
|
|
@@ -117,13 +137,13 @@ Start a new Claude Code session. The agent autonomously performs coding tasks: r
|
|
|
117
137
|
| `advanced` | object | No | Advanced/low-frequency parameters (see below) |
|
|
118
138
|
|
|
119
139
|
<details>
|
|
120
|
-
<summary><code>advanced</code> object parameters (
|
|
140
|
+
<summary><code>advanced</code> object parameters (24 low-frequency parameters)</summary>
|
|
121
141
|
|
|
122
142
|
| Parameter | Type | Description |
|
|
123
143
|
| ------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
124
144
|
| `advanced.tools` | string[] \| object | Define the base tool set. Default: SDK/Claude Code default toolset. Array of tool name strings, or `{ type: "preset", preset: "claude_code" }` for the default toolset. `allowedTools`/`disallowedTools` further filter on top of this |
|
|
125
145
|
| `advanced.persistSession` | boolean | Persist session history to disk (`~/.claude/projects/`). Default: `true`. Set `false` to disable. |
|
|
126
|
-
| `advanced.sessionInitTimeoutMs` | number | Session init timeout in milliseconds waiting for `system/init`. Default: `10000`.
|
|
146
|
+
| `advanced.sessionInitTimeoutMs` | number | Session init timeout in milliseconds waiting for `system/init`. Default: `10000`. |
|
|
127
147
|
| `advanced.agents` | object | Define custom sub-agents the main agent can delegate tasks to. Default: none. SDK default: if a sub-agent omits `tools`, it inherits all tools from the parent. |
|
|
128
148
|
| `advanced.agent` | string | Name of a custom agent (defined in `agents`) to use as the primary agent. Default: omitted |
|
|
129
149
|
| `advanced.maxBudgetUsd` | number | Maximum budget in USD. Default: SDK/Claude Code default |
|
|
@@ -135,9 +155,12 @@ Start a new Claude Code session. The agent autonomously performs coding tasks: r
|
|
|
135
155
|
| `advanced.sandbox` | object | Sandbox configuration for isolating shell command execution (e.g., Docker container settings). Default: SDK/Claude Code default |
|
|
136
156
|
| `advanced.fallbackModel` | string | Fallback model if the primary model fails or is unavailable. Default: none |
|
|
137
157
|
| `advanced.enableFileCheckpointing` | boolean | Enable file checkpointing to track file changes during the session. Default: `false` |
|
|
158
|
+
| `advanced.toolConfig` | object | Per-tool built-in configuration. Example: `{ askUserQuestion: { previewFormat: "html" } }`. Default: none |
|
|
138
159
|
| `advanced.includePartialMessages` | boolean | When true, includes intermediate streaming messages in the response. Useful for real-time progress monitoring. Default: false |
|
|
139
|
-
| `advanced.promptSuggestions` | boolean | When true, emits post-turn prompt suggestion events (`prompt_suggestion`). Default: `false`
|
|
160
|
+
| `advanced.promptSuggestions` | boolean | When true, emits post-turn prompt suggestion events (`prompt_suggestion`). Default: `false` |
|
|
161
|
+
| `advanced.agentProgressSummaries` | boolean | When true, emits AI-generated summaries on `system/task_progress` events for running subagents. Default: `false` |
|
|
140
162
|
| `advanced.strictMcpConfig` | boolean | Enforce strict validation of MCP server configurations. Default: `false` |
|
|
163
|
+
| `advanced.settings` | string \| object | Extra Claude Code flag settings. Pass either a path to a settings JSON file or an inline settings object. Default: none |
|
|
141
164
|
| `advanced.settingSources` | string[] | Which filesystem settings to load. Defaults to `["user", "project", "local"]` (loads all settings and CLAUDE.md). Pass `[]` for SDK isolation mode |
|
|
142
165
|
| `advanced.debug` | boolean | Enable debug mode for verbose logging. Default: `false` |
|
|
143
166
|
| `advanced.debugFile` | string | Write debug logs to a specific file path (implicitly enables debug mode). Default: omitted |
|
|
@@ -178,7 +201,7 @@ Continue an existing session by sending a follow-up message. The agent retains f
|
|
|
178
201
|
| `diskResumeConfig` | object | No | Disk resume parameters (see below). Used when `CLAUDE_CODE_MCP_ALLOW_DISK_RESUME=1` and in-memory session is missing |
|
|
179
202
|
|
|
180
203
|
<details>
|
|
181
|
-
<summary><code>diskResumeConfig</code> object parameters (
|
|
204
|
+
<summary><code>diskResumeConfig</code> object parameters (34 disk-resume-only parameters)</summary>
|
|
182
205
|
|
|
183
206
|
| Parameter | Type | Description |
|
|
184
207
|
| --------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------- |
|
|
@@ -206,9 +229,12 @@ Continue an existing session by sending a follow-up message. The agent retains f
|
|
|
206
229
|
| `diskResumeConfig.sandbox` | object | Sandbox config for command isolation. Default: SDK/Claude Code default |
|
|
207
230
|
| `diskResumeConfig.fallbackModel` | string | Fallback model. Default: none |
|
|
208
231
|
| `diskResumeConfig.enableFileCheckpointing` | boolean | Enable file checkpointing. Default: `false` |
|
|
232
|
+
| `diskResumeConfig.toolConfig` | object | Per-tool built-in configuration. Default: none |
|
|
209
233
|
| `diskResumeConfig.includePartialMessages` | boolean | Include intermediate streaming messages. Default: `false` |
|
|
210
|
-
| `diskResumeConfig.promptSuggestions` | boolean | Emit post-turn prompt suggestion events (`prompt_suggestion`). Default: `false`
|
|
234
|
+
| `diskResumeConfig.promptSuggestions` | boolean | Emit post-turn prompt suggestion events (`prompt_suggestion`). Default: `false` |
|
|
235
|
+
| `diskResumeConfig.agentProgressSummaries` | boolean | Emit AI-generated subagent progress summaries. Default: `false` |
|
|
211
236
|
| `diskResumeConfig.strictMcpConfig` | boolean | Strict MCP config validation. Default: `false` |
|
|
237
|
+
| `diskResumeConfig.settings` | string \| object | Extra Claude Code flag settings (path or inline object). Default: none |
|
|
212
238
|
| `diskResumeConfig.settingSources` | string[] | Which filesystem settings to load. Default: `["user", "project", "local"]` |
|
|
213
239
|
| `diskResumeConfig.debug` | boolean | Debug mode. Default: `false` |
|
|
214
240
|
| `diskResumeConfig.debugFile` | string | Debug log file path. Default: omitted |
|
|
@@ -260,15 +286,15 @@ Resource templates:
|
|
|
260
286
|
|
|
261
287
|
List, inspect, cancel, or interrupt sessions.
|
|
262
288
|
|
|
263
|
-
| Parameter | Type | Required | Description
|
|
264
|
-
| ------------------ | ------- | ------------------------ |
|
|
265
|
-
| `action` | string | Yes | `"list"`, `"get"`, `"cancel"`, or `"interrupt"`
|
|
266
|
-
| `sessionId` | string | For get/cancel/interrupt | Target session ID
|
|
267
|
-
| `includeSensitive` | boolean | No | Include `cwd`/`systemPrompt`/`agents`/`additionalDirectories` (default: false) |
|
|
289
|
+
| Parameter | Type | Required | Description |
|
|
290
|
+
| ------------------ | ------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
291
|
+
| `action` | string | Yes | `"list"`, `"get"`, `"cancel"`, or `"interrupt"` |
|
|
292
|
+
| `sessionId` | string | For get/cancel/interrupt | Target session ID |
|
|
293
|
+
| `includeSensitive` | boolean | No | Include `cwd`/`systemPrompt`/`agents`/`additionalDirectories`/`toolConfig` (default: false; `settings` stays hidden) |
|
|
268
294
|
|
|
269
295
|
**Returns:** `{ sessions, message?, isError? }`
|
|
270
296
|
|
|
271
|
-
`sessions[]` now includes lightweight diagnostics fields: `pendingPermissionCount`, `eventCount`, `currentCursor`, `lastEventId`, `ttlMs`, `lastError?`, `lastErrorAt?`, and `redactions[]`.
|
|
297
|
+
`sessions[]` now includes lightweight diagnostics fields: `pendingPermissionCount`, `eventCount`, `currentCursor`, `lastEventId`, `ttlMs`, `lastError?`, `lastErrorAt?`, `fastModeState?`, and `redactions[]`.
|
|
272
298
|
|
|
273
299
|
### `claude_code_check` — Poll events and respond to permission requests
|
|
274
300
|
|
|
@@ -291,18 +317,18 @@ Poll session events/results and approve/deny pending permission requests.
|
|
|
291
317
|
<details>
|
|
292
318
|
<summary><code>pollOptions</code> object parameters (10 fine-grained poll controls)</summary>
|
|
293
319
|
|
|
294
|
-
| Parameter | Type | Description
|
|
295
|
-
| ------------------------------------- | ------- |
|
|
296
|
-
| `pollOptions.includeTools` | boolean | When true, includes `availableTools` (`poll` only). Default: `false` (omitted until session init is received). Derived from SDK `system/init.tools` (internal features may not appear).
|
|
297
|
-
| `pollOptions.includeEvents` | boolean | When false, omits `events` (but `nextCursor` still advances). Default: `true`
|
|
298
|
-
| `pollOptions.includeActions` | boolean | When false, omits `actions[]` even if `waiting_permission`. Default: `true`
|
|
299
|
-
| `pollOptions.includeResult` | boolean | When false, omits top-level `result` even when `idle`/`error`. Default: `true`
|
|
300
|
-
| `pollOptions.includeUsage` | boolean | Include `result.usage` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`)
|
|
301
|
-
| `pollOptions.includeModelUsage` | boolean | Include `result.modelUsage` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`)
|
|
302
|
-
| `pollOptions.includeStructuredOutput` | boolean | Include `result.structuredOutput` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`)
|
|
303
|
-
| `pollOptions.includeTerminalEvents` | boolean | When true, keeps terminal `result`/`error` events in `events` even if top-level `result` is included. Default: `false` in `"minimal"`/`"delta_compact"`, `true` in `"full"`
|
|
304
|
-
| `pollOptions.includeProgressEvents` | boolean | When true, includes progress
|
|
305
|
-
| `pollOptions.maxBytes` | number | Approximate max JSON bytes for `events` in this response. When exceeded, events are truncated and `truncatedFields` includes `"events_bytes"`. Default: unlimited
|
|
320
|
+
| Parameter | Type | Description |
|
|
321
|
+
| ------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
322
|
+
| `pollOptions.includeTools` | boolean | When true, includes `availableTools` (`poll` only). Default: `false` (omitted until session init is received). Derived from SDK `system/init.tools` (internal features may not appear). |
|
|
323
|
+
| `pollOptions.includeEvents` | boolean | When false, omits `events` (but `nextCursor` still advances). Default: `true` |
|
|
324
|
+
| `pollOptions.includeActions` | boolean | When false, omits `actions[]` even if `waiting_permission`. Default: `true` |
|
|
325
|
+
| `pollOptions.includeResult` | boolean | When false, omits top-level `result` even when `idle`/`error`. Default: `true` |
|
|
326
|
+
| `pollOptions.includeUsage` | boolean | Include `result.usage` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`) |
|
|
327
|
+
| `pollOptions.includeModelUsage` | boolean | Include `result.modelUsage` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`) |
|
|
328
|
+
| `pollOptions.includeStructuredOutput` | boolean | Include `result.structuredOutput` (default: `true` in `"full"`, `false` in `"minimal"`/`"delta_compact"`) |
|
|
329
|
+
| `pollOptions.includeTerminalEvents` | boolean | When true, keeps terminal `result`/`error` events in `events` even if top-level `result` is included. Default: `false` in `"minimal"`/`"delta_compact"`, `true` in `"full"` |
|
|
330
|
+
| `pollOptions.includeProgressEvents` | boolean | When true, includes noisy SDK progress subtypes (e.g. `tool_progress`, `auth_status`, `system/api_retry`, `system/task_progress`, `system/hook_progress`) as MCP `progress` events. Default: `false` in `"minimal"`/`"delta_compact"`, `true` in `"full"` |
|
|
331
|
+
| `pollOptions.maxBytes` | number | Approximate max JSON bytes for `events` in this response. When exceeded, events are truncated and `truncatedFields` includes `"events_bytes"`. Default: unlimited |
|
|
306
332
|
|
|
307
333
|
</details>
|
|
308
334
|
|
|
@@ -330,8 +356,11 @@ Notes:
|
|
|
330
356
|
- `toolValidation` reports whether configured `allowedTools`/`disallowedTools` match runtime-discovered tool names.
|
|
331
357
|
- `compatWarnings` surfaces compatibility hints (for example, unresolved tool names or path/platform mismatch signals) and is **non-blocking**; treat it as advisory unless the session actually fails.
|
|
332
358
|
- Permission `actions[]` include `timeoutMs`, `expiresAt`, and best-effort `remainingMs` to help callers avoid auto-deny timeouts.
|
|
359
|
+
- Permission `actions[]` may also include SDK-provided `title` / `displayName` metadata; clients should prefer those strings when rendering approval UI.
|
|
360
|
+
- For `decision="allow_for_session"`, the server now prefers SDK-provided `suggestions` (for example `addDirectories`) when present, then falls back to a generic per-session tool allow rule.
|
|
333
361
|
- `permission_result` event data is `{ requestId, toolName, behavior, source, message?, interrupt? }` (denial details only present for `deny`).
|
|
334
|
-
-
|
|
362
|
+
- `result.fastModeState` may be present when the SDK reports fast-mode state, and `claude_code_session` surfaces the latest known `fastModeState` for each session.
|
|
363
|
+
- In `"minimal"` mode (default): assistant message events are slimmed (strips `usage`, `model`, `id`, `cache_control` from content blocks); noisy SDK progress subtypes (`tool_progress`, `auth_status`, `system/api_retry`, `system/task_progress`, `system/hook_progress`) are filtered out; `lastEventId`/`lastToolUseId` are omitted; `AgentResult` omits `durationApiMs`/`sessionTotalTurns`/`sessionTotalCostUsd`. Use `responseMode: "full"` or individual `include*` flags to restore any of these.
|
|
335
364
|
- In `"delta_compact"` mode: defaults are optimized for high-frequency polling (`events` and top-level `result` omitted unless explicitly enabled via `pollOptions`), while still returning session status/actions/cursors.
|
|
336
365
|
|
|
337
366
|
## Usage Example
|
|
@@ -410,6 +439,23 @@ For JSON-based MCP clients (Claude Desktop, Cursor, etc.):
|
|
|
410
439
|
}
|
|
411
440
|
```
|
|
412
441
|
|
|
442
|
+
For OpenCode (`opencode.json` / `opencode.jsonc`):
|
|
443
|
+
|
|
444
|
+
```json
|
|
445
|
+
{
|
|
446
|
+
"mcp": {
|
|
447
|
+
"claude-code": {
|
|
448
|
+
"type": "local",
|
|
449
|
+
"command": ["npx", "-y", "@leo000001/claude-code-mcp"],
|
|
450
|
+
"enabled": true,
|
|
451
|
+
"environment": {
|
|
452
|
+
"CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
```
|
|
458
|
+
|
|
413
459
|
For OpenAI Codex CLI (`~/.codex/config.toml`):
|
|
414
460
|
|
|
415
461
|
```toml
|
|
@@ -493,6 +539,24 @@ CLAUDE_CODE_MCP_ALLOW_DISK_RESUME = "1"
|
|
|
493
539
|
CLAUDE_CODE_MCP_RESUME_SECRET = "change-me"
|
|
494
540
|
```
|
|
495
541
|
|
|
542
|
+
**OpenCode** — add an `environment` block under the local MCP entry:
|
|
543
|
+
|
|
544
|
+
```json
|
|
545
|
+
{
|
|
546
|
+
"mcp": {
|
|
547
|
+
"claude-code": {
|
|
548
|
+
"type": "local",
|
|
549
|
+
"command": ["npx", "-y", "@leo000001/claude-code-mcp"],
|
|
550
|
+
"enabled": true,
|
|
551
|
+
"environment": {
|
|
552
|
+
"CLAUDE_CODE_MCP_ALLOW_DISK_RESUME": "1",
|
|
553
|
+
"CLAUDE_CODE_MCP_RESUME_SECRET": "change-me"
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
496
560
|
**System-wide** — set via your shell profile or OS settings so all processes inherit them:
|
|
497
561
|
|
|
498
562
|
```bash
|