[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ABHDKH7R9GRK8MVYFCXTCS":3,"skill-same:01M7ABHDKH7R9GRK8MVYFCXTCS":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7ABHDKH7R9GRK8MVYFCXTCS","mcp-migration",null,"Migration: MCP SDK v1 to v2 through the codemod, split packages, API rewrites, and behavior verification.","j0hanz\u002Fj0hanz-marketplace","j0hanz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F159924955?v=4","01M7ABFK415CKHXYV9GZRJ16T7","Linus Johansson","01M7ABFK52FCPP2PNBH1YR7ZPA",0,"MIT","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fmcp-hub\u002Fskills\u002Fmcp-migration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: mcp-migration\ndescription: 'Migration: MCP SDK v1 to v2 through the codemod, split packages, API rewrites, and behavior verification.'\nuser-invocable: false\nmetadata:\n  category: technique\n---\n\n# Migrating MCP SDK v1 to v2\n\nMigrate Node ≥20 projects from `@modelcontextprotocol\u002Fsdk` v1 to split v2 packages. Reference: https:\u002F\u002Fts.sdk.modelcontextprotocol.io\u002Fv2\u002F\n\n## Steps\n\n1. **Scope migration**: Find every legacy dependency and import. Large multi-directory project: follow [mcp-planning](..\u002Fmcp-planning\u002FSKILL.md) decision 15 — migrate one directory at a time, keep both SDK versions only while untouched v1 code remains, remove v1 once `rg '@modelcontextprotocol\u002Fsdk'` finds no source imports. SDK objects can't cross v1\u002Fv2 boundary: nominal types and `instanceof` checks differ.\n\n   **Done:** Migration scope and one-shot-or-staged posture explicit; every staged boundary isolates v1 and v2 SDK objects.\n\n2. **Run codemod on that scope**: Execute `npx @modelcontextprotocol\u002Fcodemod@latest v1-to-v2 .`, replace `.` with target **directory** when staging — subdirectory run still updates nearest manifest walking up (including removing v1 dependency), preview with `--dry-run`. Updates split-package imports, renames symbols, converts `extra` to `ctx`, rewrites schema-based `setRequestHandler` calls to method strings, changes `.tool()`\u002F`.prompt()`\u002F`.resource()` registrations to `registerTool`\u002F`registerPrompt`\u002F`registerResource` with `z.object()` schemas. Writes `@mcp-codemod-error` where safe rewrite unavailable.\n\n   **Done:** Every targeted file compiles after rewrite or has `@mcp-codemod-error` marker to resolve.\n\n3. **Install split packages**: Replace v1 package with public v2 packages used by rewritten imports (see [Package Split](#package-split)). Install `@modelcontextprotocol\u002Fserver-legacy` (import from its `\u002Fsse` subpath) only for `SSEServerTransport`. Staged work: keep `@modelcontextprotocol\u002Fsdk` only for untouched v1 code; one-shot migration removes it now.\n\n   **Done:** Every migrated import resolves to its v2 package, any retained v1 dependency serves only unmigrated scope.\n\n4. **Resolve each codemod marker**: Find `@mcp-codemod-error` within migration scope, apply matching [rename](#renames) before moving on.\n\n   **Done:** Migrated scope has zero `@mcp-codemod-error` comments, typechecks against installed packages.\n\n5. **Set era posture**: Honor [mcp-planning](..\u002Fmcp-planning\u002FSKILL.md) decision 13; no record = serve both eras. HTTP uses `createMcpHandler(factory, { legacy: 'stateless' })`, stdio uses `serveStdio(factory, { legacy: 'serve' })` for both; modern-only uses `legacy: 'reject'`; 2025-only keeps hand-wired `*StreamableHTTPServerTransport` stack, no `legacy:` setting.\n\n   **Done:** Every server entry point implements selected both-era, modern-only, or 2025-only posture.\n\n6. **Modernize interaction and change flow for selected era**: Both-era and modern servers return `inputRequired(...)` instead of blocking for input; both-era server keeps `ctx.mcpReq.elicitInput` only inside its 2025 branch — throws for modern calls. Use `requestState` for modern multi-round data, `subscriptions\u002Flisten` for modern change streams. 2025-only stack keeps its 2025 interaction and notification mechanisms.\n\n   **Done:** Each interaction, cross-round state, change-notification path uses APIs supported by selected connection era.\n\n7. **Adopt `McpServer` where possible**: Convert low-level `Server` instances unless custom or vendor JSON-RPC methods need low-level class — send those to [mcp-protocol](..\u002Fmcp-protocol\u002FSKILL.md). Use Standard Schema objects: `z.object(...)` from zod ≥4.2.0, or existing ArkType\u002FValibot schemas.\n\n   **Done:** Every server is either `McpServer` or has documented custom methods needing low-level [mcp-protocol](..\u002Fmcp-protocol\u002FSKILL.md) handling.\n\n8. **Choose and verify module mode**: Default ESM with `\"module\": \"NodeNext\"`, `\"moduleResolution\": \"NodeNext\"`, `\"type\": \"module\"`. v2 is ESM-first; CommonJS projects can `require('@modelcontextprotocol\u002F…')` directly.\n\n   **Done:** Selected ESM or CommonJS mode resolves every v2 import in project's compiler and runtime.\n\n9. **Verify behavior**: Run tests from [mcp-test](..\u002Fmcp-test\u002FSKILL.md), review every [Silent Behavior Change](#silent-behavior-changes) against migrated code. Tests — not codemod or compiler — cover those differences. Final staged slice: remove legacy package, confirm no source import remains.\n\n   **Done:** Migrated scope compiles and passes tests; every silent change accounted for; complete migration has no legacy package or source import.\n\n## Reference\n\n### Package Split\n\n| Package                               | Purpose                                                                                  |\n| :------------------------------------ | :--------------------------------------------------------------------------------------- |\n| `@modelcontextprotocol\u002Fserver`        | `McpServer`, `Server`, `createMcpHandler`, validation, errors                            |\n| `@modelcontextprotocol\u002Fclient`        | `Client`, transport, auth, middleware, caching                                           |\n| `@modelcontextprotocol\u002Fcore`          | Raw Zod wire schemas for gateways and proxies                                            |\n| `@modelcontextprotocol\u002Fnode`          | Node HTTP adapter: `toNodeHandler` and stream transport                                  |\n| `@modelcontextprotocol\u002Fcodemod`       | Migration CLI                                                                            |\n| `@modelcontextprotocol\u002Fserver-legacy` | Frozen v1 `SSEServerTransport` (`\u002Fsse`) and Authorization Server OAuth helpers (`\u002Fauth`) |\n| `@modelcontextprotocol\u002Fexpress`       | Express adapter when v1 server owns HTTP integration                                     |\n| `@modelcontextprotocol\u002Fhono`          | Hono adapter when v1 server owns HTTP integration                                        |\n| `@modelcontextprotocol\u002Ffastify`       | Fastify adapter when v1 server owns HTTP integration                                     |\n\n**stdio subpath gotcha:** import `StdioClientTransport`, `StdioServerParameters`, `getDefaultEnvironment`, `DEFAULT_INHERITED_ENV_VARS` from `@modelcontextprotocol\u002Fclient\u002Fstdio`; import `StdioServerTransport` from `@modelcontextprotocol\u002Fserver\u002Fstdio`. Runtime-neutral package roots omit these exports; `ReadBuffer`, `serializeMessage`, `deserializeMessage` stay at root.\n\n### Renames\n\n#### API and type\n\n| v1                                                                                                                            | v2                                                                                                                                   |\n| :---------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |\n| `server.setRequestHandler(CallToolRequestSchema, ...)`                                                                        | `server.setRequestHandler('tools\u002Fcall', ...)` (low-level method string)                                                              |\n| `.tool(...)` (variadic high-level)                                                                                            | `.registerTool(name, config, handler)` (high-level)                                                                                  |\n| `McpError` \u002F `ErrorCode`                                                                                                      | `ProtocolError` \u002F `ProtocolErrorCode` (or `SdkErrorCode`)                                                                            |\n| `StreamableHTTPError`                                                                                                         | `SdkHttpError`                                                                                                                       |\n| `SchemaInput\u003CT>`                                                                                                              | `StandardSchemaWithJSON.InferInput\u003CT>`                                                                                               |\n| `ResourceTemplate` wire type                                                                                                  | `ResourceTemplateType`                                                                                                               |\n| `JSONRPCError` \u002F `JSONRPCErrorSchema` \u002F `isJSONRPCError`                                                                      | `JSONRPCErrorResponse` \u002F `JSONRPCErrorResponseSchema` \u002F `isJSONRPCErrorResponse`                                                     |\n| `JSONRPCResponse` \u002F `JSONRPCResponseSchema` \u002F `isJSONRPCResponse`                                                             | `JSONRPCResultResponse` \u002F `JSONRPCResultResponseSchema` \u002F `isJSONRPCResultResponse`                                                  |\n| `InMemoryTransport` (single export)                                                                                           | Split across `@modelcontextprotocol\u002Fserver` and `\u002Fclient`; both halves of linked pair must come from same package                    |\n| `schemaToJson` \u002F `parseSchemaAsync` \u002F `getSchemaShape` \u002F `getSchemaDescription` \u002F `isOptionalSchema` \u002F `unwrapOptionalSchema` | Removed (`@mcp-codemod-error`); `schemaToJson`→`fromJsonSchema()`, `parseSchemaAsync`→schema-library validation, rest no replacement |\n| `ResourceReference` \u002F `ResourceReferenceSchema`                                                                               | `ResourceTemplateReference` \u002F `ResourceTemplateReferenceSchema`                                                                      |\n| `IsomorphicHeaders`                                                                                                           | Web Standard `Headers` with `.get()` and `.set()`                                                                                    |\n\n**Call-site gotcha:** low-level `setRequestHandler(Schema)` becomes `setRequestHandler('method\u002Fstring')`; high-level `.tool()` becomes `.registerTool()`. Distinct conversions.\n\n#### Context and property\n\n| v1                                                  | v2                                                                                        |\n| :-------------------------------------------------- | :---------------------------------------------------------------------------------------- |\n| `RequestHandlerExtra` (`extra`)                     | `ServerContext` \u002F `ClientContext` (`ctx`)                                                 |\n| `extra.signal` \u002F `requestId` \u002F `_meta`              | `ctx.mcpReq.signal` \u002F `id` \u002F `_meta`                                                      |\n| `extra.sendRequest` \u002F `sendNotification`            | `ctx.mcpReq.send` \u002F `notify`                                                              |\n| `extra.authInfo` \u002F `requestInfo`                    | `ctx.http?.authInfo` \u002F `req` (stdio = undefined)                                          |\n| `extra.sessionId`                                   | `ctx.sessionId`                                                                           |\n| `extra.closeSSEStream` \u002F `closeStandaloneSSEStream` | `ctx.http?.closeSSE` \u002F `closeStandaloneSSE`                                               |\n| `server.sendLoggingMessage`                         | `ctx.mcpReq.log` (deprecated, SEP-2577; modern replacement: per-request `_meta.logLevel`) |\n| `server.createMessage`                              | Deprecated (SEP-2577); removed in later major                                             |\n| `server.listRoots`                                  | Deprecated (SEP-2577); removed in later major                                             |\n| `McpServer.sendLoggingMessage`                      | Deprecated (SEP-2577); removed in later major                                             |\n| `Client.setLoggingLevel`                            | Deprecated (SEP-2577); removed in later major                                             |\n| `Client.sendRootsListChanged`                       | Deprecated (SEP-2577); removed in later major                                             |\n| `ctx.mcpReq.requestSampling`                        | Deprecated (SEP-2577); removed in later major                                             |\n| `registerClient`                                    | Deprecated (SEP-2577); prefer Client ID Metadata Documents per SEP-991                    |\n| `elicitInput`                                       | `inputRequired(...)`; keep `ctx.mcpReq.elicitInput` only for 2025 branches                |\n| `StreamableHTTPServerTransport`                     | `Node\u002FWebStandardStreamableHTTPServerTransport`                                           |\n| `extra.taskStore` \u002F `taskId` \u002F `taskRequestedTtl`   | Removed (experimental tasks, SEP-2663); delete usages                                     |\n\n#### OAuth migration\n\nMap each `\u003CName>Error` class to `OAuthErrorCode.\u003CName>` without `Error` suffix (`InvalidGrantError` → `OAuthErrorCode.InvalidGrant`), except `ServerError`, keeps its name; map `CustomOAuthError` to defined custom code. Replace `OAUTH_ERRORS` and `instanceof` checks with switch on `error.code`. Token verifiers throw `OAuthError(OAuthErrorCode.InvalidToken)` for invalid tokens so response isn't HTTP 500. `InsufficientScopeError` from SEP-2350 is transport-layer `OAuthClientFlowError`, distinct from `OAuthErrorCode.InsufficientScope`.\n\n### Silent Behavior Changes\n\nCompiler and codemod can't catch these.\n\n| Behavior                                                                                       | v1                                         | v2                                                                                                           |\n| :--------------------------------------------------------------------------------------------- | :----------------------------------------- | :----------------------------------------------------------------------------------------------------------- |\n| Unknown or disabled tool name                                                                  | Resolves `CallToolResult{ isError: true }` | Rejects `ProtocolError(InvalidParams)`; catch the promise, read `error.code`                                 |\n| `listTools()` \u002F `listPrompts()` \u002F `listResources()` \u002F `listResourceTemplates()` without cursor | One page                                   | Auto-aggregates all pages; `listMaxPages` defaults to 64, overflow throws `SdkError(ListPaginationExceeded)` |\n| Declared empty `tools`, `resources`, or `prompts`                                              | `-32601 Method not found`                  | `*\u002Flist` returns `[]`, advertises `listChanged: true`; set `listChanged: false` to opt out                   |\n| POST `Content-Type`                                                                            | Substring match                            | Parsed media type; non-`application\u002Fjson` returns `415 Unsupported Media Type`                               |\n| Default JSON Schema dialect                                                                    | draft-07                                   | 2020-12; explicit draft-07\u002F06 still honored                                                                  |\n| `WebSocketClientTransport`                                                                     | Available                                  | Removed; use `StreamableHTTPClientTransport` or `StdioClientTransport`                                       |\n\n### Era Axes\n\n| Axis                       | 2025 era                                        | 2026 era                          |\n| :------------------------- | :---------------------------------------------- | :-------------------------------- |\n| Server HTTP entry          | `*StreamableHTTPServerTransport`                | `createMcpHandler`                |\n| Server stdio entry         | `server.connect(StdioServerTransport)`          | `serveStdio(factory)`             |\n| Client connect             | `initialize` handshake                          | `server\u002Fdiscover` probe           |\n| Client identity            | `getClientCapabilities\u002FVersion`                 | `ctx.mcpReq.envelope` per request |\n| Client cancellation (HTTP) | POST `notifications\u002Fcancelled`                  | Close request's SSE stream        |\n| Server-to-client requests  | `ctx.mcpReq.send`                               | `return inputRequired(...)`       |\n| Change notifications       | `list_changed` \u002F `updated`                      | `subscriptions\u002Flisten` stream     |\n| Logging                    | `ctx.mcpReq.log()` \u002F session `logging\u002FsetLevel` | Per-request `_meta.logLevel`      |\n| HTTP 400 JSON-RPC error    | `SdkHttpError`                                  | In-band `ProtocolError`           |\n","# Migrating MCP SDK v1 to v2\n\nMigrate Node ≥20 projects from `@modelcontextprotocol\u002Fsdk` v1 to split v2 packages. Reference: https:\u002F\u002Fts.sdk.modelcontextprotocol.io\u002Fv2\u002F\n\n## Steps\n\n1. **Scope migration**: Find every legacy dependency and import. Large multi-directory project: follow [mcp-planning](..\u002Fmcp-planning\u002FSKILL.md) decision 15 — migrate one directory at a time, keep both SDK versions only while untouched v1 code remains, remove v1 once `rg '@modelcontextprotocol\u002Fsdk'` finds no source imports. SDK objects can't cross v1\u002Fv2 boundary: nominal types and `instanceof` checks differ.\n\n   **Done:** Migration scope and one-shot-or-staged posture explicit; every staged boundary isolates v1 and v2 SDK objects.\n\n2. **Run codemod on that scope**: Execute `npx @modelcontextprotocol\u002Fcodemod@latest v1-to-v2 .`, replace `.` with target **directory** when staging — subdirectory run still updates nearest manifest walking up (including removing v1 dependency), preview with `--dry-run`. Updates split-package imports, renames symbols, converts `extra` to `ctx`, rewrites schema-based `setRequestHandler` calls to method strings, changes `.tool()`\u002F`.prompt()`\u002F`.resource()` registrations to `registerTool`\u002F`registerPrompt`\u002F`registerResource` with `z.object()` schemas. Writes `@mcp-codemod-error` where safe rewrite unavailable.\n\n   **Done:** Every targeted file compiles after rewrite or has `@mcp-codemod-error` marker to resolve.\n\n3. **Install split packages**: Replace v1 package with public v2 packages used by rewritten imports (see [Package Split](#package-split)). Install `@modelcontextprotocol\u002Fserver-legacy` (import from its `\u002Fsse` subpath) only for `SSEServerTransport`. Staged work: keep `@modelcontextprotocol\u002Fsdk` only for untouched v1 code; one-shot migration removes it now.\n\n   **Done:** Every migrated import resolves to its v2 package, any retained v1 dependency serves only unmigrated scope.\n\n4. **Resolve each codemod marker**: Find `@mcp-codemod-error` within migration scope, apply matching [rename](#renames) before moving on.\n\n   **Done:** Migrated scope has zero `@mcp-codemod-error` comments, typechecks against installed packages.\n\n5. **Set era posture**: Honor [mcp-planning](..\u002Fmcp-planning\u002FSKILL.md) decision 13; no record = serve both eras. HTTP uses `createMcpHandler(factory, { legacy: 'stateless' })`, stdio uses `serveStdio(factory, { legacy: 'serve' })` for both; modern-only uses `legacy: 'reject'`; 2025-only keeps hand-wired `*StreamableHTTPServerTransport` stack, no `legacy:` setting.\n\n   **Done:** Every server entry point implements selected both-era, modern-only, or 2025-only posture.\n\n6. **Modernize interaction and change flow for selected era**: Both-era and modern servers return `inputRequired(...)` instead of blocking for input; both-era server keeps `ctx.mcpReq.elicitInput` only inside its 2025 branch — throws for modern calls. Use `requestState` for modern multi-round data, `subscriptions\u002Flisten` for modern change streams. 2025-only stack keeps its 2025 interaction and notification mechanisms.\n\n   **Done:** Each interaction, cross-round state, change-notification path uses APIs supported by selected connection era.\n\n7. **Adopt `McpServer` where possible**: Convert low-level `Server` instances unless custom or vendor JSON-RPC methods need low-level class — send those to [mcp-protocol](..\u002Fmcp-protocol\u002FSKILL.md). Use Standard Schema objects: `z.object(...)` from zod ≥4.2.0, or existing ArkType\u002FValibot schemas.\n\n   **Done:** Every server is either `McpServer` or has documented custom methods needing low-level [mcp-protocol](..\u002Fmcp-protocol\u002FSKILL.md) handling.\n\n8. **Choose and verify module mode**: Default ESM with `\"module\": \"NodeNext\"`, `\"moduleResolution\": \"NodeNext\"`, `\"type\": \"module\"`. v2 is ESM-first; CommonJS projects can `require('@modelcontextprotocol\u002F…')` directly.\n\n   **Done:** Selected ESM or CommonJS mode resolves every v2 import in project's compiler and runtime.\n\n9. **Verify behavior**: Run tests from [mcp-test](..\u002Fmcp-test\u002FSKILL.md), review every [Silent Behavior Change](#silent-behavior-changes) against migrated code. Tests — not codemod or compiler — cover those differences. Final staged slice: remove legacy package, confirm no source import remains.\n\n   **Done:** Migrated scope compiles and passes tests; every silent change accounted for; complete migration has no legacy package or source import.\n\n## Reference\n\n### Package Split\n\n| Package                               | Purpose                                                                                  |\n| :------------------------------------ | :--------------------------------------------------------------------------------------- |\n| `@modelcontextprotocol\u002Fserver`        | `McpServer`, `Server`, `createMcpHandler`, validation, errors                            |\n| `@modelcontextprotocol\u002Fclient`        | `Client`, transport, auth, middleware, caching                                           |\n| `@modelcontextprotocol\u002Fcore`          | Raw Zod wire schemas for gateways and proxies                                            |\n| `@modelcontextprotocol\u002Fnode`          | Node HTTP adapter: `toNodeHandler` and stream transport                                  |\n| `@modelcontextprotocol\u002Fcodemod`       | Migration CLI                                                                            |\n| `@modelcontextprotocol\u002Fserver-legacy` | Frozen v1 `SSEServerTransport` (`\u002Fsse`) and Authorization Server OAuth helpers (`\u002Fauth`) |\n| `@modelcontextprotocol\u002Fexpress`       | Express adapter when v1 server owns HTTP integration                                     |\n| `@modelcontextprotocol\u002Fhono`          | Hono adapter when v1 server owns HTTP integration                                        |\n| `@modelcontextprotocol\u002Ffastify`       | Fastify adapter when v1 server owns HTTP integration                                     |\n\n**stdio subpath gotcha:** import `StdioClientTransport`, `StdioServerParameters`, `getDefaultEnvironment`, `DEFAULT_INHERITED_ENV_VARS` from `@modelcontextprotocol\u002Fclient\u002Fstdio`; import `StdioServerTransport` from `@modelcontextprotocol\u002Fserver\u002Fstdio`. Runtime-neutral package roots omit these exports; `ReadBuffer`, `serializeMessage`, `deserializeMessage` stay at root.\n\n### Renames\n\n#### API and type\n\n| v1                                                                                                                            | v2                                                                                                                                   |\n| :---------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |\n| `server.setRequestHandler(CallToolRequestSchema, ...)`                                                                        | `server.setRequestHandler('tools\u002Fcall', ...)` (low-level method string)                                                              |\n| `.tool(...)` (variadic high-level)                                                                                            | `.registerTool(name, config, handler)` (high-level)                                                                                  |\n| `McpError` \u002F `ErrorCode`                                                                                                      | `ProtocolError` \u002F `ProtocolErrorCode` (or `SdkErrorCode`)                                                                            |\n| `StreamableHTTPError`                                                                                                         | `SdkHttpError`                                                                                                                       |\n| `SchemaInput\u003CT>`                                                                                                              | `StandardSchemaWithJSON.InferInput\u003CT>`                                                                                               |\n| `ResourceTemplate` wire type                                                                                                  | `ResourceTemplateType`                                                                                                               |\n| `JSONRPCError` \u002F `JSONRPCErrorSchema` \u002F `isJSONRPCError`                                                                      | `JSONRPCErrorResponse` \u002F `JSONRPCErrorResponseSchema` \u002F `isJSONRPCErrorResponse`                                                     |\n| `JSONRPCResponse` \u002F `JSONRPCResponseSchema` \u002F `isJSONRPCResponse`                                                             | `JSONRPCResultResponse` \u002F `JSONRPCResultResponseSchema` \u002F `isJSONRPCResultResponse`                                                  |\n| `InMemoryTransport` (single export)                                                                                           | Split across `@modelcontextprotocol\u002Fserver` and `\u002Fclient`; both halves of linked pair must come from same package                    |\n| `schemaToJson` \u002F `parseSchemaAsync` \u002F `getSchemaShape` \u002F `getSchemaDescription` \u002F `isOptionalSchema` \u002F `unwrapOptionalSchema` | Removed (`@mcp-codemod-error`); `schemaToJson`→`fromJsonSchema()`, `parseSchemaAsync`→schema-library validation, rest no replacement |\n| `ResourceReference` \u002F `ResourceReferenceSchema`                                                                               | `ResourceTemplateReference` \u002F `ResourceTemplateReferenceSchema`                                                                      |\n| `IsomorphicHeaders`                                                                                                           | Web Standard `Headers` with `.get()` and `.set()`                                                                                    |\n\n**Call-site gotcha:** low-level `setRequestHandler(Schema)` becomes `setRequestHandler('method\u002Fstring')`; high-level `.tool()` becomes `.registerTool()`. Distinct conversions.\n\n#### Context and property\n\n| v1                                                  | v2                                                                                        |\n| :-------------------------------------------------- | :---------------------------------------------------------------------------------------- |\n| `RequestHandlerExtra` (`extra`)                     | `ServerContext` \u002F `ClientContext` (`ctx`)                                                 |\n| `extra.signal` \u002F `requestId` \u002F `_meta`              | `ctx.mcpReq.signal` \u002F `id` \u002F `_meta`                                                      |\n| `extra.sendRequest` \u002F `sendNotification`            | `ctx.mcpReq.send` \u002F `notify`                                                              |\n| `extra.authInfo` \u002F `requestInfo`                    | `ctx.http?.authInfo` \u002F `req` (stdio = undefined)                                          |\n| `extra.sessionId`                                   | `ctx.sessionId`                                                                           |\n| `extra.closeSSEStream` \u002F `closeStandaloneSSEStream` | `ctx.http?.closeSSE` \u002F `closeStandaloneSSE`                                               |\n| `server.sendLoggingMessage`                         | `ctx.mcpReq.log` (deprecated, SEP-2577; modern replacement: per-request `_meta.logLevel`) |\n| `server.createMessage`                              | Deprecated (SEP-2577); removed in later major                                             |\n| `server.listRoots`                                  | Deprecated (SEP-2577); removed in later major                                             |\n| `McpServer.sendLoggingMessage`                      | Deprecated (SEP-2577); removed in later major                                             |\n| `Client.setLoggingLevel`                            | Deprecated (SEP-2577); removed in later major                                             |\n| `Client.sendRootsListChanged`                       | Deprecated (SEP-2577); removed in later major                                             |\n| `ctx.mcpReq.requestSampling`                        | Deprecated (SEP-2577); removed in later major                                             |\n| `registerClient`                                    | Deprecated (SEP-2577); prefer Client ID Metadata Documents per SEP-991                    |\n| `elicitInput`                                       | `inputRequired(...)`; keep `ctx.mcpReq.elicitInput` only for 2025 branches                |\n| `StreamableHTTPServerTransport`                     | `Node\u002FWebStandardStreamableHTTPServerTransport`                                           |\n| `extra.taskStore` \u002F `taskId` \u002F `taskRequestedTtl`   | Removed (experimental tasks, SEP-2663); delete usages                                     |\n\n#### OAuth migration\n\nMap each `\u003CName>Error` class to `OAuthErrorCode.\u003CName>` without `Error` suffix (`InvalidGrantError` → `OAuthErrorCode.InvalidGrant`), except `ServerError`, keeps its name; map `CustomOAuthError` to defined custom code. Replace `OAUTH_ERRORS` and `instanceof` checks with switch on `error.code`. Token verifiers throw `OAuthError(OAuthErrorCode.InvalidToken)` for invalid tokens so response isn't HTTP 500. `InsufficientScopeError` from SEP-2350 is transport-layer `OAuthClientFlowError`, distinct from `OAuthErrorCode.InsufficientScope`.\n\n### Silent Behavior Changes\n\nCompiler and codemod can't catch these.\n\n| Behavior                                                                                       | v1                                         | v2                                                                                                           |\n| :--------------------------------------------------------------------------------------------- | :----------------------------------------- | :----------------------------------------------------------------------------------------------------------- |\n| Unknown or disabled tool name                                                                  | Resolves `CallToolResult{ isError: true }` | Rejects `ProtocolError(InvalidParams)`; catch the promise, read `error.code`                                 |\n| `listTools()` \u002F `listPrompts()` \u002F `listResources()` \u002F `listResourceTemplates()` without cursor | One page                                   | Auto-aggregates all pages; `listMaxPages` defaults to 64, overflow throws `SdkError(ListPaginationExceeded)` |\n| Declared empty `tools`, `resources`, or `prompts`                                              | `-32601 Method not found`                  | `*\u002Flist` returns `[]`, advertises `listChanged: true`; set `listChanged: false` to opt out                   |\n| POST `Content-Type`                                                                            | Substring match                            | Parsed media type; non-`application\u002Fjson` returns `415 Unsupported Media Type`                               |\n| Default JSON Schema dialect                                                                    | draft-07                                   | 2020-12; explicit draft-07\u002F06 still honored                                                                  |\n| `WebSocketClientTransport`                                                                     | Available                                  | Removed; use `StreamableHTTPClientTransport` or `StdioClientTransport`                                       |\n\n### Era Axes\n\n| Axis                       | 2025 era                                        | 2026 era                          |\n| :------------------------- | :---------------------------------------------- | :-------------------------------- |\n| Server HTTP entry          | `*StreamableHTTPServerTransport`                | `createMcpHandler`                |\n| Server stdio entry         | `server.connect(StdioServerTransport)`          | `serveStdio(factory)`             |\n| Client connect             | `initialize` handshake                          | `server\u002Fdiscover` probe           |\n| Client identity            | `getClientCapabilities\u002FVersion`                 | `ctx.mcpReq.envelope` per request |\n| Client cancellation (HTTP) | POST `notifications\u002Fcancelled`                  | Close request's SSE stream        |\n| Server-to-client requests  | `ctx.mcpReq.send`                               | `return inputRequired(...)`       |\n| Change notifications       | `list_changed` \u002F `updated`                      | `subscriptions\u002Flisten` stream     |\n| Logging                    | `ctx.mcpReq.log()` \u002F session `logging\u002FsetLevel` | Per-request `_meta.logLevel`      |\n| HTTP 400 JSON-RPC error    | `SdkHttpError`                                  | In-band `ProtocolError`           |\n",{"name":5,"metadata":24,"description":7,"user-invocable":20},{"category":25},"technique","main","534498267dccbe415f22f31fceac9da6771c195f","plugins\u002Fmcp-hub\u002Fskills\u002Fmcp-migration","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace","https:\u002F\u002Fj0hanz-marketplace.vercel.app","https:\u002F\u002Fgithub.com\u002Fj0hanz","linus-johansson-cv-d308be9b73e1.herokuapp.com","2026-11-15 02:42:07",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add j0hanz\u002Fj0hanz-marketplace --skill mcp-migration",{"tool":40,"command":41},"bunx","bunx skills add j0hanz\u002Fj0hanz-marketplace --skill mcp-migration",{"tool":43,"command":44},"pnpm","pnpm dlx skills add j0hanz\u002Fj0hanz-marketplace --skill mcp-migration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fmcp-hub\u002Fskills\u002Fmcp-migration\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7ABP78JFYBMCXJ9GMETCYZM","unslop","Use when writing or editing prose a person will read, or when text sounds AI-generated.","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwriteup\u002Fskills\u002Funslop\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7ABP52BNV7NRPNBR6PCNZWC","show-me","Use when asked to show, diagram, or walk through how code fits together or what a change does, or before explaining a multi-file flow in prose.","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwriteup\u002Fskills\u002Fshow-me\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7ABP3EPN4KFB4HPJNMY31NR","pr","Use when writing or updating a pull request description, or before running `gh pr create`.","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwriteup\u002Fskills\u002Fpr\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7ABP08MXTHPZYTG4HKEP7WQ","commit","Use when writing a commit message, or before running `git commit`.","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fwriteup\u002Fskills\u002Fcommit\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7ABNV9J7DN1AFRBGDBHVBY2","write-specs","Spec a feature's observable behavior. Use when asked for requirements, when a request says what the system should do but not how, or to capture what a built system already guarantees. Not for how to build it (write-plan).","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fworkbench\u002Fskills\u002Fwrite-specs\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7ABNPK2GVG8EB3SSEAMK4FZ","write-skills","Write, fix, or audit a skill's frontmatter, trigger description, and body. Use when a skill is asked for, never fires, or fires at the wrong moment. Not for a hook (write-hooks) or the plugin manifest and catalog.","https:\u002F\u002Fgithub.com\u002Fj0hanz\u002Fj0hanz-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fworkbench\u002Fskills\u002Fwrite-skills\u002FSKILL.md",[],[]]