convert-mcp-sdk-v1-to-v2

Port MCP TypeScript servers from v1.x to the v2 split-package SDK.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur-secondary --skill convert-mcp-sdk-v1-to-v2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-mcp-sdk-v1-to-v2
Source: https://github.com/yigitkonur/skills-by-yigitkonur-secondary/tree/main/skills/convert-mcp-sdk-v1-to-v2
Command: npx skills add https://github.com/yigitkonur/skills-by-yigitkonur-secondary --skill convert-mcp-sdk-v1-to-v2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Port MCP servers from v1.x to the v2 split-package SDK, enabling modern imports, type safety, and a forward-compatible architecture.

Core Features & Use Cases

  • Migration guidance for package/import rewrites, server/context mapping, and transport changes.
  • Concrete roadmap for upgrading schemas (z.object), error handling (ProtocolError), and handler signatures (ctx-based).

Quick Start

Port your MCP v1 server to v2 by updating imports, wrapping raw shapes in z.object(), and converting extra to ctx.

Frequently Asked Questions about convert-mcp-sdk-v1-to-v2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my MCP TypeScript server from v1 to the v2 split-package SDK?

To migrate an MCP TypeScript server to v2, update package imports to the split-package SDK, replace McpError with ProtocolError, and convert handler arguments from the v1 extra parameter to the v2 ctx context object.

What changed for error handling when porting MCP v1 servers to v2?

Error handling in MCP v2 replaces the v1 McpError class with ProtocolError and updates ErrorCode to ProtocolErrorCode, aligning error structures with the split-package SDK architecture.

How do I update Zod schemas for MCP v2 SDK migration?

When migrating to MCP v2, wrap raw schema shapes in z.object() calls to ensure type safety and compatibility with the updated Zod v4 integration within the split-package SDK.

Does MCP v2 SDK support Express and Hono transports?

Yes, the MCP v2 split-package SDK supports multiple transport frameworks including Express and Hono, replacing the v1 stdio and streamable HTTP transport surfaces with modern web framework integrations.

Why do my MCP v2 handler signatures fail after upgrading from v1?

MCP v2 handler signatures fail because the argument structure changed from the v1 format of (args, extra) to the new v2 format of (args, ctx), requiring updates to all tool handler function definitions.

Can I use my existing MCP v1 server context with the v2 SDK?

Existing MCP v1 server context requires remapping to the v2 ServerContext structure during migration, ensuring proper module resolution and alpha version pinning for forward-compatible architecture.