Back to Blog
TutorialsJul 22, 2026Updated Nov 299 min read

Migrate to the MCP 2026-07-28 Spec: What Broke After Launch

NT

Nikhil Tiwari

MCP Playground

TL;DR — updated November 2026, four months after launch

  • It shipped. The 2026-07-28 spec went final on July 28. TypeScript, Python, Go and C# SDKs had support on launch day.
  • Sessions are gone. No initialize, no Mcp-Session-Id. The protocol version rides in _meta on every request.
  • New MUSTs: server/discover, plus Mcp-Method and Mcp-Name headers on HTTP.
  • The break people actually hit: old clients get -32022 from modern-only servers. Keep legacy on for public servers.
  • Deprecated, not removed: Roots, Sampling and Logging work until at least July 28, 2027.

I wrote the first version of this guide a week before the 2026-07-28 MCP spec went final. It has now been live for four months, and the migration questions I get have changed.

In July the question was “what will break?”. Now it is “I migrated, so why can’t some clients connect?”. This update answers both, based on what actually happened once SDKs and clients shipped.

If you run an MCP server built on 2025-11-25, this is the checklist to move it to 2026-07-28. If you are starting from scratch, build your MCP server on the 2026-07-28 spec directly instead.

The short version: the code changes are small, the SDK does most of the work, and the real risk is cutting off clients that have not upgraded.

What the 2026-07-28 MCP Spec Changed

The maintainers called it the largest revision since launch, and it is. Here is the before and after for a server.

Area2025-11-25 (legacy)2026-07-28 (modern)
Connection startinitialize handshakeNone. server/discover is a MUST
SessionsMcp-Session-Id headerRemoved
Protocol versionNegotiated onceIn _meta on every request
HTTP routingGateway inspects the bodyMcp-Method and Mcp-Name headers, required
List cachingNonettlMs and cacheScope on list results
Resource not found-32002-32602
Server asking the clientServer-to-client requestsMulti round-trip requests (inputRequired)
ScalingSticky sessions or a shared storeAny instance, any request

I covered the reasoning behind the stateless design in MCP goes stateless. This post is only about getting an existing server across.

The 2026-07-28 MCP Migration Checklist

  1. Install the v2 SDK package next to v1.
  2. Remove session handling. Move any per-session state into explicit arguments.
  3. Let the SDK answer server/discover, and set cache hints on lists.
  4. Make sure every proxy forwards Mcp-Method and Mcp-Name.
  5. Fix hardcoded -32002 checks.
  6. Replace Roots, Sampling and Logging, or schedule it before July 2027.
  7. Check your OAuth flow against the 2026 rules, starting with iss validation.
  8. Keep legacy support on, and log which era each request uses.
  9. Test both eras before you ship.

Step 1: Pick the Right MCP SDK Package

The TypeScript v2 SDK did not ship as a major version bump. It shipped as a new package, @modelcontextprotocol/server, and the old @modelcontextprotocol/sdk v1 line is still maintained.

So you can install v2 beside v1 and move one endpoint at a time. Python, Go and C# also shipped 2026-07-28 support on launch day, so check your SDK’s release notes for the version that added it.

Terminal
npm install @modelcontextprotocol/server zod@^4

The zod 4 gotcha

The v2 SDK takes Standard Schema validators that expose a jsonSchema property. Only zod 4 does. If your repo is on zod 3, install zod 4 under an alias instead of upgrading everything at once.

Step 2: Remove Sessions From Your MCP Server

Delete the initialize handler, the session ID generator, and the shared session store. Each request now carries its protocol version and client info in _meta.

The harder part is code that quietly depended on a session. A shopping basket, a selected workspace, an open file handle: anything you kept server-side between calls.

Move that state into explicit handles. Return a basket_id from one tool and take it as an argument in the next. The model passes it along, and any instance can serve the call.

Once sessions are gone, a server that needed sticky routing can sit behind a plain round-robin load balancer. That is the main payoff of the migration.

Step 3: server/discover, Routing Headers and Cache Hints

server/discover is a MUST, but the SDK answers it

Capabilities used to come from the handshake. Now clients call server/discover. The v2 SDK answers it from the tools, prompts and resources you registered, so you write no handler.

Mcp-Method and Mcp-Name are required on HTTP

Modern requests carry the method and the tool or resource name as HTTP headers, so a gateway can route without reading the body. If a proxy strips unknown headers, modern traffic fails there. My MCP gateway guide covers the proxy side.

