---
title: "MCP explained for developers: hosts, clients, servers and JSON-RPC"
type: guide
url: https://agentsfordevs.com/guides/mcp-explained
markdown: https://agentsfordevs.com/guides/mcp-explained.md
publisher: Agents for Devs
author: Agents for Devs desk
reviewed_by: Agents for Devs desk
published: 2026-12-06
updated: 2026-12-06
license: https://agentsfordevs.com/reuse
citation: 'Agents for Devs. "MCP explained for developers: hosts, clients, servers and JSON-RPC." Published Dec 6, 2026. https://agentsfordevs.com/guides/mcp-explained'
attribution: Credit Agents for Devs and link to https://agentsfordevs.com/guides/mcp-explained
format: Guide
topics:
  - protocol
description: "How MCP works: hosts, clients and servers, the JSON-RPC messages they exchange, the three server primitives, and the stateless 2026-07-28 spec."
---

# MCP explained for developers: hosts, clients, servers and JSON-RPC

Who does what in a Model Context Protocol setup, what the JSON-RPC traffic looks like, and what the stateless 2026-07-28 revision changed.

## Short answer

The Model Context Protocol (MCP) is an open protocol that lets an AI application, called the host, use outside tools and data through MCP servers. The host creates one MCP client per server, and each pair exchanges JSON-RPC 2.0 messages over stdio or Streamable HTTP. A client finds a server's tools with `tools/list` and runs one with `tools/call`. As of December 6, 2026, the current revision is 2026-07-28, which removed the `initialize` handshake: every request carries its own protocol version.

