typescript-sdk/docs/migration/index.md
Felix Weinberger 1823aae891
Implement MCP 2026-07-28 (#2286)
Co-authored-by: Matt <77928207+mattzcarey@users.noreply.github.com>
Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-26 14:01:10 +01:00

1.7 KiB

MCP TypeScript SDK — Migration Guides

Pick the guide for your starting point.

Upgrading from v1.x (@modelcontextprotocol/sdk)

→ upgrade-to-v2.md

You are on the monolithic @modelcontextprotocol/sdk package and want to move to the v2 packages (@modelcontextprotocol/client, @modelcontextprotocol/server, …).

Start by running the codemod:

npx @modelcontextprotocol/codemod@alpha v1-to-v2 ./src

The codemod handles most mechanical renames. The guide covers what it can't. The codemod handles the v1→v2 SDK surface upgrade only — adopting the 2026-07-28 protocol revision (createMcpHandler, multi-round-trip requests, versionNegotiation) is architectural and not codemod-automatable; see support-2026-07-28.md.

Already on v2, adopting protocol revision 2026-07-28

→ support-2026-07-28.md

You are already on the v2 packages and want your server or client to speak the 2026-07-28 protocol revision (per-request _meta envelope, createMcpHandler, serveStdio, versionNegotiation, multi-round-trip requests, per-era wire codecs).

This guide also covers code written against an earlier v2 alpha that read wire-only members (resultType, envelope keys) directly.

Using an LLM agent to migrate

upgrade-to-v2.md is the agent skill — it carries skill frontmatter and is structured for mechanical application. Point the agent at the codemod first; the guide is the codemod's companion for what's left.

See also