Guide protocol/
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, MCP architecture overview, Tools specification and 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 |
| Legal home | Model Context Protocol a Series of LF Projects, LLC | MCP governance |
| Foundation | Founding project of the Linux Foundation’s Agentic AI Foundation, announced December 9, 2025 | Linux Foundation |
| Current spec revision | 2026-07-28 (as of December 6, 2026) | Specification |
| Message format | JSON-RPC 2.0 | Specification |
| Standard transports | stdio and Streamable HTTP | Architecture overview |
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).
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 | 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 | 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 | A local process or remote service | Exposes tools, resources and prompts; must respect security constraints |
The architecture overview 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 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:
{
"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": {}
}
}
}
}
{
"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).
The transport doesn’t change the message. Over stdio, each message is one line on the server’s stdin or stdout. Over Streamable HTTP, each message is its own HTTP POST. See stdio vs Streamable HTTP 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 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.
# 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:
- The client may call
server/discoverto learn the server’s supported versions, capabilities and identity. Every server must implement it; calling it is optional. - The client calls
tools/list. Each tool has aname, an optionaltitleanddescription, and aninputSchema. - 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. - 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.” - To learn when tools change, the client opens a
subscriptions/listenstream and asks fortoolsListChanged.
The model still calls tools through its provider’s function-calling feature. MCP standardizes where those tools come from. 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 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).
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 based authorization spec; accept only tokens issued for themselves |
| stdio servers | Don’t follow the authorization spec; read credentials from the environment |
Sources: specification, Tools spec, Authorization spec.
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. And a local server is an ordinary process: the MCP project’s Local Server Security guide says it “inherits your environment variables” and “can read anything your account can read.”
What to read next
Sources
- Specification (revision 2026-07-28)
- Architecture overview
- Architecture (specification 2026-07-28)
- Understanding MCP servers
- Tools (specification 2026-07-28)
- Key Changes (revision 2026-07-28)
- stdio (specification 2026-07-28)
- Authorization (specification 2026-07-28)
- Local Server Security
- Governance and Stewardship
- What is the Model Context Protocol (MCP)?
- Introducing the Model Context Protocol
- Linux Foundation Announces the Formation of the Agentic AI Foundation
Changelog
- 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 version: https://agentsfordevs.com/guides/mcp-explained.md
- Reuse: quote or summarize with a link to this page. Reuse terms