跳到主要内容
On this page

ReferencesThe Agent Protocol

Model Context Protocol

An open standard for connecting AI applications to tools and data.

Model Context Protocol at a glance

Role
The Agent Protocol
Domain
AI & Agents
Status
Specification 2026-07-28
What it does
  • One message format — JSON-RPC 2.0 — carried identically over every transport.
  • Two standard transports: stdio for a local subprocess, Streamable HTTP for a remote server.
  • Three primitives — tools, resources and prompts — plus an optional discovery call for capabilities.
  • Tier 1 SDKs for TypeScript, Python, Go and C#, with Rust in beta.
  • A formal extensions framework, so proposals can mature outside the core.

What it is

An assistant that cannot call anything is a text box. MCP is the answer to the awkward half of that sentence: it gives a model a standard way to reach the outside world, and it gives the outside world a standard way to describe what it offers.

The protocol is deliberately small. A server advertises tools (functions a model may call), resources (data a model may read) and prompts (reusable interaction templates). A client discovers them, calls them, and handles the results. Everything else — how the two are connected — is a transport detail.

How it works

The 2026-07-28 revision changed the protocol's core from a bidirectional, stateful conversation into a stateless request/response one. Every request is self-describing, so any request can land on any instance behind a plain round-robin load balancer, with no shared session store to run.

Two transports carry the messages. On stdio, the client launches the server as a subprocess and exchanges newline-delimited JSON-RPC over its standard streams; the server may log freely to stderr, but stdout must carry nothing but protocol messages. On Streamable HTTP, the server exposes one endpoint that accepts POST, and answers each request with either a JSON object or a Server-Sent Events stream scoped to that request.

  • Every Streamable HTTP request must carry an `MCP-Protocol-Version` header that matches the version in the body's `_meta`; a mismatch is rejected with a 400.
  • The `Mcp-Method` and `Mcp-Name` headers carry the method and tool names, so a gateway can route, rate-limit and authorise without parsing the JSON body.
  • Server-to-client calls such as sampling and elicitation are now expressed as Multi Round-Trip Requests — the answer is carried back inside a result rather than needing a permanently open stream.
  • List responses carry cache hints and a deterministic order, so a client can cache a tool catalogue and keep an upstream prompt cache stable across reconnects.

Under the hood

PieceWhat it is
Wire formatJSON-RPC 2.0, UTF-8 encoded
Transportsstdio (subprocess) and Streamable HTTP (single endpoint, POST)
PrimitivesTools, resources and prompts
Discoveryserver/discover RPC, optional — every request is self-describing
ExtensionsA formal framework; Tasks live in io.modelcontextprotocol/tasks
SDKsTier 1: TypeScript, Python, Go, C# — Rust in beta
LifecycleRoots, Sampling and Logging are deprecated, with a twelve-month off-ramp

Where to read more