The same rule covers the new events/* methods: Mcp-Name must carry the event name, and some client SDKs don’t send it yet. The MCP Events guide lists that and the other rules servers trip on.

Set cache hints, or clients refetch every time

List results now carry ttlMs and cacheScope. Without your hints the SDK sends ttlMs: 0 and cacheScope: 'private', which is compliant but tells clients nothing.

server.ts
cacheHints: {
  'tools/list': { ttlMs: 60_000, cacheScope: 'public' },
  'server/discover': { ttlMs: 300_000, cacheScope: 'public' },
}

Step 4: Fix the Error Codes

Resource-not-found moved from -32002 to the standard JSON-RPC -32602 (invalid params). A client with a hardcoded -32002 check silently stops matching.

If you serve both eras, return the era-correct code: -32002 to legacy requests, -32602 to modern ones. What MCP error -32602 means covers the other cases that return it.

There is also a new code to recognise. -32022 UnsupportedProtocolVersion is what a modern-only server returns to an old handshake. If you see it in client logs, the server dropped legacy support.

Step 5: Plan Off Roots, Sampling and Logging

The spec added a formal lifecycle: Active, then Deprecated, then Removed. Deprecated features keep working in this release and in every spec version published within a year, so the earliest removal is July 28, 2027.

  • Roots: pass the scope explicitly, as a tool parameter, a resource URI or server config.
  • Sampling: call your model provider’s API from the server instead of asking the client to sample.
  • Logging: write to stderr or send structured logs to OpenTelemetry. W3C Trace Context propagation is now standard across SDKs.

If your server used to call back into the client mid-request, look at multi round-trip requests. Your handler returns an inputRequired result, and the client re-sends the original request with the answers. The v2 SDK maps the same handler onto 2025-era connections.

Long-running work moved too. The experimental Tasks API is now the Tasks extension.

Step 6: Tighten Authorization

Six auth proposals bring MCP closer to plain OAuth 2.0 and OpenID Connect. Most of the work lands on clients and authorization servers, not on the MCP server itself.

  • Clients must validate the iss parameter on authorization responses, per RFC 9207. If you run the authorization server, make sure it sends one.
  • Clients declare application_type during dynamic client registration, so a CLI or desktop client is not treated as a web app.
  • Credentials bind to a specific authorization-server issuer.
  • Scope accumulation during step-up and .well-known discovery are clarified.

My MCP OAuth guide has been updated for both the 2025-11-25 and 2026-07-28 auth rules.

Migrated? Check both eras before you ship

Connect your server, force either spec revision, and call every tool. Free, in the browser.

Don’t Lock Out Old MCP Clients

This is the problem that showed up after launch. Plenty of clients are still on 2025-era SDKs: pinned versions in production agents, internal tools nobody has touched, desktop apps whose users never update.

Those clients only know the initialize handshake. A modern-only server answers it with -32022, and the connection ends. New v2 clients are fine either way, because they try server/discover and fall back to the handshake.

In the v2 TypeScript SDK, serving both is the default. One factory backs both eras, so they cannot drift apart.

server.ts
import { createMcpHandler } from '@modelcontextprotocol/server';

const handler = createMcpHandler(
  ({ era }) => {
    metrics.increment('mcp.requests', { era }); // 'legacy' | 'modern'
    return buildServer();
  },
  { legacy: 'stateless' } // the default; 'reject' = modern-only
);

Count the era on every request. When legacy traffic stays near zero for a few weeks, announce a date and switch to legacy: 'reject'. The dual-protocol checklist covers sessionful legacy servers and the full decision.

How to Test Your 2026-07-28 MCP Migration

A green test on the newest client says nothing about old ones, so test each era separately.

  1. Open the MCP server tester and connect with the version switch on Stateless 2026-07-28.
  2. Confirm server/discover lists every tool, and that list results carry ttlMs and cacheScope.
  3. Reconnect on Stateful 2025-11-25. The same tools should appear.
  4. Call one tool on each era, and request a missing resource to check the error code.
  5. Run the MCP Checker to see the revision you asked for next to the one that answered.

If you maintain a client, point it at the hosted mock MCP servers. The stateless mock accepts ?rev=2026-07-28 or ?rev=2025-11-25, so you can trigger the -32022 rejection on purpose.

Bottom line

Install the v2 SDK, remove sessions, let the SDK answer server/discover, fix the error codes and check your OAuth flow. Then keep legacy support on until your own traffic says nobody needs it.

FAQ: Migrating to the 2026-07-28 MCP Spec

Has the 2026-07-28 MCP spec shipped?+
Yes. The final 2026-07-28 specification shipped on July 28, 2026, after the release candidate locked on May 21. The official TypeScript SDK shipped it as new v2 packages, and Python, Go and C# shipped support on launch day.
What breaks when I migrate to the 2026-07-28 MCP spec?+
The initialize handshake and Mcp-Session-Id are gone, so servers are stateless and the protocol version travels in _meta on every request. server/discover is a MUST, Mcp-Method and Mcp-Name HTTP headers are required, resource-not-found moves from -32002 to -32602, and Roots, Sampling and Logging are deprecated.
Will old MCP clients still connect after I migrate?+
Only if you keep legacy support on. A 2025-era client only knows the initialize handshake, and a modern-only server rejects it with -32022 UnsupportedProtocolVersion. In the v2 TypeScript SDK, createMcpHandler serves both eras by default with legacy: stateless.
Which SDK package do I need for the 2026-07-28 spec?+
In TypeScript, @modelcontextprotocol/server version 2. It shipped as a new package rather than a major bump, so the v1 @modelcontextprotocol/sdk line is still maintained and both can sit in one project. The v2 SDK needs a Standard Schema validator with a jsonSchema property, which in practice means zod 4.
When are Roots, Sampling and Logging removed?+
Not before July 28, 2027. Under the deprecation policy they keep working in this release and in every spec version published within a year of it. Move to tool parameters or config for Roots, a direct LLM API call for Sampling, and stderr or OpenTelemetry for Logging.
How do I check that my migrated server works?+
Connect it in the MCP Playground server tester twice: once forced to stateless 2026-07-28 and once forced to stateful 2025-11-25. Both should list the same tools and return the same results. The MCP Checker shows the revision you asked for next to the one that answered.

Sources

NT

Written by Nikhil Tiwari

15+ years in product development. AI enthusiast building developer tools that make complex technologies accessible to everyone.

Build, compare & ship MCP agents

Connect any MCP server, run evals on it, compare 90+ models side-by-side, deploy hosted servers, and save reusable agents you can export as an API — all in your browser.

Try for Free →