Skip to content

One Conversation, Message by Message

Every MCP message is JSON-RPC 2.0. A request has an id and gets exactly one response with the same id; a notification has no id and gets none. Up to version 2025-11-25, a connection opens with an initialize handshake. Version 2026-07-28 drops it, and every request carries its own version.

View Markdown
On this page

Lesson 2 of 4 · 8 min

JSON-RPC in One Minute

MCP doesn't invent a message format. It uses JSON-RPC 2.0, which has three shapes. A request names a method, carries params and has an id. A response echoes that id and carries a result or an error, never both. A notification has a method and no id, and nobody answers it.

A request and its response

{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} } { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ … ] } }

Two Rules MCP Adds

An id is a string or an integer, and "unlike base JSON-RPC, the ID MUST NOT be null." It also can't repeat an id the sender is still waiting on. That's how a client with several calls in flight matches each answer to its question.

Two Versions You Will Meet

MCP versions are dates. Up to and including 2025-11-25, a connection opens with a handshake: the client sends initialize, both sides settle on a version and on what each supports, and the client confirms with a notification. Everything after depends on it.

Version 2026-07-28 makes MCP stateless. Its changelog removes "the initialize/notifications/initialized handshake" and protocol-level sessions with it. Each request now carries its protocol version and the client's capabilities in params._meta, so any server instance can answer any request. A client that wants to know a server first can call server/discover.

Servers move at their own pace, and the spec lets one serve both versions on the same URL, choosing by how the client opens. As of 2026-11-25, Homing's server speaks the handshake version, 2025-11-25, through the official Python SDK. It already runs without sessions, though, so you can send it any request cold.

Step Through It

Pick a tab: the handshake version, the stateless version, or Break It, where we feed the server four mistakes. Each step shows what crossed the wire and what to notice. Arrow keys move between steps, and each step has its own link.

Handshake (2025-11-25)

Client

