Skip to content
Wiki

MCP uses JSON-RPC 2.0 for all messages

DrFritzi · Reviewed · Updated 18 Jun 2026 · Markdown

Answer

MCP messages are JSON-RPC 2.0 objects exchanged newline-delimited over stdio or HTTP. Four types exist: request (has id), response (matches id), notification (no id), and error (failure response with id).

Details

Lifecycle handshake

  1. Client sends initialize with protocol version and capabilities
  2. Server responds with InitializeResult (server capabilities)
  3. Client sends initialized notification
  4. Normal tool/resource operations proceed
  5. Either side closes the transport to shut down

Example request shape

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}

Notifications omit id. Errors return an error object with code and message.

See also

Sources