One Protocol, Any Tool

A close read of the Model Context Protocol — how hosts discover and invoke external capabilities through a common protocol, and the wire format underneath each connection.

Client  lives inside the host Server  exposes the capability Updated for MCP 2026-07-28
01Why it exists

The M×N Problem

Without a shared protocol, every AI application needs a bespoke adapter for every data source. M apps × N tools creates an M×N integration problem.

before — M×N bespoke integrations App A App B App C Tool 1 Tool 2 Tool 3 Tool 4 every line is its own auth, schema, error handling after — one protocol, roughly M+N adapters App A App B MCP Server 1 Server 2 Server 3
MCP takes inspiration from the Language Server Protocol: standardize the interface so applications and capability providers do not rebuild every pairwise connection.
02Architecture

Host, Client, Server

Three roles, not two. The Host is the application you're using; it creates one Client per connection, and each Client speaks 1:1 to exactly one Server.

Host application — e.g. Claude Code Client A 1 connection Client B 1 connection Server 1 e.g. filesystem, Git Server 2 e.g. a SaaS API separate protocol context; host enforces isolation
Each client communicates with exactly one server. This separates protocol context; the host still has to enforce consent, credential boundaries, process isolation, and access policy.
03Transports

Two Ways to Connect

The primitives above are transport-agnostic — the same tools/call works whether the server is a subprocess or a website.

stdio

Local subprocess

The client launches a subprocess and exchanges newline-delimited JSON-RPC over stdin/stdout. OS permissions and exposed environment variables still define what that process can reach.

Streamable HTTP

Remote server

A single endpoint accepts POST requests. A reply can be one JSON object or a request-scoped SSE stream; long-lived change events use a subscription stream.

The original two-endpoint HTTP+SSE transport was superseded in 2025-03-26 and formally deprecated in 2026-07-28. Custom transports remain possible.
04Wire format

Underneath: JSON-RPC 2.0

Every MCP message is one of three JSON-RPC shapes — the transport changes, this doesn't.

request — expects a response
{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": { ... }
}
notification — no response expected
{
  "jsonrpc": "2.0",
  "method": "notifications/tools/list_changed"
}
// no "id" field at all
A response carries the request's id and either a result or an error. In modern MCP, requests flow client → server; server needs are returned as structured input requests through MRTR. Legacy revisions allowed server-initiated requests.
05Legacy lifecycle · through 2025-11-25

Legacy MCP: Initialize, Then Go

Legacy revisions establish a connection-scoped session: negotiate a protocol version and capabilities, then confirm readiness.

Client Server initialize request — protocolVersion, capabilities response — server's own capabilities notifications/initialized — ready for normal operation
Both sides MUST hold non-ping traffic until the sequence completes: the client waits for the response; the server waits for notifications/initialized. Dual-era implementations retain this path for compatibility.
06Lifecycle — the 2026-07-28 rewrite

Going Stateless

The most recent spec revision removes the handshake entirely — worth knowing about, still landing across the ecosystem.

through 2025-11-25 · legacy

Session-based

An initialize handshake negotiates connection-scoped capabilities. Streamable HTTP may use an MCP-Session-Id for subsequent requests.

2026-07-28 · latest

Stateless

No handshake or protocol session ID. Every request carries its protocol version and capabilities in _meta. Servers implement server/discover; clients may call it upfront.

Protocol statelessness removes connection affinity: any request can reach any compatible instance. It does not prohibit application state in tools, authorization systems, subscriptions, tasks, or external services.
07Vocabulary

Four Current Features — Plus Compatibility

Modern MCP centers on three server features and one client feature. Roots and Sampling remain available temporarily, but are deprecated.

server → client

Tools

Model-controlled actions the LLM can invoke — tools/list, tools/call.

server → client

Resources

App-controlled readable data — files, records — addressed by URI.

server → client

Prompts

User-controlled reusable templates the host can surface as slash commands.

deprecated · compatibility

Sampling

A server requests model generation through the client. New implementations should integrate with a model provider directly.

deprecated · compatibility

Roots

Filesystem locations the client exposes as working context. They are context hints, not an enforceable authorization boundary.

client → server

Elicitation

A server can ask the client to collect a specific piece of missing input from the user mid-task.

08Deprecation watch

Sampling, Roots & Logging: Deprecated

SEP-2577 deprecates all three. They remain functional during the compatibility window, but new implementations should use the alternatives below.

Deprecated featureRecommended direction
RootsPass locations through tool parameters, resource URIs, or server configuration
SamplingIntegrate the server directly with the chosen model provider
LoggingUse stderr for stdio and OpenTelemetry for structured observability
MRTR solves a different problem: it replaces independent server-initiated JSON-RPC requests. A server returns resultType: "input_required" with inputRequests; the client retries the original request with matching inputResponses.
09Discovery

Discover, Subscribe, Then Refresh

Modern MCP separates capability discovery from live change delivery: discover what exists, then explicitly subscribe to the changes you need.

Client Server 1 · server/discover, then tools/list capabilities + tool array + optional cursor 2 · subscriptions/listen { toolsListChanged: true } 3 · notifications/tools/list_changed + subscriptionId 4 · client refreshes with tools/list
The same pattern applies to prompts and resources. A notification is delivered only on a subscriptions/listen stream that opted into that event type.
10Trust signals

Tool Annotations: Hints, Not Guarantees

Stable since the 2025-03-26 revision — four booleans a tool definition can carry to describe its own behavior.

readOnlyHint

Doesn't modify state

Safe-looking calls a client might auto-approve more readily.

destructiveHint

May cause real damage

Deletion, overwrites — the kind of call worth a confirmation.

idempotentHint

No additional effect

Repeating the same call does not create further effects beyond the first call.

openWorldHint

Touches the outside world

Web search, external APIs — results a client can't fully predict.

Annotations are self-reported and untrusted by default. Clients MUST treat them as untrusted unless the server itself is trusted. Real safety comes from host policy, consent, credential scope, sandboxing, and access control.
11Remote servers

Authorization: OAuth 2.1

For protected HTTP servers, the MCP server is an OAuth resource server, the MCP client is an OAuth client, and authorization may be handled by a separate authorization server.

MCP client

Discovers and requests

Fetches metadata, performs the authorization flow with PKCE, obtains the token, and sends it to the protected MCP endpoint.

MCP server

Protected resource

Advertises RFC 9728 metadata and validates that the presented access token was issued for this resource.

authorization server

Authorizes and issues

Publishes discovery metadata, authenticates or obtains consent, and issues a resource-bound access token.

1 · Discover2 · Authorize3 · Call
401 points the client to protected-resource metadata, which identifies the authorization server.The client uses PKCE and includes resource= in authorization and token requests.The client calls the MCP server with the token; the server validates its audience.
Client ID Metadata Documents are preferred. Dynamic Client Registration (RFC 7591) is optional and retained for backward compatibility; registration is with the authorization server, not the MCP server.
12The model

The Host Decides What Is Allowed

Client discovers and requests capabilities Server describes and executes capabilities

MCP standardizes what the client can request and what the server exposes. The host remains responsible for what the user permits: consent, credentials, isolation, and policy.

01 / 13
use ← → or click the edges to navigate