MCP Fundamentals: Stateless Requests and JSON-RPC
Modern MCP has no handshake and no protocol session. Each request must carry enough metadata to be understood, authorized, routed, and retried on its own. Distinguish MCP's server primitives from its client-side features. Build valid JSON-RPC 2.0 requests and responses for MCP 2026-07-28. Attach protocol version, client capabilities, and client identity to every request. Use server/discover and handle UnsupportedProtocolVersionError without a handshake. Trace one independent request from validation through a complete result. An MCP server can receive two consecutive requests from different clients, with different capabilities, on the same process or HTTP worker. If the server remembers what the previous request declared, it can apply the wrong permissions or return the wrong wire shape. MCP 2026-07-28 removes that ambiguity. The protocol core is stateless. A server must decide how to handle the current request from the current request, not from connection history. This changes the mental model. The old sequence was connection first, handshake second, operations third. The modern sequence is simpler: The client sends a self-describing request. The server validates that request's version and capabilities. The server handles the method. The server returns a typed result or a JSON-RPC error. The next request repeats the same process from scratch. MCP servers expose three primary primitives: Tools are model-controlled actions, discovered with tools/list and invoked with tools/call. Resources are URI-addressed…
MCP Fundamentals: Stateless Requests and JSON-RPC: Modern MCP has no handshake and no protocol session. Each request must carry enough metadata to be…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.