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
Codemod now resolves SSE server and OAuth auth imports to @modelcontextprotocol/server-legacy sub-paths instead of removing them. An info diagnostic suggests eventual migration to v2 equivalents.
Copy file name to clipboardExpand all lines: docs/faq.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ The [server quickstart](./server-quickstart.md) walks you through building a wea
71
71
72
72
### Where are the server auth helpers?
73
73
74
-
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `OAuthTokenVerifier`) are first-class in `@modelcontextprotocol/express`. The Authorization Server helpers (`mcpAuthRouter`, `ProxyOAuthServerProvider`, etc.) have been removed from the core SDK; new code should use a dedicated IdP/OAuth library. Example packages provide a demo with `better-auth`.
74
+
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `OAuthTokenVerifier`) are first-class in `@modelcontextprotocol/express`. Authorization Server helpers (`mcpAuthRouter`, `ProxyOAuthServerProvider`, etc.) are available from `@modelcontextprotocol/server-legacy/auth` (deprecated, frozen v1 copy). New code should use a dedicated IdP/OAuth library for the AS. Example packages provide a demo with `better-auth`.
|`@modelcontextprotocol/sdk/server/streamableHttp.js`|`@modelcontextprotocol/node` (class renamed to `NodeStreamableHTTPServerTransport`) OR `@modelcontextprotocol/server` (web-standard `WebStandardStreamableHTTPServerTransport` for Cloudflare Workers, Deno, etc.) |
56
-
|`@modelcontextprotocol/sdk/server/sse.js`| REMOVED (migrate to Streamable HTTP)|
|`@modelcontextprotocol/sdk/server/sse.js`| REMOVED (migrate to Streamable HTTP); legacy bridge: `@modelcontextprotocol/server-legacy/sse`|
57
+
|`@modelcontextprotocol/sdk/server/auth/*`| RS helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `OAuthTokenVerifier`) → `@modelcontextprotocol/express`; AS helpers (`mcpAuthRouter`, `OAuthServerProvider`, etc.) → `@modelcontextprotocol/server-legacy/auth` (deprecated); migrate AS to an external IdP/OAuth library|
58
58
|`@modelcontextprotocol/sdk/server/middleware.js`|`@modelcontextprotocol/express` (signature changed, see section 8) |
59
59
60
60
### Types / shared imports
@@ -328,11 +328,11 @@ new URL(ctx.http?.req?.url).searchParams.get('debug')
328
328
329
329
### SSE server transport
330
330
331
-
`SSEServerTransport` removed entirely. Migrate to `NodeStreamableHTTPServerTransport` (from `@modelcontextprotocol/node`). Client-side `SSEClientTransport` still available for connecting to legacy servers.
331
+
`SSEServerTransport` removed entirely. Migrate to `NodeStreamableHTTPServerTransport` (from `@modelcontextprotocol/node`). Client-side `SSEClientTransport` still available for connecting to legacy servers. Legacy bridge: `import { SSEServerTransport } from '@modelcontextprotocol/server-legacy/sse'` (deprecated, frozen v1 copy).
332
332
333
333
### Server-side auth
334
334
335
-
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `getOAuthProtectedResourceMetadataUrl`, `OAuthTokenVerifier`) are first-class in `@modelcontextprotocol/express`. Authorization Server helpers (`mcpAuthRouter`, `OAuthServerProvider`, `ProxyOAuthServerProvider`, `authenticateClient`, `allowedMethods`, etc.) are removed from the core SDK; use an external IdP/OAuth library. See `examples/server/src/` for demos.
335
+
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `getOAuthProtectedResourceMetadataUrl`, `OAuthTokenVerifier`) are first-class in `@modelcontextprotocol/express`. Authorization Server helpers (`mcpAuthRouter`, `OAuthServerProvider`, `ProxyOAuthServerProvider`, `authenticateClient`, `allowedMethods`, etc.) are available from `@modelcontextprotocol/server-legacy/auth` (deprecated, frozen v1 copy). Migrate AS to an external IdP/OAuth library for production use. See `examples/server/src/` for demos.
336
336
337
337
### Host header validation (Express)
338
338
@@ -544,6 +544,6 @@ Validator behavior:
544
544
6. Replace plain header objects with `new Headers({...})` and bracket access (`headers['x']`) with `.get()` calls per section 7
545
545
7. If using `hostHeaderValidation` from server, update import and signature per section 8
546
546
8. If using server SSE transport, migrate to Streamable HTTP
547
-
9. If using server auth from the SDK: RS helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`) → `@modelcontextprotocol/express`; AS helpers → external IdP/OAuth library
547
+
9. If using server auth from the SDK: RS helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `OAuthTokenVerifier`) → `@modelcontextprotocol/express`; AS helpers →`@modelcontextprotocol/server-legacy/auth` (deprecated); migrate AS to external IdP/OAuth library
548
548
10. If relying on `listTools()`/`listPrompts()`/etc. throwing on missing capabilities, set `enforceStrictCapabilities: true`
Copy file name to clipboardExpand all lines: docs/migration.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,14 @@ const transport = new NodeStreamableHTTPServerTransport({ sessionIdGenerator: ()
113
113
114
114
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.
115
115
116
+
If you need a temporary bridge during migration, `@modelcontextprotocol/server-legacy/sse` provides a frozen copy of the v1 `SSEServerTransport`:
This package is deprecated and will not receive new features.
123
+
116
124
### `WebSocketClientTransport` removed
117
125
118
126
`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.
@@ -135,7 +143,7 @@ const transport = new StreamableHTTPClientTransport(new URL('http://localhost:30
135
143
136
144
### Server auth split
137
145
138
-
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `getOAuthProtectedResourceMetadataUrl`, `OAuthTokenVerifier`) are now first-class in `@modelcontextprotocol/express`.
146
+
Resource Server helpers (`requireBearerAuth`, `mcpAuthMetadataRouter`, `getOAuthProtectedResourceMetadataUrl`, `OAuthTokenVerifier`) are first-class in `@modelcontextprotocol/express`.
139
147
140
148
Authorization Server helpers (`mcpAuthRouter`, `OAuthServerProvider`, `ProxyOAuthServerProvider`, `authenticateClient`, `allowedMethods`, etc.) have been removed from the core SDK; new code should use a dedicated IdP/OAuth library. See the [examples](../examples/server/src/) for a working demo with `better-auth`.
141
149
@@ -812,6 +820,14 @@ The following individual error classes have been removed in favor of `OAuthError
812
820
813
821
The `OAUTH_ERRORS` constant has also been removed.
814
822
823
+
If you need the v1 OAuth error classes and `mcpAuthRouter` during migration, `@modelcontextprotocol/server-legacy/auth` provides a frozen copy:
| Streamable HTTP server (stateful) | Feature-rich server with tools/resources/prompts, logging, tasks, sampling, and optional OAuth. |[`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts)|
31
-
| Streamable HTTP server (stateless) | No session tracking; good for simple API-style servers. |[`src/simpleStatelessStreamableHttp.ts`](src/simpleStatelessStreamableHttp.ts)|
32
-
| Resource-Server-only auth | Minimal OAuth RS using SDK's `mcpAuthMetadataRouter` + `requireBearerAuth` (no better-auth).|[`src/resourceServerOnly.ts`](src/resourceServerOnly.ts)|
33
-
| JSON response mode (no SSE) | Streamable HTTP with JSON-only responses and limited notifications. |[`src/jsonResponseStreamableHttp.ts`](src/jsonResponseStreamableHttp.ts)|
34
-
| Server notifications over Streamable HTTP | Demonstrates server-initiated notifications via GET+SSE. |[`src/standaloneSseWithGetStreamableHttp.ts`](src/standaloneSseWithGetStreamableHttp.ts)|
35
-
| Output schema server | Demonstrates tool output validation with structured output schemas. |[`src/mcpServerOutputSchema.ts`](src/mcpServerOutputSchema.ts)|
36
-
| Form elicitation server | Collects **non-sensitive** user input via schema-driven forms. |[`src/elicitationFormExample.ts`](src/elicitationFormExample.ts)|
37
-
| URL elicitation server | Secure browser-based flows for **sensitive** input (API keys, OAuth, payments). |[`src/elicitationUrlExample.ts`](src/elicitationUrlExample.ts)|
38
-
| Sampling + tasks server | Demonstrates sampling and experimental task-based execution. |[`src/toolWithSampleServer.ts`](src/toolWithSampleServer.ts)|
39
-
| Task interactive server | Task-based execution with interactive server→client requests. |[`src/simpleTaskInteractive.ts`](src/simpleTaskInteractive.ts)|
40
-
| Hono Streamable HTTP server | Streamable HTTP server built with Hono instead of Express. |[`src/honoWebStandardStreamableHttp.ts`](src/honoWebStandardStreamableHttp.ts)|
41
-
| SSE polling demo server | Legacy SSE server intended for polling demos. |[`src/ssePollingExample.ts`](src/ssePollingExample.ts)|
| Streamable HTTP server (stateful) | Feature-rich server with tools/resources/prompts, logging, tasks, sampling, and optional OAuth. |[`src/simpleStreamableHttp.ts`](src/simpleStreamableHttp.ts)|
31
+
| Streamable HTTP server (stateless) | No session tracking; good for simple API-style servers. |[`src/simpleStatelessStreamableHttp.ts`](src/simpleStatelessStreamableHttp.ts)|
| JSON response mode (no SSE) | Streamable HTTP with JSON-only responses and limited notifications. |[`src/jsonResponseStreamableHttp.ts`](src/jsonResponseStreamableHttp.ts)|
34
+
| Server notifications over Streamable HTTP | Demonstrates server-initiated notifications via GET+SSE. |[`src/standaloneSseWithGetStreamableHttp.ts`](src/standaloneSseWithGetStreamableHttp.ts)|
35
+
| Output schema server | Demonstrates tool output validation with structured output schemas. |[`src/mcpServerOutputSchema.ts`](src/mcpServerOutputSchema.ts)|
36
+
| Form elicitation server | Collects **non-sensitive** user input via schema-driven forms. |[`src/elicitationFormExample.ts`](src/elicitationFormExample.ts)|
37
+
| URL elicitation server | Secure browser-based flows for **sensitive** input (API keys, OAuth, payments). |[`src/elicitationUrlExample.ts`](src/elicitationUrlExample.ts)|
38
+
| Sampling + tasks server | Demonstrates sampling and experimental task-based execution. |[`src/toolWithSampleServer.ts`](src/toolWithSampleServer.ts)|
39
+
| Task interactive server | Task-based execution with interactive server→client requests. |[`src/simpleTaskInteractive.ts`](src/simpleTaskInteractive.ts)|
40
+
| Hono Streamable HTTP server | Streamable HTTP server built with Hono instead of Express. |[`src/honoWebStandardStreamableHttp.ts`](src/honoWebStandardStreamableHttp.ts)|
41
+
| SSE polling demo server | Legacy SSE server intended for polling demos. |[`src/ssePollingExample.ts`](src/ssePollingExample.ts)|
0 commit comments