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
InMemoryTransport was unreachable: the migration doc said to import it
from @modelcontextprotocol/core, but core is private (no exports field,
no dist). Adding it to core/public makes it available via the
server/client re-exports.
migration.md:
- Rewrite the InMemoryTransport section to match the new export reality
(was: 'removed from public API, import from internal core' — neither
half of that worked)
- Add SSE-to-StreamableHTTP before/after example
- Method-string table: add tasks/get, tasks/result,
notifications/elicitation/complete
- Mention callToolStream() in the schema-removal section header
migration-SKILL.md:
- Fix 'core is installed automatically as a dependency' (it's internal)
- Add the same method-string rows
| Server + Express |`npm install @modelcontextprotocol/server @modelcontextprotocol/express`|
29
29
| Server + Hono |`npm install @modelcontextprotocol/server @modelcontextprotocol/hono`|
30
30
31
-
`@modelcontextprotocol/core` is installed automatically as a dependency.
31
+
`@modelcontextprotocol/core` is an internal package — never install or import it directly. Both `@modelcontextprotocol/client` and `@modelcontextprotocol/server` re-export everything you need.
32
32
33
33
## 3. Import Mapping
34
34
@@ -373,6 +373,9 @@ Schema to method string mapping:
|`ctx.mcpReq.elicitInput(params, options?)`| Elicit user input (form or URL) |`server.elicitInput(...)` from within handler |
408
411
|`ctx.mcpReq.requestSampling(params, options?)`| Request LLM sampling from client |`server.createMessage(...)` from within handler |
409
412
410
-
## 11. Schema parameter removed from `request()`, `send()`, and `callTool()`
413
+
## 11. Schema parameter removed from `request()`, `send()`, `callTool()`, and `callToolStream()`
411
414
412
-
`Protocol.request()`, `BaseContext.mcpReq.send()`, and `Client.callTool()` no longer take a Zod result schema argument. The SDK resolves the schema internally from the method name.
415
+
`Protocol.request()`, `BaseContext.mcpReq.send()`, `Client.callTool()`, and `client.experimental.tasks.callToolStream()` no longer take a Zod result schema argument. The SDK resolves the schema internally from the method name.
Copy file name to clipboardExpand all lines: docs/migration.md
+57-7Lines changed: 57 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,36 @@ const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: ()
110
110
111
111
The SSE transport has been removed from the server. Servers should migrate to Streamable HTTP. The client-side SSE transport remains available for connecting to legacy SSE servers.
const transport =newNodeStreamableHTTPServerTransport({ sessionIdGenerator: undefined });
136
+
awaitserver.connect(transport);
137
+
awaittransport.handleRequest(req, res);
138
+
});
139
+
```
140
+
141
+
With `sessionIdGenerator: undefined` the transport runs in stateless mode, so creating a fresh instance per request is correct. For stateful sessions, the transport must be created once per session and stored in a `Map<string, NodeStreamableHTTPServerTransport>` keyed by session ID — see `examples/server/src/simpleStreamableHttp.ts` for the full pattern.
142
+
113
143
### `WebSocketClientTransport` removed
114
144
115
145
`WebSocketClientTransport` has been removed. WebSocket is not a spec-defined MCP transport, and keeping it in the SDK encouraged transport proliferation without a conformance baseline.
@@ -381,10 +411,14 @@ Common method string replacements:
### `Protocol.request()`, `ctx.mcpReq.send()`, and `Client.callTool()` no longer take a schema parameter
386
420
387
-
The public `Protocol.request()`, `BaseContext.mcpReq.send()`, and `Client.callTool()` methods no longer accept a Zod result schema argument. The SDK now resolves the correct result schema internally based on the method name. This means you no longer need to import result schemas
421
+
The public `Protocol.request()`, `BaseContext.mcpReq.send()`, `Client.callTool()`, and `client.experimental.tasks.callToolStream()` methods no longer accept a Zod result schema argument. The SDK now resolves the correct result schema internally based on the method name. This means you no longer need to import result schemas
388
422
like `CallToolResultSchema` or `ElicitResultSchema` when making requests.
The return type is now inferred from the method name via `ResultTypeMap`. For example, `client.request({ method: 'tools/call', ... })` returns `Promise<CallToolResult | CreateTaskResult>`.
444
496
445
497
### Client list methods return empty results for missing capabilities
@@ -459,19 +511,17 @@ const client = new Client(
459
511
460
512
### `InMemoryTransport` removed from public API
461
513
462
-
`InMemoryTransport` has been removed from the public API surface. It was previously used for in-process client-server connections and testing.
463
-
464
-
For **testing**, import it directly from the internal core package:
514
+
`InMemoryTransport` is intended for testing client/server interactions within a single process. It is re-exported from both `@modelcontextprotocol/server` and `@modelcontextprotocol/client`.
For **production in-process connections**, use`StreamableHTTPClientTransport` with a local server URL, or connect client and server via paired streams.
524
+
For **production in-process connections**, prefer`StreamableHTTPClientTransport` with a local server URL.
0 commit comments