mcp-2026-migration
Skill8 starsChanged 3 months agoMITView on GitHub
Migrate MCP servers, gateways, and clients to the 2026-07-28 specification: stateless request-response core (no initialize handshake, no Mcp-Session-Id, version/capabilities in _meta), required Mcp-Method/Mcp-Name headers, Multi Round-Trip Requests replacing server-initiated elicitation/sampling/roots, cacheable list results (ttlMs/cacheScope), CIMD auth over deprecated DCR, the extensions framework (Tasks, Apps, Skills over MCP), and the 12-month deprecation offramp for Roots/Sampling/Logging and HTTP+SSE. Trigger when upgrading any MCP implementation from protocol 2025-11-25 or earlier, writing new MCP code, configuring MCP-aware gateways/proxies/WAFs, or debugging UnsupportedProtocolVersion/HeaderMismatch errors.
In this repository21 other files it gives its agents.
- agent-design-fundamentalsSkill
- agent-evalsSkill
- agent-failure-preflightSkill
- agentic-coding-disciplineSkill
- agent-improvement-loopSkill
- agent-sandboxingSkill
- coding-agent-securitySkill
- context-compressionSkill
- context-engineeringSkill
- gpt-56-promptingSkill
- long-running-harnessSkill
- mcp-code-executionSkill
- memory-compactionSkill
- monorepo-agentsSkill
- planner-evaluator-harnessSkill
- prompt-cache-optimizationSkill
- prompt-engineering-canonSkill
- skill-authoringSkill
- spec-driven-devSkill
- tool-designSkill
- zero-trust-agentsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Every result now carries a required resultType: "complete" or "input_required".
- Very specific: line 58
If you must use DCR, set application_type explicitly: "native" for desktop/CLI/localhost apps, "web" for remote browser apps.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP 2026-07-28 Migration (Stateless Core, MRTR, CIMD)
This skill is an operating procedure for moving MCP servers, gateways, and clients from protocol 2025-11-25 (or earlier) to 2026-07-28 — which the maintainers call MCP's most important release since remote MCP first launched. It gives you the exact headers, _meta keys, result fields, error codes, and deprecation offramps from the official spec and the maintainers' deep-dive, plus a per-role migration checklist.
When to use
- Upgrading an existing MCP server, client, or SDK integration to protocol version
2026-07-28. - Writing any NEW MCP implementation (start on the new patterns; do not adopt deprecated features).
- Configuring gateways, load balancers, rate limiters, or WAFs in front of MCP servers.
- Debugging
UnsupportedProtocolVersion(-32022),HeaderMismatch(-32020), or session-related breakage after an SDK upgrade — the blog notes the migration cost lands hardest on developers who depended on session identifiers.
Do NOT use when the deployment is deliberately pinned to 2025-11-25 or earlier with no upgrade planned, or for OAuth work unrelated to MCP. Do not use it to justify ripping out deprecated features immediately — Roots, Sampling, and Logging keep working for at least twelve months under the formal deprecation policy.
Rules
Stateless core
- Remove the
initialize/notifications/initializedhandshake and theMcp-Session-Idheader entirely (SEP-2575, SEP-2567). Every request must carry its protocol version and client capabilities in_meta:io.modelcontextprotocol/protocolVersionandio.modelcontextprotocol/clientCapabilities. Clients SHOULD addio.modelcontextprotocol/clientInfoper request; servers SHOULD returnio.modelcontextprotocol/serverInfoin each result's_meta. Why: any request can now land on any server instance behind a plain round-robin load balancer with no shared storage. - Servers MUST implement the
server/discoverRPC advertising supported versions, capabilities, and identity. Clients MAY call it up front for version selection or as a backward-compatibility probe on STDIO. Version mismatches returnUnsupportedProtocolVersionError(-32022). - Protocol sessions are gone but application state is not: have a tool mint an explicit state handle and require the model to pass it back as an ordinary tool argument on later calls (the maintainers' recommended pattern). List endpoints (
tools/list,resources/list,prompts/list) no longer vary per-connection.
Header-based routing
- Every Streamable HTTP POST MUST carry
MCP-Protocol-VersionandMcp-Method(the RPC method);Mcp-Name(fromparams.nameorparams.uri) is additionally REQUIRED ontools/call,resources/read, andprompts/getrequests (SEP-2243). Header/body mismatch — or a missing/malformed required header — isHeaderMismatchError(-32020). Custom headers come from tool parameters annotated withx-mcp-headerin the tool'sinputSchema, mirrored asMcp-Param-{Name}headers. - Gateways should, per the maintainers, "route and meter on those headers instead of parsing JSON bodies" — apply routing, rate limits, and WAF rules at the header layer.
Multi Round-Trip Requests (MRTR)
- Server-initiated requests (
roots/list,sampling/createMessage,elicitation/create) are no longer supported — breaking change (SEP-2322). Instead, respond to the client's request with anInputRequiredResult:resultType: "input_required", an optionalinputRequestsmap, and an optionalrequestStatestring. At least one of the two MUST be present. inputRequestskeys are server-assigned identifiers, unique within the request; values MUST be one ofElicitRequest,CreateMessageRequest, orListRootsRequest. Never include a request type the client did not declare in its capabilities.InputRequiredResultis allowed ONLY ontools/call,resources/read, andprompts/get. Servers MUST NOT send it on any other client request, and MUST NOT assume the client will fulfill the requests or retry.requestStateis opaque to clients: echo it back byte-exact on retry, never inspect, parse, or modify it. Servers MUST treat incomingrequestStateas attacker-controlled — protect integrity (HMAC or AEAD) whenever it influences authorization, resource access, or business logic, and reject state that fails verification. Embed the authenticated principal, a short TTL, and an identifier of the originating request; enforce single-use server-side where at-most-once matters.- The retry is an independent request: it MUST use a different JSON-RPC
id, with the client's answers ininputResponses(keys matchinginputRequests). If responses are missing, servers SHOULD return a newInputRequiredResultasking again, not an error. - Every result now carries a required
resultType:"complete"or"input_required". Clients MUST treat results from earlier-protocol servers that omit the field as"complete"— this is the backward-compatibility hinge.
Cacheable lists and notifications
tools/list,prompts/list,resources/list,resources/read, andresources/templates/listresults MUST carryttlMs(freshness hint, milliseconds) andcacheScope("public"or"private"— whether shared intermediaries may cache) via theCacheableResultinterface (SEP-2549).- Return tools from
tools/listin deterministic order — it enables client-side caching and stable upstream LLM prompt-cache hits across reconnects. - The HTTP GET endpoint and
resources/subscribe/resources/unsubscribeare replaced bysubscriptions/listen: one long-lived POST-response stream, opted into per type (toolsListChanged,promptsListChanged,resourcesListChanged,resourceSubscriptions), with notifications taggedio.modelcontextprotocol/subscriptionId. Request-scopednotifications/progressandnotifications/messagestay on the originating request's response stream. ping,logging/setLevel, andnotifications/roots/list_changedare removed. Log level is set per-request viaio.modelcontextprotocol/logLevelin_meta; servers MUST NOT emitnotifications/messagefor requests that did not include it.- SSE resumability is removed (
Last-Event-ID, SSE event IDs). A broken response stream loses the in-flight request — re-issue it as a new request with a new request ID.
Authorization
- Prefer Client ID Metadata Documents (CIMD): the
client_idis an HTTPS URL with a path component (e.g.https://example.com/client.json) serving a JSON document with at leastclient_id,client_name,redirect_uris; the document'sclient_idMUST match the URL exactly. Authorization servers advertise support viaclient_id_metadata_document_supported: true. CIMD client IDs are portable across authorization servers — no re-registration when the AS changes. - Registration priority order: (1) pre-registered credentials, (2) CIMD if advertised, (3) Dynamic Client Registration as deprecated fallback, (4) prompt the user.
- If you must use DCR, set
application_typeexplicitly:"native"for desktop/CLI/localhost apps,"web"for remote browser apps. Omitting it defaults to"web"under OIDC and breakslocalhostredirect URIs. - Validate the RFC 9207
issparameter, when present, against the recorded issuer before redeeming any authorization code (SEP-2468). Key persisted credentials by issuer; MUST NOT reuse them with a different authorization server; MUST re-register when the AS changes (SEP-2352).
Extensions and deprecations
- Negotiate extensions through the new
extensionsfield onClientCapabilities/ServerCapabilities. Tasks moved from experimental core to theio.modelcontextprotocol/tasksextension: blockingtasks/result→ pollingtasks/get, newtasks/updatefor client-to-server input,tasks/listremoved, unsolicited task handles allowed (SEP-2663). Other notable extensions: MCP Apps (inline interactive UI), Skills over MCP (rich structured instructions for agent workflows), Enterprise Managed Authorization (EMA). - Roots, Sampling, and Logging are Deprecated (SEP-2577) with a minimum twelve-month window. Migrate: Roots → pass directories/files via tool parameters, resource URIs, or server configuration; Sampling → integrate directly with LLM provider APIs; Logging →
stderron stdio, or OpenTelemetry._metaOTel keys aretraceparent,tracestate,baggage. - HTTP+SSE transport is formally Deprecated with a year-long offramp — migrate to Streamable HTTP.
includeContextvalues"thisServer"/"allServers"are Deprecated — omit the field or use"none". - Error-code updates: resource-not-found moves -32002 → -32602 (Invalid Params); -32020..-32099 is reserved for the MCP spec (
HeaderMismatch-32020,MissingRequiredClientCapability-32021,UnsupportedProtocolVersion-32022); -32000..-32019 stays implementation-defined.
Checklist
Server
- Upgrade to a 2026-07-28-capable SDK (Tier 1: TypeScript, Python, Go, C#; Rust in beta).
- Delete session/handshake logic; read
io.modelcontextprotocol/protocolVersion+clientCapabilitiesfrom_meta; returnUnsupportedProtocolVersionError(-32022) on mismatch. - Implement
server/discover. - Convert every server-initiated
elicitation/create/sampling/createMessage/roots/listinto MRTR (InputRequiredResult+ integrity-protectedrequestState); only ontools/call,resources/read,prompts/get. - Add
resultTypeto all results; addttlMs+cacheScopeto the five cacheable list/read results; maketools/listorder deterministic. - Replace GET endpoint and
resources/subscribe/unsubscribewithsubscriptions/listen; droppingandlogging/setLevel; gatenotifications/messageon the request'sio.modelcontextprotocol/logLevel. - Move cross-call state into server-minted handles passed as tool arguments.
- Schedule removal of any Roots/Sampling/Logging usage within the twelve-month window.
Gateway / proxy / WAF
- Route, meter, rate-limit, and authorize on
Mcp-Method+Mcp-Name; stop parsing JSON bodies for routing. - Remove
Mcp-Session-Idsticky-session affinity; plain round-robin is now valid. - Cache only
cacheScope: "public"responses at shared intermediaries, withinttlMs. - Support long-lived POST response streams for
subscriptions/listen; dropLast-Event-IDreplay logic. - Pass through
Mcp-Param-*custom headers (mirrored fromx-mcp-header-annotated tool parameters).
Client
- Stamp every request:
MCP-Protocol-Version+Mcp-Methodheaders (plusMcp-Nameontools/call,resources/read,prompts/get);_metaprotocolVersion/clientCapabilities/clientInfo. - Handle
resultType: "input_required": fulfillinputRequests, echorequestStateexactly, retry with a NEW JSON-RPC id andinputResponses; treat a missingresultTypefrom older servers as"complete". - Declare only capabilities you actually handle — servers may not send undeclared
inputRequeststypes. - Cache list results per
ttlMs/cacheScope; opt into thesubscriptions/listennotification types you need. - On broken streams, re-issue the request with a new id — no resumption exists.
- Auth: host a CIMD document (HTTPS URL client_id, matching
client_idfield,client_name,redirect_uris); checkclient_id_metadata_document_supported; fall back to DCR with explicitapplication_type; validateiss; key credentials by issuer. - Do not add Roots/Sampling/Logging support in new code.
Anti-patterns
- Keeping
Mcp-Session-Id, sticky sessions, or theinitializehandshake — the transport no longer defines them. - Sending server-initiated
elicitation/create,sampling/createMessage, orroots/listrequests — no longer supported at all. - Inspecting, parsing, or mutating
requestStateon the client; accepting it on the server without integrity verification when it affects authorization or business logic. - Reusing the same JSON-RPC
idon an MRTR retry — initial request and retry are independent requests. - Relying on
Last-Event-ID/ SSE event-ID redelivery after a dropped stream. - Emitting
notifications/messagefor requests that did not setio.modelcontextprotocol/logLevel. - Varying list results per connection or returning tools in nondeterministic order — breaks client caches and prompt caching.
- New implementations adopting Roots, Sampling, Logging, DCR, HTTP+SSE, or
includeContext: "thisServer"/"allServers"— all Deprecated. - Reusing OAuth client credentials across different authorization servers instead of re-registering keyed by issuer.
Source
- MCP Specification 2026-07-28 (incl. changelog, MRTR pattern, client registration) — https://modelcontextprotocol.io/specification/2026-07-28 — 2026-07-28
- The 2026-07-28 Specification (maintainers deep-dive) — https://blog.modelcontextprotocol.io/posts/2026-07-28/ — 2026-07-28
Distilled from the official document(s) above on 2026-08-12. If this skill and the source disagree, trust the source.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

