# 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.

Page: https://tryhoming.com/learn/mcp/one-conversation
Section: Learn
Updated: 2026-11-25

Lesson 2 of 4 in How MCP Works · 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:

```json
{ "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)

_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._

**Step 1, Client to Server: 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.

```http
POST /mcp HTTP/1.1
Content-Type: application/json
Accept: application/json, text/event-stream
Authorization: Bearer home_live_…
```

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-11-25",
    "capabilities": {},
    "clientInfo": { "name": "learn-capture", "version": "1.0" }
  }
}
```

**Step 2, Server to Client: 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
HTTP/1.1 200 OK
Content-Type: text/event-stream

event: message
data: …
```

```json
{
  "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. …"
  }
}
```

**Step 3, Client to Server: 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.

```http
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
```

```json
{ "jsonrpc": "2.0", "method": "notifications/initialized" }
```

```http
HTTP/1.1 202 Accepted
```

**Step 4, Client to Server: tools/list.** From here on, each request names the agreed version in the `MCP-Protocol-Version` header.

```http
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
```

```json
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
```

**Step 5, Server to Client: 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.

```json
{
  "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", … }
    ]
  }
}
```

**Step 6, Client to Server: tools/call ping.** A call names the tool and passes `arguments` that fit its `inputSchema`. `ping` takes none.

```http
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
```

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": { "name": "ping", "arguments": {} }
}
```

**Step 7, Server to Client: 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.

```json
{
  "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
  }
}
```

**Step 8, Client to Server: tools/call (misspelled).** The tool name is `send_mesage`. Models make typos too.

```http
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
```

```json
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": { "name": "send_mesage", "arguments": {} }
}
```

**Step 9, Server to Client: 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.

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

### Stateless (2026-07-28)

_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._

**Step 1, Client to Server: 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.

```http
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
```

```json
{
  "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": {}
    }
  }
}
```

**Step 2, Server to Client: 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.

```json
{
  "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
  }
}
```

**Step 3, Client to Server: 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.

```http
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
```

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "ping",
    "arguments": {},
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}
```

**Step 4, Server to Client: 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.

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

### Break It

_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._

**Step 1, Client to Server: No key.** The same `tools/list` as before, with no `Authorization` header.

```http
POST /mcp HTTP/1.1
Content-Type: application/json
Accept: application/json, text/event-stream
```

```json
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
```

**Step 2, Server to Client: 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
HTTP/2 401
www-authenticate: Bearer resource_metadata="https://api.tryhoming.com/.well-known/oauth-protected-resource/mcp", scope="profile email"
```

```json
{ "error": "unauthorized", "error_description": "Sign in to Homing or use an API key" }
```

**Step 3, Client to Server: Wrong key.** A key that looks real and isn't.

```http
POST /mcp HTTP/1.1
Content-Type: application/json
Accept: application/json, text/event-stream
Authorization: Bearer home_live_notarealkey…
```

```json
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {} }
```

**Step 4, Server to Client: 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
HTTP/1.1 401 Unauthorized
www-authenticate: Bearer error="invalid_token", error_description="Sign in to Homing or use an API key"
```

```json
{ "error": "invalid_token", "error_description": "Sign in to Homing or use an API key" }
```

**Step 5, Client to Server: tools/run.** A method MCP doesn't have. The key is fine now.

```http
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
```

```json
{ "jsonrpc": "2.0", "id": 5, "method": "tools/run", "params": {} }
```

**Step 6, Server to Client: 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.

```json
{
  "jsonrpc": "2.0",
  "id": 5,
  "error": { "code": -32602, "message": "Invalid request parameters", "data": "" }
}
```

**Step 7, Client to Server: read_message, no id.** A real tool, called without its required argument.

```http
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
```

```json
{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": { "name": "read_message", "arguments": {} }
}
```

**Step 8, Server to Client: 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.

```json
{
  "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…" }]
  }
}
```

## 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.

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

**Step 1, Client to Auth: tools/call ping.** Every request to `/mcp` meets Homing's auth layer before any tool runs. It reads one header: `Authorization`.

**Step 2, Auth to Database: 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.

**Step 3, Auth to ping: 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.

**Step 4, Database to ping: 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.

**Step 5, ping to Client: 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.

```json
{
  "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 }
}
```

**Step 6, ping to Database: 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.

## 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):

```json
→ { "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):

```json
{
  "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

### 1. Which message gets no reply at all?

- A request with `"id": 0`: 0 is a valid integer id, so this is a request and gets exactly one response.
- A notification (correct): Right. A notification has no `id`, and the receiver must not respond. Over HTTP, the server answers with 202 and no body.
- A request whose tool fails: A failed tool still gets a response: a result with `isError: true`.

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

- From the initialize request: 2026-07-28 removed the initialize handshake.
- From the request itself (correct): Right. Each request carries its version in `params._meta` and the `MCP-Protocol-Version` header. That's what lets the protocol run without sessions.
- From `server/discover`, once, then cached: `server/discover` is optional, and the client caches its answer, not the server. The version still travels on every request, so any instance can answer.
- From a session cookie: MCP has never used cookies for this, and 2026-07-28 removed protocol-level sessions altogether.

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

- A JSON-RPC error object: That shape is for requests that are themselves invalid. This one was fine.
- A result with `isError: true` (correct): Right. It's a tool error, and the host should pass it to the model so it can wait and retry, or tell you.
- Nothing, so the client times out: Every request gets a response. Silence leaves the client guessing.

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

- Closes the connection: The server stays connected and answers with a version it supports.
- Answers with a version it does support (correct): Right. Asked for 2026-07-28, Homing answered 2025-11-25. If the client can't speak that version, it should disconnect.
- Accepts it anyway: It must answer with a version it actually supports.

### 5. Can an MCP request use `"id": null`?

- Yes, JSON-RPC allows it: Base JSON-RPC does, but MCP is stricter: the spec says the ID MUST NOT be null.
- No (correct): Right. An id is a string or an integer, never null, and never one the sender is still waiting on.

## 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:

```bash
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:

```bash
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:

```bash
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

- [MCP 2026-07-28: overview (messages, ids, _meta)](https://modelcontextprotocol.io/specification/2026-07-28/basic/index)
- [2026-07-28: versioning and servers that speak both](https://modelcontextprotocol.io/specification/2026-07-28/basic/versioning)
- [2026-07-28: changelog](https://modelcontextprotocol.io/specification/2026-07-28/changelog)
- [2026-07-28: server/discover](https://modelcontextprotocol.io/specification/2026-07-28/server/discover)
- [2026-07-28: tools](https://modelcontextprotocol.io/specification/2026-07-28/server/tools)
- [2026-07-28: Streamable HTTP](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http)
- [2025-11-25: lifecycle (the handshake)](https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle)
- [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification)

_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 a page at https://tryhoming.com/learn/mcp/one-conversation, listed in https://tryhoming.com/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](https://tryhoming.com/guides/connect-with-api-key.md): Where the key comes from, and how a client sends it on every request.
