Turning Point Academy · MCP Engineering

Discovery and the request lifecycle — Visual guide

MCP Engineering course · M1


This guide shows, step by step, how an MCP client and server agree on a protocol version and capabilities in revision 2026-07-28: per request, with no handshake. It also shows the legacy handshake (2025-11-25 and earlier) and the exact rules for falling back to it.

What changed in V2: the earlier version of this guide taught the initialize handshake and a three-phase lifecycle (initialization → operation → shutdown) as current. Revision 2026-07-28 removed the handshake. Here it appears only as the legacy mechanism you fall back to.

In one sentence

MCP is now a stateless protocol: "all the information needed to process a request is contained in the request itself." Every request names its own protocol version and client capabilities in _meta, and servers MUST NOT rely on earlier requests to know them. An open stdio process is not a session.

Step 1 — Every request carries its own _meta

KeyRequiredMeaning
io.modelcontextprotocol/protocolVersionYesVersion for this request, for example "2026-07-28"
io.modelcontextprotocol/clientCapabilitiesYesCapabilities relevant to this request ({} if none)
io.modelcontextprotocol/clientInfoNo (clients SHOULD send it)Client name and version
io.modelcontextprotocol/logLevelNoPer-request log level (part of deprecated Logging)

A request missing a required key is malformed: the server MUST reply -32602 (Invalid params), HTTP 400 on Streamable HTTP. Servers SHOULD put io.modelcontextprotocol/serverInfo in every result's _meta. clientInfo and serverInfo are self-reported: never base security decisions on them.

Step 2 — server/discover (servers MUST, clients MAY)

Servers MUST implement server/discover. Clients MAY call it to learn supported versions, capabilities and identity in one round trip, but are not required to. Captured from the course's lab-l08 notes server over stdio (official Python SDK mcp 2.3.0):

{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{
  "io.modelcontextprotocol/protocolVersion":"2026-07-28",
  "io.modelcontextprotocol/clientCapabilities":{}}}}
{"jsonrpc":"2.0","id":1,"result":{
  "resultType":"complete",
  "supportedVersions":["2026-07-28"],
  "capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":true},"tools":{"listChanged":true}},
  "instructions":"A DEMO notes store with synthetic data. add_note changes state; get_note is read-only.",
  "ttlMs":0,"cacheScope":"private",
  "_meta":{"io.modelcontextprotocol/serverInfo":{"name":"demo-notes","version":"1.0.0"}}}}

Step 3 — The errors that drive the lifecycle

CodeNameWhenWhat the client does
-32022UnsupportedProtocolVersionErrorthe server does not implement the requested version; data.supported lists the ones it doesretry with a common version, or surface an error. Do not fall back to legacy.
-32021MissingRequiredClientCapabilityErrorthe request needs a capability the client did not declare; data.requiredCapabilities (HTTP 400)declare the capability (if supported) and retry, or give up
-32602Invalid paramsa required _meta key is missingfix the request
-32020HeaderMismatch (HTTP only)HTTP headers and body disagreefix the headers (L07)

Captured from the same server:

{"jsonrpc":"2.0","id":1,"error":{"code":-32022,"message":"Unsupported protocol version",
 "data":{"supported":["2026-07-28"],"requested":"2099-01-01"}}}

Key example — a missing capability. A server MUST NOT rely on capabilities the client has not declared. In lesson L05, a tool that needs to ask the user (elicitation) replied to a client that declared {} with:

{"code":-32021, "...": "...", "data":{"requiredCapabilities":{"elicitation":{"form":{}}}}}

Step 4 — The life of one request (diagram)

client                                              server
  |  request + _meta(protocolVersion, clientCapabilities)  |
  |------------------------------------------------------->|
  |        (optional) notifications/progress ...            |
  |<-------------------------------------------------------|
  |  result: resultType "complete"                          |
  |    or    resultType "input_required" -> retry (L05)     |
  |    or    JSON-RPC error (-32022 / -32021 / -32602)      |
  |<-------------------------------------------------------|

What "lifecycle" means now:

Legacy: the initialize handshake (2025-11-25 and earlier)

Legacy clients open a session: initialize → the server's result → the client's notifications/initialized. Only then do normal requests flow, and they carry no _meta version. Captured from the same lab-l08 server, started fresh:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25",
 "capabilities":{},"clientInfo":{"name":"x","version":"0"}}}
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-11-25",
 "capabilities":{"prompts":{"listChanged":false},"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},
 "instructions":"A DEMO notes store ...","serverInfo":{"name":"demo-notes","version":"1.0.0"}}}

There is no resultType; clients MUST treat its absence as "complete". This server is dual-era (an SDK compatibility layer, which the spec allows) and picks the era from how the client opens. On stdio the era is fixed per process: after a modern request, the SDK rejected a later initialize with -32022.

Fallback rules (current spec, Versioning and Compatibility)

stdio:  send server/discover (preferred modern version)
          ├─ DiscoverResult .................... modern
          ├─ recognised modern error (-32022) .. modern, retry with a supported version (NO fallback)
          └─ any other error / timeout ......... legacy -> fall back to initialize

HTTP:   send a modern request
          ├─ success ........................... modern
          └─ 400: recognised modern error body . modern, fix the request or version
                  empty / unrecognised body .... legacy -> initialize (then, if needed, deprecated HTTP+SSE)

Hosts differ today: Claude Code negotiates 2026-07-28 (force the handshake with MCP_PROTOCOL_NEGOTIATION=legacy); Cursor's client spoke 2025-11-25 and earlier per a staff post on 2026-09-21; other hosts are unknown. A modern-only server fails with every legacy host.

Glossary

To remember

  1. No handshake in 2026-07-28: every request carries protocolVersion and clientCapabilities in _meta.
  2. Servers MUST implement server/discover; clients MAY call it.
  3. -32022 = unsupported version (retry, don't fall back); -32021 = missing capability; -32602 = missing _meta key.
  4. No shutdown phase: stdio follows the process; HTTP requests end with their stream.
  5. Fall back to initialize only when the server is not recognisably modern, and never on one hard-coded error code.

Turning Point Academy · MCP Engineering course · Module 1 · Lesson 6 (L06) · V2, spec 2026-07-28