You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add missing `hono` peer dependency to `@modelcontextprotocol/node`. The package already depends on `@hono/node-server` which requires `hono` at runtime, but `hono` was only listed in the workspace root, not as a peer dependency of the package itself.
Fix InMemoryTaskStore to enforce session isolation. Previously, sessionId was accepted but ignored on all TaskStore methods, allowing any session to enumerate, read, and mutate tasks created by other sessions. The store now persists sessionId at creation time and enforces ownership on all reads and writes.
Copy file name to clipboardExpand all lines: CLAUDE.md
+41-19Lines changed: 41 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,15 @@ pnpm --filter @modelcontextprotocol/core test -- path/to/file.test.ts
22
22
pnpm --filter @modelcontextprotocol/core test -- -t "test name"
23
23
```
24
24
25
+
## Breaking Changes
26
+
27
+
When making breaking changes, document them in **both**:
28
+
29
+
-`docs/migration.md` — human-readable guide with before/after code examples
30
+
-`docs/migration-SKILL.md` — LLM-optimized mapping tables for mechanical migration
31
+
32
+
Include what changed, why, and how to migrate. Search for related sections and group related changes together rather than adding new standalone sections.
33
+
25
34
## Code Style Guidelines
26
35
27
36
-**TypeScript**: Strict type checking, ES modules, explicit return types
@@ -79,12 +88,11 @@ Located in `packages/*/src/experimental/`:
79
88
80
89
-**Tasks**: Long-running task support with polling/resumption (`packages/core/src/experimental/tasks/`)
81
90
82
-
### Zod Compatibility
91
+
### Zod Schemas
83
92
84
-
The SDK uses `zod/v4` internally but supports both v3 and v4 APIs. Compatibility utilities:
93
+
The SDK uses `zod/v4` internally. Schema utilities live in:
85
94
86
-
-`packages/core/src/util/zod-compat.ts` - Schema parsing helpers that work across versions
87
-
-`packages/core/src/util/zod-json-schema-compat.ts` - Converts Zod schemas to JSON Schema
95
+
-`packages/core/src/util/schema.ts` - AnySchema alias and helpers for inspecting Zod objects
88
96
89
97
### Validation
90
98
@@ -136,37 +144,51 @@ When a request arrives from the remote side:
136
144
2.**`Protocol.connect()`** routes to `_onrequest()`, `_onresponse()`, or `_onnotification()`
137
145
3.**`Protocol._onrequest()`**:
138
146
- Looks up handler in `_requestHandlers` map (keyed by method name)
139
-
- Creates `RequestHandlerExtra` with `signal`, `sessionId`, `sendNotification`, `sendRequest`
147
+
- Creates `BaseContext` with `signal`, `sessionId`, `sendNotification`, `sendRequest`, etc.
148
+
- Calls `buildContext()` to let subclasses enrich the context (e.g., Server adds `requestInfo`)
140
149
- Invokes handler, sends JSON-RPC response back via transport
141
-
4.**Handler** was registered via `setRequestHandler(Schema, handler)`
150
+
4.**Handler** was registered via `setRequestHandler('method', handler)`
142
151
143
152
### Handler Registration
144
153
145
154
```typescript
146
155
// In Client (for server→client requests like sampling, elicitation)
Both packages have a **required peer dependency** on `zod` for schema validation. The SDK internally imports from `zod/v4`, but remains compatible with projects using Zod v3.25+.
42
+
Both packages have a **required peer dependency** on `zod` for schema validation. The SDK uses Zod v4.
0 commit comments