MCP: building servers and clients, transports, auth and security

Reading: 37 min, plus 14 in closed details. Data as of November 2026 (specification revision 2026-07-28, still the latest stable revision on 16 November 2026); every exchange shown was recorded on one laptop with the official Python SDK on 5 October 2026, and no model was called. Child of Topic: protocols.

The idea in one screen

MCP is a small JSON-RPC contract between an AI application (the host) and the programs that give it tools and data (servers): the model never speaks it, the host translates and decides, and since revision 2026-07-28 every request carries everything about itself, so a remote server is an ordinary stateless web service protected as an OAuth resource server.

Fig. 1 · The model sees tool definitions; the host runs one client per server and holds the policy

  1. Three roles. The host owns the conversation with the model, decides which servers to start and which tools the model may see, and asks the user for consent. A client inside it speaks MCP to exactly one server. A server sees only the requests sent to it, never the conversation and never other servers. The model API has its own tool format and never speaks MCP.
  2. tools/list. The client asks each server for its tools (tools/list); the host copies each tool's name, description and inputSchema into the model request's tool list. ckpt-tools' answer for its three tools is 1,818 bytes.
  3. The model asks. The model answers with a tool call in the model API's own format, for example list_checkpoints({"run": "llama-7b-sft"}).
  4. Policy, then tools/call. The host checks its policy (is this tool allowed? does the user need to confirm?), then its client sends tools/call to the right server; only that server sees it.
  5. The result becomes model input. The server runs the function; the host puts the result's text into the next model request as a tool result, and the model continues.
  6. Two kinds of credentials. The local server is a child process on stdio: it runs with the user's rights and reads credentials from the environment. The remote server is an OAuth resource server: it accepts only a token issued for it (aud = this server) by its authorization server (section 7).

The running example, ckpt-tools, is a server an ML team might run so an agent can list, evaluate and delete training checkpoints (its checkpoint table is illustrative; nothing is deleted). The size of its tool list is measured (stdio recording, 5 October 2026); the rest is the structure the specification defines. Steps 2 to 5 are one tool call (section 1).

You need HTTP requests, status codes and proxies (HTTP), server-sent events (Streaming and real-time) and OAuth 2.1 with PKCE (Auth), only for sections 4 and 7. Labels: measured means recorded on this page's laptop (Apple M1 Pro, macOS 27, Python 3.13, official Python SDK mcp 2.3.0, and 1.30.0 for the legacy side) on 5 October 2026, scripts in src/lab/; all servers ran on 127.0.0.1 and no model was called, so wherever a model or a user would decide something, the decision is scripted and labelled.

Host, client, server
the application the user runs; its component that speaks MCP to exactly one server; the program that offers capabilities
Tools, resources, prompts
the three server primitives, told apart by who decides to use them: the model, the application, the user
Legacy, modern era
revisions with a handshake and sessions (2025-11-25 and earlier) against revisions with per-request metadata (2026-07-28 on)
MRTR, requestState
multi round-trip requests: the server answers "input required" and the client retries the same request with the answers; the opaque, server-sealed state that rides along
Protected resource metadata, CIMD
the document an MCP server publishes naming its authorization server (RFC 9728); a client ID that is an HTTPS URL describing the client (Client ID Metadata Document)

Not here: Claude Code's MCP configuration (scopes, .mcp.json, mcp__ rules, tool search, output caps) is on Claude Code, section 10; prompt injection, the lethal trifecta and the agent-side supply chain (pinning and hashing approved tools) on Agent security; OAuth itself on Auth; SSE and streaming through proxies on Streaming and real-time; agent-to-agent delegation (A2A) on Agent-to-agent and beyond, whose section 10 runs the same evaluation job over MCP and over A2A side by side; an MCP server and client in TypeScript under 2025-11-25 on TypeScript: LLM apps and agents, section 8; the overview and one recorded tool call that carries an injected instruction on the root page, section 10.

MCP in one screen (eight questions, short answers, where each is taught)
QuestionShort answerSection
What does the model actually see?Never MCP. The host turns MCP tool definitions into the model API's tool list, and tool results into tool-result blocks.1
What travels?JSON-RPC requests, results, errors and notifications; since 2026-07-28 every request carries its protocol version and the client's capabilities in _meta.2
Local or remote?stdio for a server on your machine (no network, credentials from the environment); Streamable HTTP for a shared remote server (OAuth, load balancers, gateways).4
Why the 2026 redesign?Sessions pinned a client to one replica. Measured here: a round-robin balancer in front of two replicas broke 20 of 20 old-style calls and 0 of 20 new-style calls, once the replicas shared the key that seals request state.5
Will old and new interoperate?A dual-era client talks to anything; a modern-only client cannot talk to a legacy server and a legacy client cannot talk to a modern-only one. All 9 pairings were run.6
How is a remote server protected?A 401 points the client to the server's metadata, then to its authorization server; authorization code with PKCE; a token bound to that one server (RFC 8707); never passed through.7
What is the real risk?Text from tools is untrusted input in the model's context; servers are code you run; descriptions and annotations are claims, not guarantees.8
How do I build one?Python SDK 2.3.0: decorate typed functions; test in process; serve stdio first; add Streamable HTTP, auth and a shared state key to deploy.9, 10

1. Roles, and where MCP sits in an agent loop

