Skip to content
Agent Field Notes
Course contentsExpand a topic to choose a lesson.

SYSTEMATIC LEARNING / FOUR-LEVEL COURSE

MCP reconnection across protocol versions and business outcomes

Compare MCP 2025-11-25 and 2026-07-28; preserve the legacy fixture while designing stateless requests, task handles and safe write reconciliation.

Learning objectives: Choose recovery from a pinned protocol version and trusted send/outcome evidence. Keep cancellation, request correlation and delivery separate from durable business idempotency.

Content checked: 2026-10-30 · Each level has independent explanations, tasks and inspections

Choose a starting point based on your familiarity with this topic. Current level: Foundation · Understand the concepts. After completing the task, continue to the next level. Reading and self-checks alone do not establish mastery.

On this level

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
  1. 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.

  2. Cancellation cannot undo commit

    Modern HTTP SSE close cancels the request, but an already committed action still needs receipt reconciliation.

  3. Extensions have their own contracts

    Tasks is opt-in; core stateless capability declarations do not erase extension lifecycle requirements.

Foundation · Understand the concepts

Derive a versioned recovery model

Objectives of this level: Separate transport-era behavior, request identity and business truth.

Visual guide · Three identities, three jobs

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.

One refund, two independent state machines

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.

Name the protocol revision before reasoning

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.

Cancellation is version-specific

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.

Four identities with different jobs

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.

code example

A committed refund survives connection replacement

Reason about the two possible histories: the refund committed before response loss, or the request never arrived. The observable disconnect is compatible with both. Query the same operation_id; do not create another refund.

Acceptance task for this level

Draw legacy and modern recovery timelines for a refund that commits just before response loss. Label protocol cancellation separately from business rollback.

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

Does stateless MCP make an unknown refund safe to repeat?

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.