github modelcontextprotocol/typescript-sdk v2.0.0-beta.1
MCP TypeScript SDK v2 (beta)

pre-release3 hours ago

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@beta

What's new in the SDK

  • Split packages. @modelcontextprotocol/sdk is now @modelcontextprotocol/server and @modelcontextprotocol/client, with thin optional adapters for Express, Hono, Fastify, and Node's http. Install only the side you need.
  • Bring your own schema library. inputSchema / outputSchema take any Standard Schema that can produce JSON Schema: Zod v4 and ArkType work as-is, Valibot works via @valibot/to-json-schema, and fromJsonSchema takes 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-standard Request/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's extra bag.
  • 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-Name headers for routing without body inspection, plus ttlMs / cacheScope hints 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

Feedback is the most useful thing you can give us during the beta: API friction, docs gaps, bugs, anything. Open a v2 issue.

Don't miss a new typescript-sdk release

NewReleases is sending notifications on new releases.