Server

  1. 1 initialize

    The client offers the newest version it speaks and says who it is. Empty capabilities means it offers the server nothing in return, such as sampling or roots.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "initialize",
      "params": {
        "protocolVersion": "2025-11-25",
        "capabilities": {},
        "clientInfo": { "name": "learn-capture", "version": "1.0" }
      }
    }
  2. 2 result

    Same id, so this answers request 1. The server confirms the version, says what it supports, and sends instructions: standing rules the host can show the model. It answers as a one-event SSE stream. That's still Streamable HTTP, which lets a server reply with plain JSON or a stream. What was deprecated in 2025 is the older transport that needed two endpoints.

    HTTP/1.1 200 OK
    Content-Type: text/event-stream
    
    event: message
    data: …
    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "protocolVersion": "2025-11-25",
        "capabilities": {
          "prompts": { "listChanged": false },
          "resources": { "subscribe": false, "listChanged": false },
          "tools": { "listChanged": false }
        },
        "serverInfo": {
          "name": "homing",
          "version": "1.30.0",
          "websiteUrl": "https://tryhoming.com"
        },
        "instructions": "Call send_message only after the user asked to send. …"
      }
    }
  3. 3 notifications/initialized

    No id, so no reply: the server answers the HTTP request with 202 and an empty body. Homing sends no Mcp-Session-Id back. Sessions were optional in this version, and without one every later request stands on its own.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    { "jsonrpc": "2.0", "method": "notifications/initialized" }
    HTTP/1.1 202 Accepted
  4. 4 tools/list

    From here on, each request names the agreed version in the MCP-Protocol-Version header.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    { "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
  5. 5 result

    Every tool the server offers; one is shown in full. The description is written for the model, and it's how the model decides when to call. The annotations are hints, and the spec says to treat them as untrusted unless the server is trusted. ping is marked read-only: what it records happens after the answer is sent, so the call itself changes nothing.

    {
      "jsonrpc": "2.0",
      "id": 2,
      "result": {
        "tools": [
          {
            "name": "ping",
            "title": "Verify Homing connection",
            "description": "Confirm this install reaches Homing and return your handle, …",
            "inputSchema": { "type": "object", "properties": {} },
            "annotations": {
              "readOnlyHint": true,
              "destructiveHint": false,
              "idempotentHint": true,
              "openWorldHint": false
            }
          },
          { "name": "send_message", … },
          { "name": "check_inbox", … }
        ]
      }
    }
  6. 6 tools/call ping

    A call names the tool and passes arguments that fit its inputSchema. ping takes none.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    {
      "jsonrpc": "2.0",
      "id": 3,
      "method": "tools/call",
      "params": { "name": "ping", "arguments": {} }
    }
  7. 7 result

    The same answer twice: structuredContent for code that reads JSON, and the same JSON as text in content for clients that only show text, as the spec recommends. isError: false means the tool ran.

    {
      "jsonrpc": "2.0",
      "id": 3,
      "result": {
        "content": [
          { "type": "text", "text": "{\"status\":\"ok\",\"handle\":\"ripley\",…}" }
        ],
        "structuredContent": {
          "status": "ok",
          "summary": "Connected to Homing as @ripley. …",
          "handle": "ripley",
          "inbox_url": "https://app.tryhoming.com/inbox"
        },
        "isError": false
      }
    }
  8. 8 tools/call (misspelled)

    The tool name is send_mesage. Models make typos too.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    {
      "jsonrpc": "2.0",
      "id": 4,
      "method": "tools/call",
      "params": { "name": "send_mesage", "arguments": {} }
    }
  9. 9 result, isError

    Homing answers with a result marked isError: true, not a JSON-RPC error. The host passes the text to the model, and the model can fix the name and try again.

    {
      "jsonrpc": "2.0",
      "id": 4,
      "result": {
        "content": [{ "type": "text", "text": "Unknown tool: send_mesage" }],
        "isError": true
      }
    }

Captured from Homing's MCP server on 2026-11-25. The handle and links are a sample account's; the key and long strings are cut short.

Stateless (2026-07-28)

Client

Server

  1. 1 server/discover

    Optional: clients "MAY call it before sending any other requests." Nothing is agreed here. The version and the client's capabilities ride in _meta, and the method is repeated in the Mcp-Method header, so a proxy in front of the server can route without parsing the body.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2026-07-28
    Mcp-Method: server/discover
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "server/discover",
      "params": {
        "_meta": {
          "io.modelcontextprotocol/protocolVersion": "2026-07-28",
          "io.modelcontextprotocol/clientInfo": { "name": "learn-capture", "version": "1.0" },
          "io.modelcontextprotocol/clientCapabilities": {}
        }
      }
    }
  2. 2 result

    Everything the handshake's answer held, as a plain result the client may cache for ttlMs. resultType: "complete" is new: every result now says whether it's final.

    {
      "jsonrpc": "2.0",
      "id": 1,
      "result": {
        "resultType": "complete",
        "supportedVersions": ["2026-07-28"],
        "capabilities": { "tools": {}, "resources": {}, "prompts": {} },
        "_meta": {
          "io.modelcontextprotocol/serverInfo": { "name": "homing", "version": "…" }
        },
        "instructions": "Call send_message only after the user asked to send. …",
        "ttlMs": 3600000
      }
    }
  3. 3 tools/call ping

    No initialize, no initialized, no tools/list required first. The call carries its own version and capabilities, and the tool's name goes in Mcp-Name. Any instance of the server can take it.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2026-07-28
    Mcp-Method: tools/call
    Mcp-Name: ping
    {
      "jsonrpc": "2.0",
      "id": 2,
      "method": "tools/call",
      "params": {
        "name": "ping",
        "arguments": {},
        "_meta": {
          "io.modelcontextprotocol/protocolVersion": "2026-07-28",
          "io.modelcontextprotocol/clientCapabilities": {}
        }
      }
    }
  4. 4 result

    The same answer as step 7 of the handshake track, plus resultType. Count the messages. Before a single call, the handshake version needs three (initialize, its answer, initialized); this one needs none, because discovery is optional. A client that already knows the server sends the call and gets the answer. Two messages in all.

    {
      "jsonrpc": "2.0",
      "id": 2,
      "result": {
        "resultType": "complete",
        "content": [
          { "type": "text", "text": "{\"status\":\"ok\",\"handle\":\"ripley\",…}" }
        ],
        "structuredContent": { "status": "ok", "handle": "ripley", … },
        "isError": false
      }
    }

Constructed from the 2026-07-28 spec: the same ping, shaped for that version. Homing's server doesn't speak it yet, so these four messages are ours, not a capture.

Break It

Client

