Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

Two code editors side-by-side showing before and after MCP spec changes with highlighted diff lines and a large red…
Open SourceScore: 91

7 Breaking Changes in the 2026-07-28 MCP Spec: Your Before/After Migration Guide

The 2026-07-28 MCP spec removes sessions and the initialize handshake. Run these 7 greps against your src/ to find every breaking change, then migrate in order: sessions first, then handshake, then error codes.

·17h ago·3 min read··17 views·AI-Generated·Report error
Share:
Source: dev.tovia devto_mcp, devto_claudecode, gn_mcp_protocol, gn_agentic_coding, reddit_claude, hn_claude_codeMulti-Source
How do I migrate my MCP server to the 2026-07-28 spec?

The 2026-07-28 MCP spec introduces 7 breaking changes. The critical ones: sessions are removed (SEP-2567), the initialize handshake is gone (SEP-2575), and error code -32002 becomes -32602 (SEP-2164). Run the greps in this guide to find every affected line.

TL;DR

The 2026-07-28 MCP spec removes sessions and the initialize handshake. Run these 7 greps to find every breaking change in your server code.

The 2026-07-28 MCP spec is the biggest revision since the protocol launched, and it is not backward compatible. If you run a production MCP server, code stops working that day.

Most write-ups explain the why (MCP went stateless). But you need the what: which lines break, and what to change them to. Here are all seven changes, with before/after code and a grep you can run right now.

Key Takeaways

  • The 2026-07-28 MCP spec removes sessions and the initialize handshake.
  • Run these 7 greps against your src/ to find every breaking change, then migrate in order: sessions first, then handshake, then error codes.

1. The session is gone (SEP-2567)

The Mcp-Session-Id header and protocol-level session are removed. The transport is now stateless — any request can land on any server instance.

Upside: No more sticky sessions, shared session stores, or smart gateways. Run behind plain round-robin load balancing.

Cost: Anything reading/writing a session breaks.

// before — TS SDK
new StreamableHTTPServerTransport({
  sessionIdGenerator: () => randomUUID(),
});

// after — no session id
new StreamableHTTPServerTransport({
  sessionIdGenerator: undefined,
});

What lived in the session now travels in _meta on every request. Read protocol version, client info, capabilities per-request instead of by session id.

grep -rn "Mcp-Session-Id\|sessionIdGenerator\|sessionStore" src/

Need state across calls? Mint an explicit handle from a tool (a cart_id, a run_id) and have the model pass it back as an argument.

2. The initialize handshake is removed (SEP-2575)

No more initialize/initialized round trip. Without a session, there's no "connection time" to pin it to.

Capability data now arrives in _meta on each request. Move capability checks inline where you use them.

grep -rn "initialized\|onInitialize\|InitializeRequestSchema" src/

3. Error code -32002 becomes -32602 (SEP-2164)

The MCP-custom "resource not found" code now returns standard JSON-RPC -32602 (Invalid Params).

// before
throw new McpError(-32002, "Unknown resource");
// after
throw new McpError(-32602, "Unknown resource");

Check both your server throws and client matches:

grep -rn "32002" src/ test/

4. Two new required routing headers (SEP-2243)

Before vs. After: What Changes With the N…

Streamable HTTP transport now requires Mcp-Method and Mcp-Name headers. This lets load balancers route without reading the request body.

If you sit behind a proxy/gateway, make sure these headers pass through. If you hand-roll HTTP, set them.

5. ttlMs and cacheScope on list/read responses (SEP-2549)

Additive, not breaking. Set ttlMs on responses for free client-side caching. Worth a pass once the rest compiles.

6. Roots, sampling, and logging are deprecated (SEP-2577)

Still function on 2026-07-28, but on a 12-month runway to removal (July 2027).

  • sampling: Replace with direct LLM API calls
  • roots: Pass working context as tool inputs
  • logging: Move to stderr or OpenTelemetry
grep -rn "createMessage\|ListRootsRequest\|sendLoggingMessage\|setLoggingLevel" src/

7. Tasks move to an extension (SEP-2663)

Tasks ship as a versioned extension instead of core. The redesign drops tasks/result for polling via tasks/get, adds tasks/update, and removes tasks/list.

grep -rn "tasks/list\|tasks/result\|CreateTaskRequest" src/

How to sequence the work

Do first (hard breaks, fail July 28): sessions (1), handshake (2), error code (3). Ship. Then headers (4), caching (5), deprecations (6, 7) on their longer runway.

Run all seven greps against your src/. They catch the obvious call sites in about two minutes. Read the hits — don't trust the count — but the punch list will be short.


Source: dev.to

Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from multiple verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

**What Claude Code users should do differently:** First, run all seven greps from this guide against your MCP server codebase immediately. Use `claude` with a prompt like "Run these grep commands against my src/ directory and report every match with file and line number" to get a complete migration punch list in under a minute. Second, prioritize the three hard breaks: session removal, handshake removal, and error code change. These will cause runtime failures on July 28. Use Claude Code to refactor session-dependent logic — have it rewrite your `StreamableHTTPServerTransport` initialization and move capability checks inline. For error codes, a simple find-and-replace across your codebase via Claude Code handles this in seconds. Third, update your CLAUDE.md to document the new stateless architecture. Add a note that all per-request metadata now comes via `_meta`, and that state must be managed via explicit handles passed as tool arguments. This prevents future contributors from reintroducing session-dependent patterns.

Mentioned in this article

Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Open Source

View all