**Checked against:** [MCP specification](https://modelcontextprotocol.io/specification/latest), [MCP architecture overview](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture), [Tools specification](https://modelcontextprotocol.io/specification/2026-07-28/server/tools) and [2026-07-28 changelog](https://modelcontextprotocol.io/specification/2026-07-28/changelog), December 6, 2026.

**Run by us:** no. JSON and pseudo-code examples are copied from the MCP project's docs.

## What problem does MCP solve?

MCP lets you wrap a system once as an MCP server so that any MCP-compatible AI application can use it, instead of writing a separate integration for each application.

| Fact | Value | Source |
|---|---|---|
| Released | November 25, 2024, by Anthropic | [Anthropic](https://www.anthropic.com/news/model-context-protocol) |
| Legal home | Model Context Protocol a Series of LF Projects, LLC | [MCP governance](https://modelcontextprotocol.io/community/governance) |
| Foundation | Founding project of the Linux Foundation's Agentic AI Foundation, announced December 9, 2025 | [Linux Foundation](https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation) |
| Current spec revision | 2026-07-28 (as of December 6, 2026) | [Specification](https://modelcontextprotocol.io/specification/latest) |
| Message format | JSON-RPC 2.0 | [Specification](https://modelcontextprotocol.io/specification/latest) |
| Standard transports | stdio and Streamable HTTP | [Architecture overview](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture) |

Anthropic's launch post described the problem as "Every new data source requires its own custom implementation, making truly connected systems difficult to scale." The specification names its model: MCP "takes some inspiration from the Language Server Protocol," which standardized programming-language support across development tools.

The MCP site lists Claude, ChatGPT, Visual Studio Code and Cursor among the applications that support the protocol ([modelcontextprotocol.io](https://modelcontextprotocol.io/docs/getting-started/intro)).

## Who are the host, the client and the server?

The host is the AI application, a client is a connection object the host creates for one server, and a server is the program that supplies tools and data.

| Participant | What it is | Spec responsibilities |
|---|---|---|
| [MCP host](/glossary/mcp-host) | The AI application, such as Claude Code, Claude Desktop or VS Code | Creates clients, enforces security policies and consent, handles authorization decisions, aggregates context |
| [MCP client](/glossary/mcp-client) | A component inside the host | Talks to exactly one server, attaches protocol version and capabilities to every request, keeps servers isolated from each other |
| [MCP server](/glossary/mcp-server) | A local process or remote service | Exposes tools, resources and prompts; must respect security constraints |

The [architecture overview](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture) uses VS Code as its example. Connecting to the Sentry MCP server creates one client object. Connecting to the local filesystem server as well creates a second.

"Server" says nothing about location. The filesystem server runs on your machine over stdio; Sentry's server runs on Sentry's platform over Streamable HTTP. The docs note that local stdio servers "typically serve a single MCP client," while remote ones typically serve many.

One design rule matters for security. The [spec architecture page](https://modelcontextprotocol.io/specification/2026-07-28/architecture) says servers "should not be able to read the whole conversation, nor 'see into' other servers." The full conversation stays with the host.

## What does an MCP request look like on the wire?

Every MCP message is a JSON-RPC 2.0 object, and every request carries its protocol version and client capabilities in a `_meta` field.

Here is a `tools/call` request and its response from the architecture overview:

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "weather_current",
    "arguments": {
      "location": "San Francisco",
      "units": "imperial"
    },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": {
        "name": "example-client",
        "version": "1.0.0"
      },
      "io.modelcontextprotocol/clientCapabilities": {
        "elicitation": {}
      }
    }
  }
}
```

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "resultType": "complete",
    "content": [
      {
        "type": "text",
        "text": "Current weather in San Francisco: 68°F, partly cloudy with light winds from the west at 8 mph. Humidity: 65%"
      }
    ],
    "_meta": {
      "io.modelcontextprotocol/serverInfo": {
        "name": "example-server",
        "version": "1.0.0"
      }
    }
  }
}
```

The `name` must match a tool name returned by `tools/list`, and `arguments` must fit that tool's `inputSchema`. A result's `content` array can hold `text`, `image`, `audio`, `resource_link` and `resource` items. A tool can also return JSON in `structuredContent`, checked against an optional `outputSchema` ([Tools spec](https://modelcontextprotocol.io/specification/2026-07-28/server/tools)).

The transport doesn't change the message. Over [stdio](/glossary/stdio-transport), each message is one line on the server's stdin or stdout. Over [Streamable HTTP](/glossary/streamable-http), each message is its own HTTP POST. See [stdio vs Streamable HTTP](/guides/mcp-transports) for the details.

## What can an MCP server expose?

An MCP server can expose tools the model calls, resources the application reads, and prompts the user picks.

| Primitive | Controlled by | Discovery | Use |
|---|---|---|---|
| Tools | The model | `tools/list` | `tools/call` |
| Resources | The application | `resources/list`, `resources/templates/list` | `resources/read` |
| Prompts | The user | `prompts/list` | `prompts/get` |

The "controlled by" column comes from the MCP docs' [server concepts](https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts) page. Tools can write to databases, call APIs or modify files. Resources are read-only data identified by a URI, such as `file:///path/to/document.md`. Prompts are templates that applications often surface as slash commands.

The specification lists one feature that clients offer servers: elicitation, which lets a server ask the user for input or a confirmation. Revision 2026-07-28 deprecated roots, sampling and protocol logging. The migration advice is to pass directories through tool parameters or server configuration, call an LLM provider's API directly instead of sampling, and log to `stderr` or OpenTelemetry.

## How does a host turn MCP tools into model actions?

The host lists tools from every connected server, hands the combined list to the model, and routes each tool call the model makes back to the server that owns it.

```python
# Pseudo-code for AI application tool execution
async def handle_tool_call(conversation, tool_name, arguments):
    client = app.find_mcp_client_for_tool(tool_name)
    result = await client.call_tool(tool_name, arguments)
    conversation.add_tool_result(result.content)
```

That pseudo-code is from the architecture overview. The full loop runs like this:

1. The client may call `server/discover` to learn the server's supported versions, capabilities and identity. Every server must implement it; calling it is optional.
2. The client calls `tools/list`. Each tool has a `name`, an optional `title` and `description`, and an `inputSchema`.
3. The host merges tools from all servers into one registry for the model. The Tools spec warns that two servers can expose the same name, such as `search`, and says aggregating clients SHOULD disambiguate, for example by prefixing a server identifier.
4. The model picks a tool. The host sends `tools/call`. The spec says there "SHOULD always be a human in the loop with the ability to deny tool invocations."
5. To learn when tools change, the client opens a `subscriptions/listen` stream and asks for `toolsListChanged`.

The model still calls tools through its provider's function-calling feature. MCP standardizes where those tools come from. [Function calling vs MCP](/guides/function-calling-vs-mcp) covers that split.

## What changed in the 2026-07-28 revision?

Revision 2026-07-28 made MCP stateless: there is no handshake and no protocol-level session, so each request stands on its own.

| Area | Through 2025-11-25 | 2026-07-28 |
|---|---|---|
| Startup | `initialize` / `notifications/initialized` handshake | No handshake; version and capabilities in each request's `_meta` |
| Discovery method | None; `server/discover` is new in this revision | `server/discover`, which every server must implement |
| Sessions | `Mcp-Session-Id` header on Streamable HTTP | Removed; servers return explicit handles passed as tool arguments |
| Server needs user input | Server sends its own request, such as `elicitation/create` | Server returns an `InputRequiredResult`; client retries with `inputResponses` |
| Change notifications | HTTP GET stream, `resources/subscribe` | `subscriptions/listen` |
| Long-running work | Experimental tasks in core | Official `io.modelcontextprotocol/tasks` extension |

The [changelog](https://modelcontextprotocol.io/specification/2026-07-28/changelog) also deprecates the HTTP+SSE transport and OAuth Dynamic Client Registration, in favor of Client ID Metadata Documents. Under the new feature lifecycle policy, deprecated features get at least a twelve-month window before removal.

Older servers still exist. On stdio, the spec tells a client that supports both eras to probe with `server/discover` first and fall back to `initialize` if the server answers with an unrecognized error or not at all ([stdio spec](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/stdio)).

## Who enforces security in MCP?

The protocol doesn't: the specification says "MCP itself cannot enforce these security principles at the protocol level," so the work falls to hosts, clients and servers.

| Who | What the spec asks |
|---|---|
| Hosts | Get explicit user consent before invoking any tool and before exposing user data to servers |
| Clients | Treat tool annotations as untrusted unless they come from a trusted server; validate tool results before passing them to the model |
| Servers | Validate all tool inputs, implement access controls, rate limit tool invocations, sanitize tool outputs |
| HTTP servers using auth | Follow the [OAuth 2.1](/glossary/oauth-2-1) based authorization spec; accept only tokens issued for themselves |
| stdio servers | Don't follow the authorization spec; read credentials from the environment |

Sources: [specification](https://modelcontextprotocol.io/specification/latest), [Tools spec](https://modelcontextprotocol.io/specification/2026-07-28/server/tools), [Authorization spec](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization).

Two risks deserve a name. A tool description is text the model reads, so a malicious one can steer the agent; that is [tool poisoning](/glossary/tool-poisoning). And a local server is an ordinary process: the MCP project's [Local Server Security](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security) guide says it "inherits your environment variables" and "can read anything your account can read."

## What to read next

- [stdio vs Streamable HTTP: choosing an MCP transport](/guides/mcp-transports)
- [Function calling vs MCP: what each one standardizes](/guides/function-calling-vs-mcp)
- [MCP vs REST: why agents don't just call your API](/guides/mcp-vs-rest)
- [MCP host](/glossary/mcp-host)

## Sources

1. [Specification (revision 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/latest)
2. [Architecture overview, Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture)
3. [Architecture (specification 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/architecture)
4. [Understanding MCP servers, Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/learn/server-concepts)
5. [Tools (specification 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/server/tools)
6. [Key Changes (revision 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/changelog)
7. [stdio (specification 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/stdio)
8. [Authorization (specification 2026-07-28), Model Context Protocol](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization)
9. [Local Server Security, Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)
10. [Governance and Stewardship, Model Context Protocol](https://modelcontextprotocol.io/community/governance)
11. [What is the Model Context Protocol (MCP)?, Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)
12. [Introducing the Model Context Protocol, Anthropic (2024-11-25)](https://www.anthropic.com/news/model-context-protocol)
13. [Linux Foundation Announces the Formation of the Agentic AI Foundation, Linux Foundation (2025-12-09)](https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation)

## Changelog

- 2026-12-06: First published.

## Cite this page

Agents for Devs. "MCP explained for developers: hosts, clients, servers and JSON-RPC." Published Dec 6, 2026. https://agentsfordevs.com/guides/mcp-explained

- Page: https://agentsfordevs.com/guides/mcp-explained
- Markdown: https://agentsfordevs.com/guides/mcp-explained.md
- Reuse: quote or summarize with a link to the page. Terms: https://agentsfordevs.com/reuse