Server

  1. 1 No key

    The same tools/list as before, with no Authorization header.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    { "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
  2. 2 401 + where to sign in

    Refused before any JSON-RPC happens. The WWW-Authenticate header points to the server's sign-in metadata, so a host can start OAuth without being told where. The model never sees this: the host handles it.

    HTTP/2 401
    www-authenticate: Bearer resource_metadata="https://api.tryhoming.com/.well-known/oauth-protected-resource/mcp", scope="profile email"
    { "error": "unauthorized", "error_description": "Sign in to Homing or use an API key" }
  3. 3 Wrong key

    A key that looks real and isn't.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_notarealkey…
    { "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
  4. 4 401, no pointer

    invalid_token, and this time no sign-in pointer: the token was shaped like an API key, and signing in wouldn't fix a bad key. The body is the same whether the key never existed or was revoked, so a stranger can't probe for valid keys.

    HTTP/1.1 401 Unauthorized
    www-authenticate: Bearer error="invalid_token", error_description="Sign in to Homing or use an API key"
    { "error": "invalid_token", "error_description": "Sign in to Homing or use an API key" }
  5. 5 tools/run

    A method MCP doesn't have. The key is fine now.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    { "jsonrpc": "2.0", "id": 5, "method": "tools/run", "params": {} }
  6. 6 Protocol error

    A JSON-RPC error, not a result. JSON-RPC reserves -32601 for an unknown method; the Python SDK answers -32602, invalid parameters. Either way it's a protocol error: the host deals with it, and the model may never see it.

    {
      "jsonrpc": "2.0",
      "id": 5,
      "error": { "code": -32602, "message": "Invalid request parameters", "data": "" }
    }
  7. 7 read_message, no id

    A real tool, called without its required argument.

    POST /mcp HTTP/1.1
    Content-Type: application/json
    Accept: application/json, text/event-stream
    Authorization: Bearer home_live_…
    MCP-Protocol-Version: 2025-11-25
    {
      "jsonrpc": "2.0",
      "id": 7,
      "method": "tools/call",
      "params": { "name": "read_message", "arguments": {} }
    }
  8. 8 isError, with advice

    A tool error, so the model reads it. Homing's text names the missing argument and tells the model not to resend the same call. That sentence tells the model to fix its call instead of retrying it.

    {
      "jsonrpc": "2.0",
      "id": 7,
      "result": {
        "isError": true,
        "structuredContent": {
          "status": "failed",
          "error": "invalid_request",
          "summary": "read_message was not run: `message_id` is required. Do not retry this request as is: change it, or stop."
        },
        "content": [{ "type": "text", "text": "…the same JSON as text…" }]
      }
    }

Four failures, captured from Homing's MCP server on 2026-11-25 (step 2 from production, the rest from a sandbox). Request ids are cut.

Inside the Server: What ping Does

The protocol ends at the server's front door. What happens inside is up to the server, and it's where most of the interesting decisions live. Here is Homing's ping, from step 6 above, followed through the server.

Client

Auth

ping

Database

  1. 1 tools/call ping

    Every request to /mcp meets Homing's auth layer before any tool runs. It reads one header: Authorization.

  2. 2 Who is this?

    The bearer is either an API key or an OAuth token from signing in, and either way it resolves to one account. The auth layer also notes when that account last connected, at most once a minute, on any request; the Connect page in the app reads that time. A missing or unknown credential stops here with a 401 and the sign-in pointer you'll see in Try It. The tool never runs, and the error doesn't say which keys exist.

  3. 3 Account attached

    The request moves on with the account attached out of band. Nothing in the JSON says who you are, so a model can't claim to be someone else by writing it into the arguments. First, ping checks a per-minute limit on the account's calls.

  4. 4 First time?

    ping reads whether this account has connected before. On the first connection, the answer names your handle and adds first_note: a hello note the agent offers to send you, and sends only if you say yes.

  5. 5 Receipt

    One summary line for the model to read, plus fields for code: your plan, the agent inboxes this session can work, and context.version, which tells an agent when your inbox's notes changed.

    {
      "status": "ok",
      "summary": "Connected to Homing as @ripley for the first time. …",
      "first_connection": true,
      "first_note": { "subject": "Hello from your agent", … },
      "handle": "ripley",
      "inbox_url": "https://app.tryhoming.com/inbox",
      "plan": { "name": "free", … },
      "agents": [ … ],
      "context": { "version": 0 }
    }
  6. 6 After the answer

    Once the answer has gone, Homing records the first connection and fills any gaps: your own inbox, where notes to self land, and your contact with Homing support. Doing this after the response is what lets ping be marked read-only. The call changes nothing; the record still happens.

Traced from Homing's server code on 2026-11-25, simplified.

When Versions Disagree

In the handshake version, the client asks for a version and the server must answer with one it supports. We sent Homing an initialize asking for 2026-07-28. It answered with 2025-11-25. A client that can't speak the version offered "SHOULD disconnect."

In 2026-07-28 there's no handshake to bargain in, so the server refuses the request itself. The error carries code -32022 and lists the versions it does speak, and the client retries with one of them.

Asked Homing for 2026-07-28 (captured, abridged)

→ { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2026-07-28", "capabilities": {}, … } } ← { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2025-11-25", … } }

A refused version in 2026-07-28 (spec example)

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

Two Kinds of Error

A protocol error is a JSON-RPC error object: the request itself was wrong, such as a method that doesn't exist. The host deals with it, and the model may never see it.

A tool error is a normal result with isError: true: the request was fine, but the tool failed, say because the service behind it is down. The spec says clients "SHOULD provide tool execution errors to language models," because the model can often recover. It can fix an argument, wait, or tell you.

Servers draw the line in slightly different places. The spec's example treats an unknown tool name as a protocol error (-32602); Homing's server returns it as a tool error, as step 9 of the handshake showed, and answers an unknown method with -32602 where JSON-RPC reserves -32601 (the Break It tab). Handle both shapes. And if you write a server, write error text for the model that will read it. For example, Homing's answer to a call with a missing argument ends: "Do not retry this request as is: change it, or stop."

Check Yourself

1Which message gets no reply at all?

2In 2026-07-28, how does the server learn which protocol version a request uses?

3A tool call is well formed, but the API behind the tool is down. What should come back?

4In the handshake version, a client asks for a version the server doesn't support. What does the server do?

5Can an MCP request use "id": null?

Questions

Does MCP still use the initialize handshake?

Up to version 2025-11-25, yes. Version 2026-07-28 removed it: every request carries its protocol version and the client's capabilities in params._meta, and server/discover replaces the handshake's answer.

Is SSE deprecated in MCP?

The old HTTP+SSE transport, which used two endpoints, has been deprecated since 2025-03-26. Streamable HTTP replaced it, and a Streamable HTTP server may still answer a request as a one-event SSE stream.

What is the difference between an MCP protocol error and isError?

A protocol error is a JSON-RPC error object: the request was invalid. isError: true is a normal result for a tool that ran and failed, and the host passes it to the model so it can recover.

Try It

Speak MCP by hand. First, knock without a key: Homing turns you away, and the refusal tells a client where to sign in. Then, with a key from the app saved as HOMING_API_KEY, replay steps 4 to 7. You don't need to initialize first, because the server keeps no session.

1. Without a key

curl -si https://api.tryhoming.com/mcp -X POST \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'

2. List the tools

curl -s https://api.tryhoming.com/mcp -X POST \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -H "authorization: Bearer $HOMING_API_KEY" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \ | sed -n 's/^data: //p' | jq '.result.tools[].name'

3. Call ping

curl -s https://api.tryhoming.com/mcp -X POST \ -H 'content-type: application/json' \ -H 'accept: application/json, text/event-stream' \ -H "authorization: Bearer $HOMING_API_KEY" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ping","arguments":{}}}' \ | sed -n 's/^data: //p' | jq '.result.structuredContent | {status, handle}'

What You Should See

  • 1: HTTP/2 401 and a header www-authenticate: Bearer resource_metadata="…". Open that URL. It names the server that signs you in.
  • 2: one tool name per line, starting with ping.
  • 3: "status": "ok" and your own handle.

Sources

Checked against the MCP specification 2026-07-28 and Homing's MCP server on 2026-11-25.

For Agents and Search Engines

This lesson is also plain Markdown for language models, listed in /llms.txt, and described in structured data as LearningResource, BreadcrumbList, FAQPage. Its sources are listed above. We last checked the lesson against them on 2026-11-25.

Put it to use

Connect an MCP Client with an API Key

Where the key comes from, and how a client sends it on every request.

Start with a note to yourself.

Works in Claude Code, ChatGPT, Codex, Gemini and other AI apps that can connect to Homing.

Connect an agent

Paste this into your agent.

Set me up with Homing in this session. Read https://tryhoming.com/setup-instructions.md and follow it. I'll sign in or set up a key when you ask.

Full Setup Guide

Step by step: Claude CodeCodexGeminiMore…