Review the prerequisites
Suitable for: Backend developers learning Agent applications.
- Protocol era
- Legacy initialization/session semantics and modern per-request semantics are separate adapters.
- Unknown outcome
- A sent write lacks a verified final business result; cancellation or reconnection alone cannot resolve it.
- Task handle
- An opted-in Tasks extension identifier locates asynchronous work; creation still needs business deduplication.
How does the mechanism work?
Step-by-step explanation
- Select the era before recovering
2025-11-25 can use initialized sessions and optional replay; 2026-07-28 uses per-request metadata and has no Last-Event-ID replay.
- Cancellation cannot undo commit
Modern HTTP SSE close cancels the request, but an already committed action still needs receipt reconciliation.
- Extensions have their own contracts
Tasks is opt-in; core stateless capability declarations do not erase extension lifecycle requirements.
Design · Explain the trade-offs
Design a compatible and secure migration
Objectives of this level: Plan dual-era routing, extension support, authorization and rollback evidence.
Visual guide · Three identities, three jobs
Optional transport resumption restores messages only. An unknown sent write still needs same-operation reconciliation; a new session cannot prove noncommit. Select the figure to open it at full size.
Migrate by adapter, not by rewriting operation history
Inventory clients as legacy-only, modern-only or dual-era, and servers likewise. A legacy-only client cannot fall forward when a modern-only server rejects initialize. Keep a reviewed legacy adapter or an explicitly routed compatibility endpoint during rollout. Never infer a client's era from a tool description or clientInfo: these are self-reported data. Pin adapter and extension versions alongside the server build.
Modern state model
Store protocol era/version, authenticated principal, scope, server configuration revision and permitted extensions. Include required _meta on each request; HTTP mirrors include MCP-Protocol-Version, Mcp-Method, and Mcp-Name for tools/call, prompts/get or resources/read. Validate headers against the body. Re-establish subscriptions/listen after loss; do not send GET + Last-Event-ID to resume modern results. Explicit server-minted handles can carry cross-call application state, with authorization and expiry enforced server-side.
Dispatch resultType deliberately: complete reaches outcome handling; input_required follows MRTR on supported methods; task is accepted only when the Tasks extension was opted into and supported. MRTR retries the original method with matching inputResponses and the exact opaque requestState if provided, using a different JSON-RPC id. Protect state integrity and bind it to principal, expiry and original parameter digest; enforce single-use separately when the business requires it. Core's lack of initialize is not a claim that every extension has no handshake or lifecycle: implement each adopted extension's documented rules.
Security does not reset on reconnect
For protected HTTP, obtain resource metadata through a validated discovery path; bind OAuth requests to the target MCP resource, validate tokens for that resource and keep downstream credentials separate. Bind the authorization response to the recorded issuer and PKCE/state record; when iss is required by the advertised metadata, its absence must fail. If iss is present, compare exactly even when support was not advertised. Do not turn a rejected issuer or scope into a protocol downgrade. Task handles and requestState are not authorization by themselves.
Release and rollback gate
Run the full 3×3 era matrix plus negative controls for missing _meta, header mismatch, unsupported versions, unauthorized handles and unavailable extensions. Keep unknown writes in the same operation ledger through rollout and rollback. Route new requests to the previous compatible adapter only after verifying identity and policy mappings; polling an existing task must keep its original authorized task service. Compare effect counts, not just 2xx responses. Record failed and successful probes, redacted wire captures, build hashes and rollback decisions.
Read the accompanying migration tutorial for before/after wire examples. This layer is a design and acceptance plan. The local legacy fixture cannot certify conformance, authentication, failover or exactly-once effects for a deployed service.
code example
Modern discovery request before rollout
Protocol illustration only: no endpoint was called. Inspect resultType, supportedVersions and advertised extensions; authenticate the server independently of self-reported identity.
{
"jsonrpc": "2.0",
"id": "probe-1",
"method": "server/discover",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {
"name": "field-notes-client",
"version": "2.0.0"
},
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}
Acceptance task for this level
Produce a dual-era migration plan with the 3×3 client/server matrix, authorization negative controls, task-handle retention and a rollback path preserving unknown operations.
Reading this browser’s record…
Hide the answer and check your understanding
Should HTTP 400 always trigger initialize fallback?
Expand reference derivation
No. Inspect recognized modern errors and correct their version/metadata first; only the documented dual-era legacy detection path may fall back.
Further explanations and practice
When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.
All linked explanations and exercises (1 )
Sources and verification scope
The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.
- MCP 2025-11-25: Transport, recovery flows and sessions
- AWS:Retry with backoff
- Public fixed function contract
- Shared function runner
- Source-only practice package
- MCP 2026-07-28: changes from the legacy revision
- MCP 2026-07-28: versioning and compatibility
- MCP 2026-07-28: Streamable HTTP binding
- MCP 2026-07-28: stdio binding
- MCP 2026-07-28: metadata and result types
- MCP 2026-07-28: server discovery
- MCP 2026-07-28: multi round-trip requests
- MCP Tasks extension: handles, polling and input
- MCP 2026-07-28: HTTP authorization
- MCP 2026-07-28: security best practices
- MCP 2026-07-28: request cancellation
- MCP 2026-07-28: tool contracts and annotations