Document the 2.x install matrix and add a migration guide

Install instructions now list the split base MCP SDK packages at ^2.0.0
by role (core comes in transitively, server only for server authors),
require Node 20+, and state that the wire protocol is unchanged so 2.x
Views and 1.x hosts interoperate. The agent skills lose the exact
prerelease wording and add-app-to-server gains a v1 to v2 import
mapping. docs/migrate-to-2.md lists the breaking changes, the peer
matrix and the host-side error deltas.
This commit is contained in:
Olivier Chafik 2026-09-07 15:31:22 +01:00
commit c5b2543115
3 changed files with 145 additions and 27 deletions

View file

@ -77,15 +77,27 @@ Before writing any code, analyze the server's existing tools and determine which
## Step 2: Add Dependencies
```bash
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@2.0.0-beta.5 @modelcontextprotocol/core@2.0.0-beta.5 @modelcontextprotocol/server@2.0.0-beta.5 zod@^4.2.0
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@^2.0.0 @modelcontextprotocol/server@^2.0.0 zod@^4.2.0
npm install -D vite vite-plugin-singlefile
```
Plus framework-specific dependencies if needed (e.g., `react`, `react-dom`, `@vitejs/plugin-react` for React).
Plus framework-specific dependencies if needed (e.g., `react`, `react-dom`, `@vitejs/plugin-react` for React), and `@modelcontextprotocol/node` / `@modelcontextprotocol/express` if the server uses HTTP transports.
Use the exact base MCP SDK prerelease required by ext-apps. Existing servers
that still import `@modelcontextprotocol/sdk` v1 must migrate those imports and
handler schemas before adding the App integration.
ext-apps 2.x requires the split base MCP SDK packages at `^2.0.0`
(`@modelcontextprotocol/core` comes in transitively). Existing servers that
still import `@modelcontextprotocol/sdk` v1 must migrate those imports and
handler schemas before adding the App integration:
| SDK v1 (`@modelcontextprotocol/sdk`) | SDK v2 |
|---|---|
| `sdk/server/mcp.js` (`McpServer`) | `@modelcontextprotocol/server` |
| `sdk/server/streamableHttp.js` (`StreamableHTTPServerTransport`) | `NodeStreamableHTTPServerTransport` from `@modelcontextprotocol/node` |
| Express wiring by hand | `createMcpExpressApp` from `@modelcontextprotocol/express` |
| `sdk/server/stdio.js` | `@modelcontextprotocol/server/stdio` |
| `sdk/types.js` (types, schemas) | `@modelcontextprotocol/client` or `@modelcontextprotocol/server` |
| Raw zod shapes: `inputSchema: { q: z.string() }` | `inputSchema: z.object({ q: z.string() })` |
| `extra.signal` in tool callbacks | `extra.mcpReq.signal` |
| `setRequestHandler(SomeRequestSchema, handler)` | `setRequestHandler("some/method", handler)` |
## Step 3: Set Up the Build Pipeline

View file

@ -115,12 +115,14 @@ Create a new MCP server with tool and resource registration. This wraps the exis
### Dependencies
```bash
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@2.0.0-beta.5 @modelcontextprotocol/core@2.0.0-beta.5 @modelcontextprotocol/server@2.0.0-beta.5 zod@^4.2.0
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@^2.0.0 @modelcontextprotocol/server@^2.0.0 zod@^4.2.0
npm install -D tsx vite vite-plugin-singlefile
```
Use `npm install` with the exact base MCP SDK prerelease required by ext-apps.
Do not substitute unpublished local packages or guess a different prerelease.
Use `npm install` so the package manager resolves versions; ext-apps 2.x needs
the split base MCP SDK packages at `^2.0.0` (`@modelcontextprotocol/core` comes
in transitively). Do not add the legacy `@modelcontextprotocol/sdk` v1 package
or substitute unpublished local packages.
### Server Code

View file

@ -110,12 +110,14 @@ See `/tmp/mcp-ext-apps/docs/patterns.md` for detailed recipes:
**Always** use `npm install` to add dependencies rather than manually writing version numbers:
```bash
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@2.0.0-beta.5 @modelcontextprotocol/core@2.0.0-beta.5 @modelcontextprotocol/server@2.0.0-beta.5 @modelcontextprotocol/node@2.0.0-beta.5 @modelcontextprotocol/express@2.0.0-beta.5 zod@^4.2.0 express cors
npm install @modelcontextprotocol/ext-apps @modelcontextprotocol/client@^2.0.0 @modelcontextprotocol/server@^2.0.0 @modelcontextprotocol/node@^2.0.0 @modelcontextprotocol/express@^2.0.0 zod@^4.2.0 express cors
npm install -D typescript vite vite-plugin-singlefile concurrently cross-env @types/node @types/express @types/cors
```
Use the exact base MCP SDK prerelease required by ext-apps. Do not substitute
unpublished local packages or guess a different prerelease.
ext-apps 2.x requires the split base MCP SDK packages (`@modelcontextprotocol/client`,
`server`, `node`, `express`) at `^2.0.0`; `@modelcontextprotocol/core` comes in
transitively. Do not add the legacy `@modelcontextprotocol/sdk` v1 package or
substitute unpublished local packages.
### TypeScript Server Execution