Understand first
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Understand → Implement → Debug → Design
Compare legacy sessions/replay with modern stateless requests, cancellation, MRTR and optional Tasks without duplicating a committed write.
Knowledge content check2026-10-30 · Check the source of the original question2026-10-30
It is recommended to understand first:
Tool contracts: from a valid request to an authorized business effect →Idempotency, unknown outcomes, and task recovery →Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Prepare to write the principles into code
Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.
Reading implementation and trade-offs →Need to handle failures and changes in conditions
Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.
Continue to delve deeper into the problem →Need to design or review plans
Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.
Analyze engineering scenarios →LEARN · PRACTICE · REFLECT
First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.
Can be practiced directly. After logging in, answers, favorites, and notes will be saved to your account.
Log in and saveEach modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.
Core concept · Versioned transport recovery and business reconciliation
Preparatory concepts:Version-pinned JSON-RPC and transport semantics, Trusted operation ledger and downstream idempotency, HTTP authorization and asynchronous task handles
Pin the revision first. MCP 2025-11-25 may recover an originating SSE stream by Last-Event-ID and reinitialize an expired session. MCP 2026-07-28 has no core initialize/session or event replay: attach per-request _meta, discover/validate capabilities, and use an opted-in Tasks handle when available. Closing modern HTTP SSE signals cancellation, not rollback. A lost write still needs its original business operation key and verified receipt; a new RPC id is only correlation.
Reconnect or replay messages before reconciling business state. A new protocol request ID cannot deduplicate an external effect. Select the figure to open it at full size.
A successful discovery probe establishes protocol compatibility, not business success. Legacy event replay restores deliveries; modern requests carry their capabilities every time. Neither guarantees that a new write is harmless.
Persist sent/unknown/confirmed business state separately from cancellation_requested and protocol era. A task handle points at work, while the business key and executor ledger prevent repeated creation.
A safe client retries supported protocol errors only after correcting them, routes legacy traffic through its pinned adapter, and queries receipts for ambiguous writes. Core statelessness does not remove an adopted extension's own lifecycle or handshake requirements.
Pin the revision first. MCP 2025-11-25 may recover an originating SSE stream by Last-Event-ID and reinitialize an expired session. MCP 2026-07-28 has no core initialize/session or event replay: attach per-request _meta, discover/validate capabilities, and use an opted-in Tasks handle when available. Closing modern HTTP SSE signals cancellation, not rollback. A lost write still needs its original business operation key and verified receipt; a new RPC id is only correlation.
Suppose refund-7 committed remotely and its response never reached the client. A working connection answers “can messages travel now?”; an operation receipt answers “did this refund commit?” Neither a new socket nor a new JSON-RPC id answers the second question. Persist the tenant, operation_id, argument digest and outcome independently of the protocol adapter.
For this lesson, legacy means 2025-11-25, and modern means 2026-07-28. Legacy initialization can establish an HTTP session; optional event replay uses the originating stream's Last-Event-ID. Modern core removes initialize/initialized, protocol session IDs and Last-Event-ID replay. Each request declares its version and client capabilities in params._meta. server/discover is required on modern servers and optional for modern clients; a dual-era stdio client should probe before any ambiguous business call.
Stateless protocol does not mean stateless business. A task handle, protected requestState or operation ledger can outlive a connection. Tool lists may depend on the authorization supplied on each request, but must not vary because a socket previously called another method. Cache authorization-sensitive discovery separately by principal and scope.
Legacy disconnection does not itself cancel a request. In modern Streamable HTTP, closing that request's SSE response stream is its cancellation signal; the server must treat it as cancelled and should stop practical remaining work. Cancellation is not rollback: a refund already committed remains a business fact. Do not generalize “disconnect never cancels” across revisions, or “cancelled means no effect” across business tools.
JSON-RPC id correlates a request and response. A legacy session ID identifies legacy protocol state. An event cursor locates optional legacy delivery history. An application operation_id identifies one logical refund and requires downstream enforcement to prevent duplicates. Modern Tasks adds a fifth identity, taskId, which locates asynchronous work; it does not deduplicate creating that work.
The existing Python exercise deliberately retains the legacy teaching contract. It models a decision from trusted facts, not either revision's transport implementation. The next layer gives its exact reproduction entry; the later layers analyze failures and migration.
Persist the original operation before send. Probe era with a safe discovery request, never a write. In modern HTTP distinguish UnsupportedProtocolVersionError, missing capability and HeaderMismatch from legacy detection; 401/403 or a network timeout are not permission to downgrade. Parse resultType before accepting completion. MRTR input_required retries the same method with matched inputResponses and exact opaque requestState under a new JSON-RPC id; enforce bounded rounds and trusted user-input policy. A task result requires mutual Tasks support and polling the authorized taskId, not reissuing task creation.
If the write may have reached execution, query its authorized business receipt. Retry only with proven non-execution or actual downstream idempotency support under the same key and parameter digest; otherwise leave unknown and escalate for reconciliation. The linked stdlib fixture retains 13 legacy-style decisions and does not run a modern server. Wire examples and proposed fault tests in the migration article are unexecuted protocol illustrations.
Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.
Level 1Can closing modern SSE prove no refund happened?
Forces the candidate to replace an unversioned slogan with two precise transport rules.
No. In 2026-07-28 it is request cancellation, but a prior durable commit may already exist. Persist cancellation_requested separately and reconcile refund-7 through an authorized receipt. In 2025-11-25 a disconnect alone is not cancellation.
Follow this answer further
Level 2The cancellation arrived after commit. What should the user see?
Cancellation and completion can race without sharing one terminal state.
Show the verified business outcome if the receipt confirms completion; otherwise show unknown or reconciliation pending. Do not overwrite a confirmed commit with “cancelled” merely because the UI stopped waiting. Keep causally ordered protocol and business events.
Follow this answer further
Level 3The client also crashed before saving its receipt. What resolves recovery?
Tests durable evidence beyond a running client process.
Read the durable operation ledger with the same authenticated principal, operation key and parameter digest. If there is no trustworthy query or enforced idempotency, retain ambiguity; neither a replayed event nor a new task can manufacture proof of non-execution.
Level 1How do safe probes avoid a harmful fallback?
Compatibility and security need explicit, independent branches.
Use server/discover before a business call on dual-era stdio; recognize modern errors even if discovery fails. HTTP 400 requires inspecting the body. UnsupportedProtocolVersionError stays modern and selects a supported revision. Do not treat 401/403 or lost responses as evidence that authorization can be weakened.
Level 1What if the task creation response lost the taskId?
Moves recovery from message replay to asynchronous business identity.
A server may have durably created work before its reply was lost. A known handle can be polled; an unknown handle requires reconciliation by the original business key or controlled human handling. Recreating the task under a new RPC id does not deduplicate it. Expiry is not proof of no effect.
First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.
Changing conditions:2025-11-25 session returns 404
Extended question:Can the earlier refund be discarded?
No. Reinitialize the legacy protocol adapter if needed, but keep the operation ledger and authorized receipt query. A session lifetime is shorter than external business history. Do not use this rule to add sessions to the modern adapter.
The principles that remain unchanged:Replacing a protocol context cannot erase business effects.
Changing conditions:A modern server and client both opt into Tasks
Extended question:How does recovery differ from event replay?
Poll the same taskId through tasks/get and fulfill input_required via tasks/update when authorized. Follow the extension's TTL and cancellation semantics. Tasks cancellation is cooperative; a request-stream close must not be confused with cancelling the separate durable task.
The principles that remain unchanged:A durable work handle changes recovery mechanics, not business authorization or deduplication.
Original engineering interview design based on version-pinned public specifications reviewed 2026-10-30. Scenarios, scoring and proposed experiments are authored teaching material; no modern MCP interoperability or live business effects were measured. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.
After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.
Draw both-era recovery for a committed refund with lost response. Annotate a modern discovery request, an input_required retry and a lost task creation response; list fault tests without presenting proposed results as measured.