v2 is a major revision of the TypeScript SDK for the 2026-07-28 MCP spec, and it's now in beta. The API is settling but can still change before the stable release, which lands alongside the spec on July 28, 2026. We'd love for you to build with it now and tell us what breaks.
npm install @modelcontextprotocol/server@beta # or @modelcontextprotocol/client@betaWhat's new in the SDK
- Split packages.
@modelcontextprotocol/sdkis now@modelcontextprotocol/serverand@modelcontextprotocol/client, with thin optional adapters for Express, Hono, Fastify, and Node'shttp. Install only the side you need. - Bring your own schema library.
inputSchema/outputSchematake any Standard Schema that can produce JSON Schema: Zod v4 and ArkType work as-is, Valibot works via@valibot/to-json-schema, andfromJsonSchematakes plain JSON Schema with no library at all. You're no longer tied to Zod (we still use it internally). - Serving is one call.
serveStdio()for local servers,createMcpHandler()for HTTP. The handler speaks web-standardRequest/Response, so the same code runs on Node, Bun, Deno, and Workers. - A real request context. Handlers get a typed
ctx(logging, progress, cancellation, elicitation) instead of v1'sextrabag. - A codemod for the mechanical part of migrating:
npx @modelcontextprotocol/codemod@beta v1-to-v2 . - New docs and examples. The documentation is rebuilt around what you're doing (10-minute server tutorial onward), every code block is type-checked and executed in CI, and every example is a self-verifying client/server pair.
2026-07-28 spec support
The headline protocol changes are all implemented. The release-candidate post has the full story:
- Stateless core: servers scale on plain HTTP with no session affinity; sessions are opt-in where you need them.
- Multi-round-trip requests: a tool can ask the user for input mid-call without holding a connection open.
- Header-based routing and caching:
Mcp-Method/Mcp-Nameheaders for routing without body inspection, plusttlMs/cacheScopehints on results. - Both eras at once: one server can serve 2026-07-28 and 2025-era clients side by side (Protocol versions).
v2 passes the official MCP conformance suite (0.2.0-alpha.7) fully, client and server, except the tasks suite: tasks moved to an extension in 2026-07-28, and we aim to ship support for it with the stable release or soon after.
Get started, migrate, tell us
- New here? Build a server in ten minutes.
- Coming from v1? Upgrade guide + the codemod above. v1.x stays supported with bug fixes and security updates for at least 6 months after v2 ships.
- Already on v2 and want the new protocol revision? Support 2026-07-28.
Feedback is the most useful thing you can give us during the beta: API friction, docs gaps, bugs, anything. Open a v2 issue.