The problem. A model only produces text; to list your checkpoints or open a pull request, the application around it must call real code. Before MCP every application wired every integration itself: N applications and M tools meant N × M adapters. MCP makes it N + M: write a server once, and every MCP host can use it. Anthropic released it on 25 November 2024 and donated it on 9 December 2025 to the Agentic AI Foundation, a fund under the Linux Foundation co-founded with Block and OpenAI (Anthropic), which by October 2026 also held A2A, AGENTS.md and Agent Skills among ten projects (the foundation's map: Agent-to-agent and beyond).

Three roles, as in Fig. 1. The specification puts security policy in the host: "Enforces security policies and consent requirements" (architecture). A host with five servers runs five clients; a server (ckpt-tools, a GitHub server, a database server) never sees the others.

The model does not speak MCP. Model APIs have their own tool-calling format (a list of tool definitions in the request, tool_use blocks in the answer), and the host translates both ways: Fig. 1, steps 2 to 5, is one tool call.

So everything a server returns ends up in the model's context, and everything in a tool's description shapes what the model does. Both facts drive section 8.

What MCP costs, and when not to use it
It adds a process or a network hop, a JSON layer and a dependency on host support. If one application calls one internal API, ordinary function calling with the model API's own tool format is simpler. MCP pays off when several hosts (an IDE, a CLI agent, a chat app) must reach the same tools, when a team wants to publish tools once, or when tools must run with credentials or isolation the host should not hold.
The larger cost is tokens, and it is set by definitions and results, not by the protocol. Every tool definition a host loads rides in every request, and a tool result enters the context whole; a server that exposes dozens of tools, or returns a whole API response, can cost more context than the task. Scope a server to the tools the task needs, cap or trim results on the server, and when the agent has a shell and a CLI exists, the CLI is usually cheaper. Deferred loading (tool search) removes most of the definitions' up-front cost but leaves results untouched.
Measured: input tokens per task through a CLI, a skill and MCP (OpenRouter, 11 November 2026)

One task (the latest release of cli/cli plus its three newest open bug issues), input tokens per task on Sonnet 5.5: CLI 1,421; skill 3,315; MCP with 2 tools 23,228; MCP with the server's 46 default tools 59,417; all 91 tools 101,351; 2 tools with results capped at 4,000 characters 5,357. The 46 default definitions alone add 19,436 tokens per request on Haiku 5.5, yet one get_latest_release result (42,182 characters, about 20,400 tokens) was larger than all of them. Tool search (defer_loading: true plus a search tool) cut the up-front cost to 578 tokens and halved Sonnet's task total, did not shrink results, and made Haiku worse (retries on invalid arguments). OpenRouter's advice: a CLI when one exists, a CLI plus a skill for consistency, a scoped MCP server when there is no shell or you need its auth. One task, one server, OpenRouter's own runs (OpenRouter).

2. The messages: JSON-RPC 2.0 with an MCP envelope

JSON-RPC 2.0 (specification) gives MCP three message kinds (MCP basic protocol): a request (id, method, params; MCP forbids a null id and reusing an id that is still waiting for its answer), a response with the same id and either a result or an error (code, message, optional data), which is how a client matches answers when several are in flight on one pipe, and a notification with no id and no answer (progress, change notices, cancellation on stdio). Since 2026-07-28 only the client sends requests: when a server needs something from the client, it says so inside its result and the client asks again (section 5).

Fig. 2 · One stdio conversation with ckpt-tools, message by message

  1. Probe: server/discover. The dual-era client asks first (id 1, 246 bytes); the answer (429 bytes) lists supportedVersions ["2026-07-28"], capabilities and identity, marked cacheScope: "private", so the client may cache it. Optional for clients; servers MUST implement it.
  2. A self-contained request. tools/call, id 2, 302 bytes: the tool name, its arguments and _meta with the protocol version, clientInfo and clientCapabilities. The tinted 183 bytes are what this request carries that the legacy call does not.
  3. The response carries the same id. A result with id 2 (817 bytes), with resultType: "complete" and serverInfo in its _meta. The id is how a client matches answers when several requests are in flight on one pipe.
  4. Every request stands alone. tools/list (id 3, 241 bytes) repeats the _meta; its answer (1,819 bytes with the newline) carries cacheScope: "public". Nothing either side does depends on an earlier message.

measured stdio lines of the cold runs (first call of each client; sizes include the newline). The warm calls of the next figure have longer ids, so their requests are 2 bytes longer.

The four MCP additions to plain JSON-RPC, all visible in the recorded lines beside:

  • _meta on every request. io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities are required; clientInfo is recommended. A request missing a required field is rejected with -32602 (on HTTP, status 400).
  • resultType on every result: "complete", or "input_required" when the server needs more input. A client must treat a missing resultType (an older server) as complete.
  • serverInfo in the result's _meta, so a client can tell who answered without remembering a handshake. Both clientInfo and serverInfo are self-reported: the specification says not to base security decisions on them.
  • Trace context: traceparent, tracestate and baggage may ride in _meta (W3C formats), so one trace can follow a request from the model call through the host into the server.

The same tools/call, before and after 2026-07-28: the envelope is now on every request

2025-11-25 (after a handshake)
2026-07-28 (self-contained)

measured stdio lines, newline included. The same tools/call line is 304 bytes under 2026-07-28 and 121 bytes under 2025-11-25: 183 bytes of _meta (highlighted) that every request now repeats instead of saying once at the start of a session. The result grows by 111 bytes (819 against 708) for resultType and serverInfo. On a local pipe this is noise; across millions of calls through a gateway it is the price of letting any replica answer any request.

Three kinds of failure, and who should see each

KindShapeExample (measured)Who acts on it
JSON-RPC protocol errorerror with a standard code: -32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internaltools/teleport gave 404 and -32601The developer. A model can rarely fix these.
MCP protocol errorerror with a code from -32020 to -32099, the sub-range MCP reserves: -32020 HeaderMismatch, -32021 MissingRequiredClientCapability, -32022 UnsupportedProtocolVersionAsking for version 1900-01-01 gave 400 and -32022 with "supported":["2026-07-28"]The client library: retry with a supported version, fix the headers
Tool execution errorA normal result with isError: true and text explaining what went wrongA number where the schema wants a string gave 200 and isError: true with the validation messageThe model. The specification says clients SHOULD pass these to the model "to enable self-correction"
Predict: the model calls a tool name that does not exist (rm_rf). The specification lists "Unknown tool" under protocol errors, with code -32602. What does the Python SDK 2.3.0 server send?
Reserved names and the error codes that changed in 2026-07-28

Names under the io.modelcontextprotocol/ prefix (and any prefix whose second label is modelcontextprotocol or mcp) are reserved for the protocol. The old "resource not found" code -32002 became -32602, and -32042 (URL elicitation required, 2025-11-25 only) is retired; clients should still accept -32002 from older servers. Codes -32000 to -32019 are legacy, implementation-defined (error codes).

3. What a server offers, and what the client offers back

The three server primitives differ by who decides to use them, which is the single most useful way to remember them (server features):

PrimitiveControlled byMethodsckpt-tools example
ToolsThe model: it decides to call themtools/list, tools/calllist_checkpoints, evaluate_checkpoint, delete_checkpoint
ResourcesThe application: it decides what to read into context (a file picker, an attachment)resources/list, resources/templates/list, resources/readckpt://{run}/config, the run's YAML config
PromptsThe user: picked explicitly, often as a slash commandprompts/list, prompts/getpick_best(run)

The definition. A tool has a name, an optional display title, a description written for the model, an inputSchema (JSON Schema, 2020-12 by default) and optionally an outputSchema and annotations. In the Python SDK the type hints are the schema: def list_checkpoints(run: str) -> list[Checkpoint] produced this input schema and a matching output schema with the four Checkpoint fields:

{"type":"object","properties":{"run":{"title":"Run","type":"string"}},"required":["run"],"title":"list_checkpointsArguments"}

Two copies of every structured result. With an output schema, the result carries structuredContent (JSON a program can use) and, for backward compatibility, the same data as text in content, which is what most hosts show the model. For three checkpoints the SDK sent three pretty-printed text blocks plus the structured copy: 818 bytes of result body for about 200 bytes of facts (measured). Every byte of content becomes model input tokens, so return short, task-shaped results and paginate.

Annotations are claims, not guarantees. readOnlyHint, destructiveHint, idempotentHint and openWorldHint (talks to the outside world) tell a host how careful to be: ckpt-tools marks delete_checkpoint destructive and idempotent. The specification is blunt: "clients MUST consider tool annotations to be untrusted unless they come from trusted servers". A malicious server can mark a destructive tool read-only.

Names collide across servers. Tool names are only unique within one server (SHOULD be 1 to 128 characters of letters, digits, _ - .). Two servers that both offer search must be told apart by the host, for example by prefixing a server identifier; serverInfo.name is not unique and should not be used for this. And servers SHOULD return tools/list in a deterministic order, because hosts paste the list into the model request, and a reordered list breaks the model provider's prompt cache.

A tool is text the model reads and a result that becomes model input

ckpt-tools' delete_checkpoint and list_checkpoints, from src/lab/ckpt_server.py; result sizes measured. Field names are the specification's (tools).

State without sessions. A shopping cart, an open browser or a database transaction spans several calls. With no session, the server returns an explicit handle (basket_id: "bsk_a1b2c3") and takes it back as an ordinary argument; the model carries it forward. A handle is a name, not a password: check on every call that it belongs to the caller, make it random, state its lifetime in the tool description, and return a clear tool error when it has expired so the model can start again (stateful tools).

What the client offers the server

FeatureWhat it doesStatus in 2026-07-28
Elicitation (added 2025-06-18)The server asks the user for structured input mid-operation: a confirmation, a form; URL mode (added 2025-11-25) sends the user to a web page, for example to sign in to a third partyActive, now delivered through multi round-trip requests (section 5)
SamplingThe server asks the host's model for a completion, so a server can be "agentic" without its own model keyDeprecated; migrate by calling a model API directly
RootsThe client tells the server which directories or URIs it may work inDeprecated; pass paths as tool arguments, resource URIs or configuration

Deprecated features keep working for at least twelve months: the earliest removal is "first revision released on or after 2027-07-28" (deprecated features registry).

Utilities

  • Progress: a request that carries a progressToken in _meta may receive notifications/progress before its result; ckpt-tools' evaluate_checkpoint sent three, which turned its HTTP reply into an event stream (section 4).
  • Cancellation: on stdio the client sends notifications/cancelled with the request id; on Streamable HTTP it simply closes that request's response stream. Either way the server must stop sending anything for that request.
  • Caching (new): list and read results carry ttlMs (how long the answer stays fresh) and cacheScope ("public": shareable by intermediaries; "private": only within the caller's authorization). ckpt-tools sends ttlMs: 300000, cacheScope: "public" on tools/list.
  • Subscriptions (new): one long-lived subscriptions/listen request whose response stream delivers only the change notices the client opted into (toolsListChanged, resourceSubscriptions, ...). It replaced the old HTTP GET stream and resources/subscribe.
Smaller utilities: pagination, completion, logging
  • Pagination: list results may carry nextCursor; the client sends it back as cursor.
  • Completion: argument autocompletion for prompts and resource templates.
  • Logging: notifications/message, deprecated; log to stderr (stdio) or use OpenTelemetry.

4. The two transports

A transport (the specification also says binding) defines how messages are framed and delivered, how cancellation is signalled, and where request metadata lives. It never changes what the messages mean (transports).

Predict: ckpt-tools runs with the SDK's default settings (it may stream). A plain list_checkpoints call arrives. JSON or an event stream?

Fig. 3 · stdio is two pipes to a child process; Streamable HTTP is one POST per message, with headers a gateway can read

  1. stdio: a child process. The host starts the server as a subprocess: no port, no network. Starting it is most of the cold time, 380 ms from opening the client to the first result, mostly a Python process importing the SDK.
  2. Two pipes, one line per message. Requests go down stdin and responses come back on stdout, one JSON-RPC message per line; logs go to stderr, because stdout carries only MCP. Warm, a call took 0.87 ms (median of 300).
  3. Streamable HTTP: one POST per message. The client POSTs every message to one URL; the headers mirror the body (Mcp-Method: tools/call, Mcp-Name: list_checkpoints), so a gateway can route or block by tool without parsing JSON. This plain call came back as one JSON object: 1.52 ms warm median.
  4. An event stream only when there is something to stream. evaluate_checkpoint asked for progress, so its reply became text/event-stream: three notifications/progress events (shard 1 of 3, 2 of 3, 3 of 3), then the result, all on that one request's stream.
  5. Hostile requests stop at the door. Sent to ckpt-tools with the SDK's defaults: a foreign Origin got 403, a rebinding Host 421, and an Mcp-Name that disagrees with the body 400 with -32020 (every case in the table below).
  6. Measured side by side. Warm medians: stdio 0.87 ms (legacy 0.80); Streamable HTTP 1.52 ms, 1.97 with json_response, 2.48 ms for the legacy session mode. All far below a model call: choose by deployment, not speed.

measured 5 October 2026, src/lab/transports.py and wire_checks.py: SDK 2.3.0 on loopback, one laptop; the gateway is drawn to show what reads the headers (none ran in these timings).

stdio: a child process and two pipes

Fig. 3, steps 1 and 2. Messages must not contain raw newlines (JSON escapes them as \n). There is no authentication: the server runs as the user, with the environment the host gives it, which is also where its credentials come from (the authorization framework explicitly does not apply to stdio, stdio).

  • stdout is the protocol channel. The server "MUST NOT write anything to its stdout that is not a valid MCP message"; logs go to stderr. One stray print() corrupts the stream: the root page's Failure lab case "MCP over stdio: stdout pollution" shows a debug print glued to a response, which the client then dropped and timed out on.
  • Shutdown: the client closes the server's stdin, waits, then sends SIGTERM and finally SIGKILL; a server should exit when stdin reaches end of file. Crash: the client restarts the process; because the protocol is stateless, in-flight requests are simply lost and can be retried.
  • The same newline-delimited framing is recommended for custom transports over Unix sockets or TCP.

Streamable HTTP: one POST per message

The server exposes one URL, the MCP endpoint (for example https://mcp.example.com/mcp). Every client message is its own HTTP POST with Accept: application/json, text/event-stream. The server answers each request either with one JSON object or with a server-sent events (SSE) stream scoped to that request, carrying progress notifications and then the final response (Streamable HTTP).

Headers that mirror the body. Every POST carries MCP-Protocol-Version, Mcp-Method and, for tools/call, resources/read and prompts/get, Mcp-Name, so an ordinary load balancer, gateway or firewall can route, rate-limit or block by tool without parsing JSON. A tool may also ask for an argument to be copied into a header with x-mcp-header (for example a region, so a gateway can route to the right cluster); sensitive values must not be marked this way, since intermediaries see headers. Because two components could disagree about which copy is true (a gateway allows by header, the server executes by body), servers MUST reject a mismatch with 400 and -32020 HeaderMismatch.

Hostile input, tested. Each row was sent to ckpt-tools (SDK 2.3.0, default settings) with httpx (measured):

Three rows deserve a word. The Origin check stops a web page you happen to visit from calling a server on your laptop: browsers attach Origin to cross-site requests, and the specification requires a 403 for an invalid one. The Host check (421 Misdirected Request) stops DNS rebinding, where an attacker's domain is made to resolve to 127.0.0.1 after the page loads (DNS explains the trick); local servers should also bind to 127.0.0.1, not 0.0.0.0. And a header that names an older protocol version was not treated as a header mismatch: this dual-era server took it as a legacy request and asked for a session ID, so intermediaries that route on headers should reject versions older than 2026-07-28, as the specification advises, rather than trust unvalidated headers.

Behind a proxy. Servers SHOULD send X-Accel-Buffering: no on event streams so nginx-style proxies pass events immediately. Long-lived streams (subscriptions/listen) should send a comment line : now and then so idle timeouts do not cut them. Streams are not resumable any more: Last-Event-ID was removed, and a broken stream loses its request, which the client re-sends with a new id.

Measured: the same call over each transport

Cold: from opening the client to the first result, median of 7 (stdio includes starting a Python process that imports the SDK, which is most of the 360 to 380 ms). Warm: median and 90th percentile of 300 calls on an open client. Bytes: one warm call on the wire including HTTP headers (TCP tap) or the pipe lines (tee). Loopback on one laptop shared with other jobs: two runs of identical settings differed by up to 0.5 ms, so read only differences larger than that.

On one machine every transport answers in one to three milliseconds, far below a model call's hundreds of milliseconds, so transport choice is about deployment, not speed. stdio's cost is the process start (and a process per user per server); HTTP's is the network, TLS and authorization you must add to leave the laptop. The legacy session mode pays an extra round trip at the start (initialize, then the initialized notice, then the GET stream) and SSE framing on every reply.

Choosing
stdio when the server works on the user's own files and accounts (a code editor's tools, a local database) and should run with exactly the user's rights. Streamable HTTP when many users or agents share one server, when the data lives in a service, or when credentials must stay off the user's machine. The deprecated 2024-11-05 HTTP+SSE transport (two endpoints: a GET stream and a POST URL) should not be used for anything new.
Recorded wire: the progress stream, each transport's opening messages, every hostile request in full
evaluate_checkpoint with a progressToken: the response stream (measured; chunk sizes in hex are HTTP/1.1 chunked encoding)

How each transport opens a conversation: a client pinned to 2026-07-28 sends the tool call straight away; the dual-era client asks server/discover first; the legacy client needs initialize and notifications/initialized before any work.

Each hostile or malformed request, headers and reply as recorded:


5. The stateless revision (2026-07-28)

Before. From 2024-11-05 to 2025-11-25 a connection began with a handshake: the client sent initialize with its version and capabilities, the server answered with its own, the client sent notifications/initialized, and only then could work start. Over HTTP the server minted an Mcp-Session-Id that the client sent on every later request, opened a GET stream for messages the server wanted to push, and ended the session with DELETE. A server could also send its own requests to the client (a confirmation, a model completion) on an open stream, and wait.

The problem. A session is memory inside one server process. Behind an ordinary round-robin load balancer the second request of a session lands on a replica that never saw the first, so you need sticky routing (the balancer pins each session to a replica) or a shared session store, and a server that pauses mid-call waiting for the client holds that memory open even longer.

After. The 2026-07-28 revision (changelog) removed the handshake, the session, the GET stream, ping, logging/setLevel and server-initiated requests. Every request says everything about itself in _meta. A client that wants to know a server up front may call server/discover (servers MUST implement it), which returns supported versions, capabilities and identity, and is cacheable.

Multi round-trip requests: asking the user without holding a session

The replacement for server-initiated requests is MRTR (multi round-trip requests). The server answers the original request with resultType: "input_required", a map of inputRequests (an elicitation, a sampling request, a roots request) and an opaque requestState. The client gathers the answers and sends the same request again, with a new id, plus inputResponses and the echoed requestState. Any replica can finish it, because everything it needs is in the retry. Only tools/call, resources/read and prompts/get may do this.

Fig. 4 · One confirm-then-delete call through a round-robin balancer, four ways

Predict first for each setup: which HTTP request fails, and why?

  1. initialize lands on B. The balancer sends the first POST to replica B, which creates a session and returns Mcp-Session-Id. From now on the session exists only in B's memory.
  2. The next request lands on A. notifications/initialized, carrying the session id, goes to replica A by round robin; A never saw the session and answers 404 "Session not found".
  3. The GET stream opens on B. The legacy client opens its standing stream for server-initiated messages; round robin happens to send it to B (200).
  4. tools/call lands on A: 404 again. The delete never runs. The specification says the client must start over with initialize, which will land somewhere else again.
  5. DELETE ends the session on B (200).
  6. 0 of 20 runs. Every run failed the same way; nothing about the tool mattered.

measured 5 October 2026, src/lab/replicas.py: two ckpt_server.py processes (SDK 2.3.0) on ports 30711 (A) and 30712 (B), lb_proxy.py on 30710 sending each HTTP request to the next replica in turn (or, with affinity, to the replica that minted the session), and an SDK client whose "user" answers yes by script. The steps replay the first of 20 runs of each setup; the table below counts all 20.

The recorded bytes of the current step
Predict before you look at the last two rows: the new protocol keeps no session. Will 20 of 20 calls succeed through plain round robin with the SDK's default settings?

requestState is attacker-controlled. It travels through the client, so the specification requires the server to protect its integrity (an HMAC or authenticated encryption) whenever it affects authorization or business logic, and recommends binding it to the authenticated user, a short expiry and the original request. The Python SDK does this for you: it seals every requestState with AES-GCM (the 25-character plaintext delete:llama-7b-step-2000 went out as a 281-character string starting v1., carrying the sealed payload plus the expiry, request binding and audience the SDK adds), and a forged value came back as -32602 Invalid or expired requestState (measured).

What statelessness costs
183 more bytes on every request (section 2); a retry round trip where the old protocol kept a stream open; state handles the model must carry (section 3); and a sealing key to distribute and rotate (the SDK takes a ring of keys: the first seals, all of them open). What it buys: any replica answers any request, gateways can route on headers, list results can be cached, and a crashed server loses only in-flight requests.
The same confirmation written for both eras (SDK 2.3.0), and the error the old style now gets
ckpt_server.py
if ctx.protocol_version and ctx.protocol_version >= "2026-07-28":
    answer = (ctx.input_responses or {}).get("confirm")
    if answer is None:   # round 1: ask, keep nothing in server memory
        return InputRequiredResult(
            input_requests={"confirm": ElicitRequest(params=ElicitRequestFormParams(
                message=f"Delete checkpoint {name}? This cannot be undone.",
                requested_schema={...}))},
            request_state=f"delete:{name}")   # sealed by the SDK before it leaves
    ok = answer.action == "accept" and answer.content["confirm"]
else:   # 2025-11-25: a request back to the client over the session's open stream
    r = await ctx.elicit(f"Delete checkpoint {name}? ...", Confirm)
    ok = r.action == "accept" and r.data.confirm

Calling ctx.elicit() on a 2026-07-28 request fails with NoBackChannelError: Cannot send 'elicitation/create': this transport context has no back-channel for server-initiated requests (measured): the old style simply has no channel any more.

"MCP is dead"? A claim not confirmed, and the argument behind it

The old page said "MCP was declared dead" became a recurring headline in August 2026, citing InfoQ; the article could not be retrieved and the root page dropped it. The argument behind it is worth knowing anyway: with no handshake and no session, MCP over HTTP is close to a plain JSON API with conventions for discovery, tool schemas, consent and authorization. Whether those conventions justify a protocol is a fair interview question; the answer is that the value is in the shared conventions (any host, any server), not in the transport.

6. Versions, compatibility and extensions

A revision is named by the date it was frozen. Five have been released (checked 5 October 2026 against each revision's changelog in the specification repository); the direction is consistent, from a chatty, stateful conversation between two processes toward self-describing requests that ordinary web infrastructure can route, cache and secure.

RevisionEraThe change that matters
2024-11-05legacyFirst release: tools, resources, prompts; stdio and HTTP with SSE (two endpoints)
2025-03-26legacyOAuth 2.1 authorization; Streamable HTTP replaces HTTP with SSE; tool annotations
2025-06-18legacyServers become OAuth resource servers (RFC 9728, RFC 8707); structured output; elicitation
2025-11-25legacyClient ID Metadata Documents recommended; URL elicitation; experimental tasks
2026-07-28modernStateless core: no handshake or session, _meta on every request, MRTR; RFC 9207 iss check
Every change per revision, with its changelog
RevisionWhat changed
2024-11-05First release: JSON-RPC 2.0; tools, resources, prompts; sampling and roots; stdio and HTTP with SSE (two endpoints).
2025-03-26OAuth 2.1 authorization framework; Streamable HTTP replaces HTTP with SSE; JSON-RPC batching; tool annotations (read-only, destructive); audio content; argument completion (changelog).
2025-06-18Batching removed; structured tool output (outputSchema, structuredContent); servers become OAuth resource servers with protected resource metadata; clients must send RFC 8707 resource indicators; security best practices page; elicitation; resource links in results; MCP-Protocol-Version header required (changelog).
2025-11-25OpenID Connect discovery for authorization servers; icons; incremental scope consent; tool-name guidance; URL-mode elicitation; tool calling inside sampling; Client ID Metadata Documents as the recommended registration; experimental tasks; JSON Schema 2020-12 as default; SDK tiers and governance (changelog).
2026-07-28Stateless core: no handshake, no sessions, server/discover, _meta on every request, MRTR, subscriptions/listen, header mirroring, ttlMs/cacheScope, no stream resumability; tasks move to an extension; RFC 9207 iss validation; credentials bound to their issuer; error-code ranges; roots, sampling, logging and Dynamic Client Registration deprecated; a feature lifecycle policy with a twelve-month minimum deprecation window (changelog).

Eras, and the compatibility matrix run for real

The specification calls versions with a handshake legacy and versions with per-request metadata modern; a dual-era implementation speaks both. A dual-era client probes: on stdio it sends server/discover first and falls back to initialize on any error that is not a recognised modern error; on HTTP it tries a modern request and inspects a 400's body before falling back (versioning). All 9 pairings were run over stdio. Predict each cell, then click it.

The instructive failure is the modern-only client against the legacy server: the old SDK answered the unfamiliar request with -32602 Invalid request parameters, an error that names no version and gives a user nothing to act on. That is why the specification recommends that even modern-only clients probe with server/discover first, and why a modern-only server should name its versions when it rejects initialize (the hand-written one here says "this server speaks MCP 2026-07-28 only").

Deprecation and extensions

  • Lifecycle. A feature goes Active, then Deprecated (still works; new code should not adopt it), then Removed, with at least twelve months between the release that deprecates it and its removal; the window can be shortened for an active security risk (feature lifecycle).
  • Extensions are optional additions negotiated in the extensions field of capabilities, named like _meta keys: io.modelcontextprotocol/... for official ones, your reversed domain (com.example/...) for your own. If one side lacks an extension, the other must fall back to core behaviour or refuse (extensions). Official ones: Tasks (io.modelcontextprotocol/tasks: a durable handle for long work, polled with tasks/get, input via tasks/update; when a server runs a tool call as a task, the host can move it to the background and keep the conversation going, as Claude Code's terminal does, then hand the model the result when it finishes); MCP Apps (io.modelcontextprotocol/ui: a server returns interactive HTML that renders inside the conversation); OAuth client credentials for machine-to-machine access and Enterprise-Managed Authorization, where an organisation's identity provider grants access to servers centrally; and Skills over MCP (io.modelcontextprotocol/skills, SEP-2640: a server publishes Agent Skills that the client lists and reads only when one is needed, so the instructions cost context only on use and change when the server changes; Skills extension). A skill fetched from a server is text and often scripts that you did not write: it carries the supply-chain risk of any skill (Agent security, section 3).
Client support for the extensions (volatile, read 30 November 2026)

On 24 November 2026 Anthropic made Tasks and Elicitation generally available in Claude and Claude Code for Pro, Max and Ultra plans, put Skills over MCP in public beta (Claude Code lists a server's skills as server:skill), and announced file uploads to servers as coming; it counts more than 700 million monthly SDK downloads and more than 10,000 connectors for Claude, and says Tool Search cuts tool-definition context by more than 85% in multi-server setups (Anthropic) vendor figures.

Governance

Changes go through Specification Enhancement Proposals (SEPs, numbered by pull request) with working and interest groups; the project sits in the Agentic AI Foundation under the Linux Foundation (section 1).

7. Authorization: how a remote server knows who is calling

A stdio server inherits the user's environment, so it needs no protocol for credentials (stdio servers SHOULD NOT use this framework and should read credentials from the environment). A remote server must decide, on every request, whether this caller may do this. MCP does not invent a scheme: it profiles OAuth 2.1 (still an IETF draft, revision 16 of 3 September 2026; the MCP text cites revision 13). OAuth itself, authorization code, PKCE and JWTs are taught on Auth; its section 9, "Agent-era auth", covers audience binding and no token passthrough from the OAuth side; this section is how MCP uses them (authorization).

Roles. The MCP server is an OAuth resource server: it accepts tokens and serves requests. The MCP client is an OAuth client acting for a user. An authorization server (your company's identity provider, or one built into the service) talks to the user and issues tokens. The design goal: a client that has never heard of a server can still connect to it securely, with no manual setup.

Fig. 5 · From a bare 401 to a token bound to one server: discovery, a client identity without registration, PKCE, then the call

  1. A bare call, and a pointer. POST /mcp with no token returned 401 with WWW-Authenticate: Bearer ..., resource_metadata=".../.well-known/oauth-protected-resource/mcp" (RFC 9728). Note error="invalid_token" although no token was sent, and no scope (both findings are in the closed block below).
  2. The server's metadata. The client reads the protected resource metadata: it names the resource (http://127.0.0.1:30752/mcp, this server's canonical URL) and its authorization_servers. If the header is missing, clients try the well-known URLs themselves.
  3. The authorization server's metadata (RFC 8414, or OpenID Connect discovery): endpoints, code_challenge_methods_supported: ["S256"], client_id_metadata_document_supported: true, authorization_response_iss_parameter_supported: true. The client must check that the document's issuer equals the address it fetched it from.
  4. A client identity without registration. With a Client ID Metadata Document, the client_id is an HTTPS URL that serves a JSON description of the client (name, redirect URIs); before consent the authorization server fetches it and checks that it describes itself and lists the redirect URI. Here: https://localhost:30744/oauth/client.json. This replaces Dynamic Client Registration (RFC 7591), now deprecated and still available, under which every server's authorization server had to accept registrations from anyone.
  5. Authorization request, with resource=. In the user's browser: response_type=code, a PKCE code_challenge (S256), state, scope=ckpt:read and resource=http://127.0.0.1:30752/mcp. That last parameter (RFC 8707) is the MCP-specific must: it says which server the token is for. Consent is scripted; the redirect back carries code, state and iss, and the client compares iss with the issuer it recorded before redirecting (RFC 9207, required of clients since 2026-07-28).
  6. Token request. The code plus the PKCE verifier, redirect_uri, client_id and resource again; the token comes back as a JWT with aud set to the resource, scope ckpt:read, valid 10 minutes.
  7. The call, with the token. The same tools/call with Authorization: Bearer ... on every request (never in the URL): 200, three checkpoints, then tools/list. Seven HTTP exchanges with the two servers, plus the authorization server's one fetch of the identity document.

measured src/lab/auth_run.py: SDK 2.3.0 client with OAuthClientProvider; ckpt-tools with the SDK's resource-server support (auth_mcp.py, port 30752); a small authorization server (auth_as.py, port 30751) standing in for an identity provider, whose user consent is scripted (it approves every valid request); raw TCP taps in front of both servers; the client's identity document over HTTPS on port 30744 with a throwaway local CA. Access tokens are shortened on this page (they were signed with a throwaway key that never left the scratch directory).

The recorded bytes of the current step

The failures, recorded

Step-up. A 403 with error="insufficient_scope" tells the client to re-authorize with the union of its old scopes and the new ones, retry a few times at most, then give up. The specification wants the needed scope in the challenge (scope="ckpt:write"), every scope an operation needs in one challenge, not one per retry; the recorded SDK server named ckpt:write only in its human-readable error_description.

Mix-up, recorded. When the authorization server's redirect carried a different iss (as when an attacker's authorization server is in play), the SDK client refused before sending the code anywhere:

The rules that matter most

  • Audience binding. Servers MUST accept only tokens issued for them. A token for another API is useless here, as the 401 above shows, so a token stolen from one server cannot be replayed at another.
  • No token passthrough. A server that needs to call an upstream API (GitHub, your data warehouse) must get its own token for that API, never forward the one it received. Forwarding breaks audience binding, hides the real caller from the upstream's logs and rate limits, and turns the server into a proxy for stolen tokens (security best practices). Token exchange (RFC 8693) is the standard way to get a downstream token; see Auth.
  • Credentials belong to one issuer. Clients key stored client credentials and tokens by the authorization server's issuer and never reuse them with another; a CIMD client ID, being a URL, works with any authorization server.
  • Machines and enterprises. An agent with no user (a nightly job) uses the OAuth client credentials extension; organisations that want central control use Enterprise-Managed Authorization, where the identity provider decides which servers each employee's client may reach (section 6).

Token passthrough against a server's own upstream token: the audience decides where a token works

Two findings from the recording that clients should know

First, the server answered a request with no credentials with error="invalid_token", although RFC 6750 section 3.1 says a request that "lacks any authentication information" SHOULD get a challenge with no error code (RFC 6750); harmless, but clients should not treat the error code as meaning "your token is bad". Second, the 401 challenge carried no scope, which the MCP text says servers SHOULD include so clients request the least privilege; without it a client falls back to everything in scopes_supported.

8. Security: the protocol-level threats and their specified mitigations

MCP connects a system that follows instructions written in text (the model) to systems that act (tools). Most of its security problems follow from the two facts of section 1: whatever a tool returns becomes part of the model's context, and whatever a server says about its tools shapes what the model does. The protocol can carry the right signals (consent, audiences, annotations), but the decisions are the host's. The clearest way to organise the risks is by who the attacker is; the figure places each one on the architecture.

Five places trust can break, each with the control that holds it

A map of positions, not an attack walkthrough. Agent-side defences in general (permission gates, sandboxes, egress control, human approval) are owned by Agent security; this page owns what the protocol specifies.

AttackerRiskWhat holds
1. Whoever wrote content a tool reads (a web page, an issue, an email, a file)Indirect prompt injection: instructions hidden in data reach the model as if they were part of the task; with private data and a way out, the lethal trifecta. Owned by Agent security, sections 1 and 2; the root page records the bytes of such a tool result (section 10).Scope the tools a session can see; confirm consequential actions with the user, showing the exact arguments. No filter reliably detects injected text; design as if it gets through.
2. The server itself (malicious, compromised or updated)Tool poisoning: instructions hidden in a tool's description, which the model reads but users rarely do (named by Invariant Labs, 1 April 2025). Rug pull: a definition that changes after the user approved it. False annotations: a destructive tool marked read-only. And a local server is a program running with your rights.Treat annotations from untrusted servers as untrusted (the specification's MUST); show users full tool descriptions; re-check definitions when listChanged notices arrive or ttlMs expires. Pinning and hashing what was approved, and sandboxing local servers, are the agent-side supply chain on Agent security, section 3.
3. A web page in the user's browserReaching a server on localhost by cross-site requests or DNS rebinding. The real case: MCP Inspector, the official debugging tool, let unauthenticated requests to its local proxy launch commands over stdio; CVE-2025-49596, fixed in 0.14.1 (NVD, CVSS 4.0 score 9.4).Validate Origin and Host (the SDK does by default: 403 and 421 in section 4), bind to 127.0.0.1, require a token even on localhost, or use stdio, which has no listening socket at all.
4. A malicious remote server, against the clientHostile metadata: OAuth URLs and endpoints come from the server, so a client that opens or fetches them carelessly can be led to internal addresses (server-side request forgery, for example a cloud metadata endpoint) or, with unsafe URL handling, to running commands. The real case: mcp-remote, a widely used bridge, was open to OS command injection from a crafted authorization_endpoint; CVE-2025-6514 (NVD, CVSS 3.1 score 9.6).Accept only https: URLs for OAuth endpoints (loopback excepted in development); open authorization URLs only through the system browser, never a shell; for clients running on servers, block private and link-local addresses when fetching metadata; validate the issuer of every metadata document (section 7).
5. A malicious client or a network intermediaryConfused deputy: an MCP server that proxies a third-party API with one shared OAuth client can be tricked into using a user's earlier consent for an attacker's client. Token passthrough (section 7). Forged state: a tampered requestState or a guessed state handle. Header and body disagreeing so a gateway allows one thing and the server does another.Per-client consent recorded by the proxy server, exact redirect URI matching; audience-bound tokens, no passthrough; integrity-protected requestState (the SDK's default; a forgery was rejected in section 5) and handles bound to the authenticated user; reject header mismatches (-32020, measured in section 4).

The confused deputy, as specified (security best practices, read 24 October 2026). The deputy is an MCP proxy server: it fronts a third-party API and is a single OAuth client there, with one static client ID. The problem needs four conditions at once: that static client ID; the proxy letting MCP clients register dynamically, each with its own client_id and redirect URI; the third-party authorization server setting a consent cookie after the first approval; and no per-client consent in the proxy. Then a user's earlier consent to the proxy is silently reused for a newly registered client, and the MCP authorization code goes to that client's redirect URI. The fix is a MUST in the deputy: keep a registry of approved client_id values per user and check it before forwarding to the third party, with a consent page that names the client and shows its redirect URI; match redirect URIs exactly; generate single-use state and set it only after consent (security best practices). The same page notes that an authorization server accepting Client ID Metadata Documents fetches a URL chosen by an unknown client, so it needs the same SSRF protections as clients.

That page treats the protocol-level items in depth: confused deputy, token passthrough, SSRF, state handle hijacking (the 2026-07-28 replacement for the old "session hijacking"), local server compromise, OAuth URL validation, stdio in proxy setups, mix-up attacks, localhost redirect impersonation, CIMD trust and scope minimisation.

A defensive checklist for a host (the general controls are owned by Agent security)
  • Show which servers and tools are active, and show tool inputs before sensitive calls; the specification asks for a human able to deny any tool call.
  • Expose per task only the tools the task needs; do not combine tools that read private data with tools that read untrusted content and tools that send data out, unless a human approves each outbound action.
  • Give each server its own credentials with the least scope, from the environment or OAuth, never the user's master tokens; prefer short-lived tokens.
  • Run local servers with restricted file system and network access; show the exact command before adding a server from a one-click link.
  • Pin and diff tool definitions; prefix tool names by server to avoid collisions.
  • Log every tool call with its arguments and result size, so an incident can be reconstructed; set time limits on tool calls.
  • Treat irreversible actions (deleting, paying, sending, moving hardware) as a different class: confirmation outside the conversation, so text in the context cannot approve them. The root page's note on agents driving instruments makes the same point.

9. Building a server in Python

The official Python SDK (mcp on PyPI, 2.3.0 here; documentation) turns typed functions into tools. The whole ckpt-tools server is about 90 lines (src/lab/ckpt_server.py); its skeleton:

from mcp.server import MCPServer
from mcp.server.caching import CacheHint
from mcp_types import ToolAnnotations

mcp = MCPServer("ckpt-tools", version="1.0.0",
                instructions="Inspect and prune training checkpoints. Deleting asks the user first.",
                cache_hints={"tools/list": CacheHint(ttl_ms=300_000, scope="public")})

class Checkpoint(BaseModel):
    name: str; step: int; val_loss: float; size_gb: float

@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True, openWorldHint=False))
def list_checkpoints(run: str) -> list[Checkpoint]:
    """List the saved checkpoints of a training run, oldest first, with validation loss."""
    return RUNS.get(run, [])

@mcp.resource("ckpt://{run}/config")
def run_config(run: str) -> str: ...

@mcp.prompt()
def pick_best(run: str) -> str: ...

if __name__ == "__main__":
    mcp.run("stdio")          # or mcp.run("streamable-http", host="127.0.0.1", port=8000)

The docstring becomes the description, the type hints become both schemas, a Pydantic model becomes a structured result, a parameter typed Context gives access to progress, input responses and the protocol version. The same server object answers 2025-11-25 and 2026-07-28 clients.

Design tools for a model, not as an API mirror

  • Few, task-shaped tools. A model choosing among 40 thin REST wrappers picks worse and pays for 40 definitions in every request (ckpt-tools' list of three tools was 1,818 bytes of JSON). Prefer "list checkpoints of a run with their eval loss" over "GET /runs/{id}/artifacts?type=ckpt".
  • Write descriptions as documentation for a capable newcomer: what it does, when to use it, units, limits, what an error means. This text is the model's only manual.
  • Return little. Summaries, identifiers and a cursor beat full dumps; every byte of content is input tokens (section 3).
  • Errors the model can act on: "checkpoint llama-7b-step-9000 not found; existing: ..." as isError: true, not a stack trace.
  • Mark side effects honestly (annotations), make destructive tools idempotent where possible (deleting twice is a no-op), and ask for confirmation through elicitation for irreversible ones, as delete_checkpoint does.
  • No state in the process for an HTTP server: handles in arguments, a shared requestState key, external stores; then any replica can serve any request (section 5).
  • stdout is sacred on stdio: log to stderr; check that libraries you import do not print.
Testing: in process, over the real transport, on the wire, by hand, with a model
  • In process, no transport. The SDK's Client accepts the server object itself: async with Client(mcp) as c: r = await c.call_tool("list_checkpoints", {"run": "llama-7b-sft"}). Fast unit tests of every tool, both eras (mode="legacy" forces the handshake).
  • Over the real transport: the same calls through stdio and through HTTP, to catch stdout pollution, serialisation and header problems.
  • Contract tests on the wire: send the hostile requests of section 4 (wrong headers, bad versions, foreign Origin) and assert the status codes; keep them in CI so an SDK upgrade cannot silently change them.
  • Interactive: MCP Inspector (uv run mcp dev server.py) lists and calls tools by hand. Use 0.14.1 or later (CVE-2025-49596, section 8), and do not leave it running.
  • With a model: record real agent transcripts and score whether the model picks the right tool with the right arguments, before and after you change a description. A description change is a behaviour change.
Deploying across an organisation: packages, stateless replicas, central configuration, the registry, traces
  • Local servers are distributed like packages (PyPI, npm, container images) and configured per host. Pin versions; review the launch command.
  • Remote servers are ordinary web services: behind TLS and a load balancer, several stateless replicas sharing the requestState key, OAuth with your identity provider, rate limits per client, logs with the caller's identity. Header mirroring lets a gateway enforce per-tool policy and route by Mcp-Name without reading bodies.
  • Central configuration. Hosts let administrators decide which servers people may use: one host's scopes, precedence, managed servers and allow and deny lists are on Claude Code, section 10. On the authorization side, the Enterprise-Managed Authorization extension lets the identity provider grant access centrally.
  • Finding servers. The official registry (registry.modelcontextprotocol.io) launched in preview on 8 September 2025: an open catalogue and API with namespaced server names. A listing is metadata, not a security review.
  • Observability. Put traceparent in _meta so traces join across host and server; the Python SDK wraps handling in OpenTelemetry spans.
  • Dated, 18 October 2026: gateways are tightening the same way: LiteLLM 1.106.0 disables stdio MCP servers by default, so a gateway that launches local processes needs them switched back on deliberately (LiteLLM releases).

10. Building a client and a host

Most engineers write servers; anyone building an agent writes a host. The client side of the SDK in a few lines:

from mcp import Client, StdioServerParameters

async with Client(StdioServerParameters(command="python", args=["ckpt_server.py", "stdio"]),
                  elicitation_callback=ask_user) as c:      # or Client("https://.../mcp")
    tools = (await c.list_tools()).tools                   # cached for ttlMs
    r = await c.call_tool("delete_checkpoint", {"name": "llama-7b-step-1000"})
    # an input_required result is handled inside call_tool: ask_user runs, the call is retried

mode="auto" (the default) probes server/discover and falls back to the handshake for legacy servers; mode="2026-07-28" skips the probe; mode="legacy" forces the handshake. The host's job around this:

  1. Start and supervise servers: launch stdio processes, restart crashed ones, set call timeouts.
  2. Build the model's tool list from every server's tools/list, prefixing names by server so search from two servers stays distinct; keep the order stable for the prompt cache; drop tools the current task does not need.
  3. Run the loop: send the model request; for each tool call apply policy (allowed? needs confirmation? show the arguments), route to the right client, return content as the tool result (including isError results, so the model can correct itself), repeat.
  4. Handle input requests: render elicitation forms to the user, and say who is asking; on decline, return the decline rather than inventing an answer.
  5. Watch for change: re-list when ttlMs expires or a list_changed notice arrives on subscriptions/listen; diff definitions against what the user approved.
  6. Authorize remote servers with OAuth (section 7), storing tokens per authorization server, never in logs.

TypeScript: LLM apps and agents, section 8 runs this loop end to end in TypeScript, including a scripted mock model that recovers from a wrong file name after an isError result.

Reference

Debugging: symptom, first check, fix (ten rows)
SymptomFirst checkCause and fix
A stdio tool hangs until timeout; client logs "Invalid JSON"Run the server by hand, pipe one request in, look at raw stdoutSomething printed to stdout. Log to stderr (root Failure lab: "MCP over stdio: stdout pollution")
Works on one replica, fails behind the load balancer with Session not found (404)Is the client on 2025-11-25? Does the balancer pin sessions?Legacy sessions live in one process. Sticky routing, or move both sides to 2026-07-28 (measured: 0 of 20 against 20 of 20)
Confirmations fail behind the balancer with -32602 Invalid or expired requestStateDo replicas share the sealing key?Each process generated its own. Pass the same RequestStateSecurity(keys=[...]) to every replica; rotate with a key ring
A modern client gets -32602 Invalid request parameters from a server that used to workWhich revision does the server speak? Probe server/discoverLegacy server. Use a dual-era client (mode="auto") or upgrade the server
400 with -32020Compare Mcp-Method/Mcp-Name with the bodyA proxy or hand-written client changed one copy. Send both from the same values
403 "Invalid Origin header" or 421 "Invalid Host header" locallyWhich Origin and Host did the request carry?The server's rebinding protection. Call from a non-browser client, or configure the allowed hosts and origins deliberately
401 with a token you just obtainedDecode the token: aud, iss, expAudience is another resource (missing or wrong resource parameter), wrong issuer, or clock skew
403 insufficient_scopeThe scope in WWW-AuthenticateRe-authorize with the union of old and new scopes (step-up); stop after a few tries
Progress or streamed results arrive all at onceIs a proxy buffering? Look for X-Accel-Buffering: noDisable buffering for the MCP path (see HTTP and Streaming)
An agent did something nobody asked for after reading contentThe tool results in the transcript, and which tools were exposedInjected instructions in data. Scope tools per task, confirm outbound and destructive actions (section 8)
Interview rehearsal (eight questions, with model answers)

Does the model call MCP servers?

No. The host lists the servers' tools, translates them into the model API's tool definitions, receives the model's tool calls, applies its own policy, and sends tools/call through the client for that server. MCP is between host and server; the model sees only tool definitions and tool results. That is also why the host, not the protocol, is where consent and scoping live.

Tools, resources and prompts: what is the difference?

Who decides to use them. Tools are model-controlled (the model calls them), resources are application-controlled (the app attaches data to context), prompts are user-controlled (the user picks a template). They differ in risk too: a tool can act, a resource only informs.

Why did MCP remove sessions in 2026-07-28, and what did it cost?

Sessions lived in one server process, so every request of a session had to reach that process: sticky load balancing or a shared session store, and servers holding streams open while waiting for clients. Now every request carries version and capabilities in _meta, server-to-client questions become input-required results that the client answers by retrying (MRTR), and any replica can serve any request. Costs: about 180 bytes of metadata per request, an extra round trip for confirmations, state handles the model must carry, and a key that all replicas must share to seal requestState. In a two-replica test, old sessions failed 20 of 20 calls through round robin; new requests failed 20 of 20 until the replicas shared the key, then succeeded 20 of 20.

A tool fails because of bad input. Error response or result?

A result with isError: true and an explanation, so the model can retry with corrected arguments (clarified in 2025-11-25). JSON-RPC errors are for problems the model cannot fix: malformed requests, unknown methods, protocol versions, header mismatches.

How does a client that has never seen a server get a token for it?

The server's 401 points to its protected resource metadata (RFC 9728), which names its authorization server; the client reads that server's metadata (RFC 8414 or OIDC discovery), identifies itself with a Client ID Metadata Document URL (or falls back to dynamic registration), runs authorization code with PKCE including resource= the server's URL (RFC 8707), checks the iss in the response (RFC 9207), and sends the bearer token on every request. The server accepts only tokens whose audience is itself, and never forwards them upstream.

What is token passthrough and why is it banned?

A server accepting a token that was not issued for it and forwarding it to an upstream API. It breaks audience binding (a token for one service works at another), hides the real caller from the upstream's controls and logs, and makes the server a proxy for stolen tokens. The fix is for the server to hold or exchange for its own upstream credentials.

Your agent reads web pages and can send email. What do you worry about, and what do you do?

Indirect prompt injection: page text reaching the model as if it were instructions. With private data in reach, that is the lethal trifecta. Break a leg per task: do not give a browsing task access to private data, or require a human to approve every outbound message with its full content, or restrict destinations. Detection helps but is not a control; design for the injection getting through.

stdio or Streamable HTTP for a new server?

stdio when it acts on the user's own machine and accounts with the user's rights: no network surface, credentials from the environment, one process per user. Streamable HTTP when it is shared, holds data or credentials that should not be on laptops, or must scale: then it is a web service with TLS, OAuth, stateless replicas and a shared state key. Speed is not the deciding factor: both answered in one to three milliseconds on loopback.

Corrections to the old page ("Model Context Protocol (MCP)")

Corrected. The old page described resource "subscriptions for change notifications" as if unchanged: in 2026-07-28 they arrive on a subscriptions/listen stream, and resources/subscribe is gone. It said Dynamic Client Registration was "replaced" by Client ID Metadata Documents; it is deprecated and still available (section 7). And it dated Client ID Metadata Documents to 2026-07-28; they were added, as the recommended option, in 2025-11-25 (2025-11-25 changelog).

Corrected or unconfirmed. "Session hijacking" is now state handle hijacking in the 2026-07-28 best practices, since sessions are gone. The old page's statement that statelessness "removes much of this class" is half right: guessable session IDs are gone, but guessable handles take their place. Supply-chain counts ("thousands of community servers"), the registry's "~2k servers" and aggregator counts could not be confirmed today and are not repeated.

Verified and not verified. Verified today: Claude Code's managedMcpServers setting exists (the old page dated it September 2026; the documentation gives the version requirement, not a date). Not confirmed and not repeated: --permission-prompts none, the Claude Developer Platform's "auto permission policies" wording, and the Emergence World stress test's "46 hours".

Corrected in this rebuild (24 October 2026). The earlier version of this page described the recorded 403 as carrying scope="ckpt:write"; the recording names the scope only in error_description (section 7).