convert-mcp-server-sdk-v1-to-v2
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.jsimports with@modelcontextprotocol/server" - "my handlers use
extra.signal/extra.authInfoand 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
StreamableHTTPServerTransportforNodeStreamableHTTPServerTransport" - "
McpError/ErrorCode→ProtocolError/ProtocolErrorCoderename" - "
setRequestHandler(CallToolRequestSchema, ...)→ method-string keys"
More from yigitkonur/skills-by-yigitkonur
run-research
Use skill if you are answering one technical research question with current web evidence, Reddit practitioner experience, and source-backed synthesis, optionally fanned out across parallel subagents.
42run-agent-browser
Use skill if you are driving the agent-browser CLI for ad hoc browser automation — @ref snapshots, sessions, forms, extraction, screenshots, headed/stealth, or provider runs.
38publish-npm-package
Use skill if you are publishing to npm via GitHub Actions release workflow with trusted publishing, NPM_TOKEN, provenance, semantic-release, changesets, release-please, or fixing npm publish CI.
35init-agent-config
Use skill if you are creating, auditing, or migrating CLAUDE.md, AGENTS.md, or REVIEW.md instruction files, folder-scoped agent guidance, or cross-agent companion entrypoints.
34build-mcp-use-server
Use skill if you are building TypeScript MCP servers with mcp-use/server — server.tool, response helpers, ctx.auth, sessions, transports, widgets, Inspector, deploy.
34build-skills
Use skill if you are creating or substantially revising a Claude skill and need workspace-first evidence, remote comparison, and repo-fit synthesis before writing SKILL.md.
32