Skip to content

Commit 32d24b0

Browse files
docs(migration): tighten migration docs
- Add InMemoryTransport to the v2 import-mapping example - Fix InMemoryTransport example to import from server instead of core (core is private/internal) - 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 - migration-SKILL.md: fix 'core is installed as a dependency' (it's internal), add the same method-string rows
1 parent babaa50 commit 32d24b0

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

docs/migration-SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ npm uninstall @modelcontextprotocol/sdk
2828
| Server + Express | `npm install @modelcontextprotocol/server @modelcontextprotocol/express` |
2929
| Server + Hono | `npm install @modelcontextprotocol/server @modelcontextprotocol/hono` |
3030

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.
3232

3333
## 3. Import Mapping
3434

@@ -373,6 +373,9 @@ Schema to method string mapping:
373373
| `PromptListChangedNotificationSchema` | `'notifications/prompts/list_changed'` |
374374
| `ProgressNotificationSchema` | `'notifications/progress'` |
375375
| `CancelledNotificationSchema` | `'notifications/cancelled'` |
376+
| `GetTaskRequestSchema` | `'tasks/get'` |
377+
| `GetTaskPayloadRequestSchema` | `'tasks/result'` |
378+
| `ElicitationCompleteNotificationSchema` | `'notifications/elicitation/complete'` |
376379
| `InitializedNotificationSchema` | `'notifications/initialized'` |
377380

378381
Request/notification params remain fully typed. Remove unused schema imports after migration.

docs/migration.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
5151

5252
```typescript
5353
import { Client, StreamableHTTPClientTransport, StdioClientTransport } from '@modelcontextprotocol/client';
54-
import { McpServer, StdioServerTransport, WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/server';
54+
import { McpServer, StdioServerTransport, InMemoryTransport, WebStandardStreamableHTTPServerTransport } from '@modelcontextprotocol/server';
5555

5656
// Node.js HTTP server transport is in the @modelcontextprotocol/node package
5757
import { NodeStreamableHTTPServerTransport } from '@modelcontextprotocol/node';
@@ -110,6 +110,34 @@ const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: ()
110110

111111
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.
112112

113+
**Before (v1):**
114+
115+
```typescript
116+
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
117+
118+
app.get('/sse', async (req, res) => {
119+
const transport = new SSEServerTransport('/messages', res);
120+
await server.connect(transport);
121+
});
122+
app.post('/messages', async (req, res) => {
123+
await transport.handlePostMessage(req, res);
124+
});
125+
```
126+
127+
**After (v2):**
128+
129+
```typescript
130+
import { NodeStreamableHTTPServerTransport } from '@modelcontextprotocol/node';
131+
132+
app.all('/mcp', async (req, res) => {
133+
const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID() });
134+
await server.connect(transport);
135+
await transport.handleRequest(req, res);
136+
});
137+
```
138+
139+
See `examples/server/src/simpleStreamableHttp.ts` for a complete working example.
140+
113141
### `WebSocketClientTransport` removed
114142

115143
`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 +409,13 @@ Common method string replacements:
381409
| `ToolListChangedNotificationSchema` | `'notifications/tools/list_changed'` |
382410
| `ResourceListChangedNotificationSchema` | `'notifications/resources/list_changed'` |
383411
| `PromptListChangedNotificationSchema` | `'notifications/prompts/list_changed'` |
412+
| `GetTaskRequestSchema` | `'tasks/get'` |
413+
| `GetTaskPayloadRequestSchema` | `'tasks/result'` |
414+
| `ElicitationCompleteNotificationSchema` | `'notifications/elicitation/complete'` |
384415

385416
### `Protocol.request()`, `ctx.mcpReq.send()`, and `Client.callTool()` no longer take a schema parameter
386417

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
418+
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
388419
like `CallToolResultSchema` or `ElicitResultSchema` when making requests.
389420

390421
**`client.request()` — Before (v1):**
@@ -467,8 +498,8 @@ For **testing**, import it directly from the internal core package:
467498
// v1
468499
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
469500

470-
// v2 (testing only — @modelcontextprotocol/core is internal, not for production use)
471-
import { InMemoryTransport } from '@modelcontextprotocol/core';
501+
// v2 — re-exported from both @modelcontextprotocol/server and @modelcontextprotocol/client
502+
import { InMemoryTransport } from '@modelcontextprotocol/server';
472503
```
473504

474505
For **production in-process connections**, use `StreamableHTTPClientTransport` with a local server URL, or connect client and server via paired streams.

0 commit comments

Comments
 (0)