migrate-v1-to-v2

Migrate MCP TypeScript SDK code from v1 to v2 with dependency and import updates.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/gcapnias/server-features --skill migrate-v1-to-v2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-v1-to-v2
Source: https://github.com/gcapnias/server-features/tree/main/.github/skills/migrate-v1-to-v2
Command: npx skills add https://github.com/gcapnias/server-features --skill migrate-v1-to-v2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This migration guide helps teams upgrade MCP TypeScript SDK code from v1 to v2, aligning dependencies, imports, and API usage to the modern v2 contracts, reducing technical debt and future maintenance overhead.

Core Features & Use Cases

  • Provides import mapping guidance to replace v1 imports with v2 packages and align with new symbol names and error models.
  • Covers the tool migration required by v2 (registerTool, registerPrompt, registerResource) and the mandatory wrapping of raw Zod shapes into z.object().
  • Addresses runtime changes such as header handling, JSON schema validation, and client/server boundary updates to ensure a smooth, end-to-end upgrade across projects.

Quick Start

Install the v2 packages and follow the mapping guidelines to begin migrating your codebase.

Frequently Asked Questions about migrate-v1-to-v2

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

FAQPage Schema
How do I migrate MCP TypeScript SDK from v1 to v2?

To migrate MCP TypeScript SDK from v1 to v2, update your dependencies and replace v1 imports with v2 packages. You must align with new symbol names, update error models, and wrap raw Zod shapes into z.object() for compatibility.

What changes are required for MCP SDK v2 tool registration?

MCP SDK v2 tool registration requires using registerTool, registerPrompt, and registerResource. You must also wrap raw Zod schemas into z.object() to align with the modern v2 contracts and ensure runtime compatibility.

Does MCP SDK v2 require wrapping Zod schemas?

Yes, MCP SDK v2 requires wrapping raw Zod shapes into z.object(). This mandatory wrapping ensures proper JSON schema validation and compatibility across the updated client and server boundaries.

What runtime changes happen when upgrading MCP SDK to v2?

Upgrading MCP SDK to v2 introduces runtime changes including header handling, JSON schema validation, and client/server boundary updates. These modifications ensure a smooth end-to-end upgrade across your MCP tooling.

Do I need Node.js to upgrade MCP TypeScript SDK to v2?

Yes, upgrading MCP TypeScript SDK to v2 assumes a Node.js environment with updated packages. You need this setup to execute the clear migration steps and ensure compatibility across your project.