convert-mcp-server-sdk-v1-to-v2

Installation
SKILL.md

Convert MCP Server (SDK v1 → v2)

Port an existing MCP TypeScript server from @modelcontextprotocol/sdk v1.x (single package) to the v2 split-package SDK: @modelcontextprotocol/server, /client, /node, /express, /hono. The v2 surface changes are package split, extra → ctx handler-context mapping, Zod v3→v4 with raw-shape removal, McpError → ProtocolError, method-string request-handler keys, framework adapter packages, and OAuth-router removal.

v2 is currently a pre-release alpha. Latest published: 2.0.0-alpha.2 (verified on npm, 2026-05-09). Most production servers should stay on @modelcontextprotocol/sdk@^1.x and use this skill to plan, test, and stage the migration — not to flip a production switch.

When to use this skill

Trigger on actual migration intent applied to an existing v1 codebase. Italicized phrases below are concrete tells:

  • "port my MCP server to v2", "upgrade @modelcontextprotocol/sdk to the new split packages"
  • "replace @modelcontextprotocol/sdk/server/mcp.js imports with @modelcontextprotocol/server"
  • "my handlers use extra.signal/extra.authInfo and I need the v2 equivalent"
  • "convert inputSchema: { name: z.string() } raw shapes to v2", "upgrade Zod v3 to v4 in MCP tools"
  • "replace mcpAuthRouter / requireBearerAuth / OAuthServerProvider"
  • "swap StreamableHTTPServerTransport for NodeStreamableHTTPServerTransport"
  • "McpError/ErrorCodeProtocolError/ProtocolErrorCode rename"
  • "setRequestHandler(CallToolRequestSchema, ...) → method-string keys"
Related skills
Installs
5
GitHub Stars
6
First Seen
4 days ago