A guide to MCP
What each piece is, who calls it, and a demo you can run.
who's whosessiontoolsresourcespromptssamplingelicitationrootsprogresstransports
agent · host server request resultevery figure runs · click things
Who's who
Five words the rest of this page leans on. The confusing one is host: it is simply the spec's formal name for the agent application itself.
- agent · hostthe AI application you talk to: a chat app, an IDE, Claude. The spec says host; this page mostly says agent. Same thing.
- clienta small piece inside the host that holds one connection to one server. Five servers, five clients, one host.
- serverthe capability being plugged in: files, flights, a calendar. One job each, no knowledge of the others.
- modelthe LLM inside the host. It only writes text; the host turns that text into real calls.
- youthe person. Some hops park until you click.
The session
A session is the live connection between an agent and one server. Opening it is a handshake: each side lists what it can do, and that exchange defines everything allowed afterwards. Click connect to watch one open.
initializenotifications/initialized
- opens with
initialize: protocol version and capabilities, both directions - the ruleuse nothing the other side didn't declare
- shapeone session · one client · one server
→ initialize
{ "method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": { "sampling": {}, "elicitation": {}, "roots": {} },
"clientInfo": { "name": "my-host", "version": "1.0" }
} }
← result
{ "result": {
"protocolVersion": "2025-06-18",
"capabilities": { "tools": {}, "resources": { "subscribe": true }, "prompts": {} },
"serverInfo": { "name": "notes", "version": "2.1" }
} }specspecification · 2025-06-18JSON-RPC 2.0 underneath, always
the serverthe capability you plug in
Tools
serverTools are how a server lets the agent do things: search files, send an email, book a flight. The model decides a tool is needed, the host makes the call, and the result lands back in the conversation.
tools/listtools/call…/list_changed
- isa function with a name and a JSON schema for its arguments
- called bythe model; the host executes
- effectsyes, they live here; approvals apply here first
- discover
tools/listis the whole universe;list_changedannounces edits
specconcepts · tools
Resources
serverResources are how a server shares things to read: files, tables, logs. Reading one changes nothing, which is why the host can pull them into context freely. Subscribing keeps your copy honest when the original moves on.
resources/listresources/readresources/subscribe
- iscontent behind a URI: a file, a table, a log
- chosen bythe host or the person, never the model
- effectsnone, by definition; reading is always safe
- freshsubscribe →
updated→ read again
Prompts
serverPrompts are canned requests a server offers the person: pick one, the server fills in the details, and a ready-to-send message appears. Think slash commands.
prompts/listprompts/get
- isa named template the server fills into ready messages
- invoked bythe person; slash-command material
- returnsmessages with roles, not prose
- notethe model picks tools, never prompts
the agentthe host that runs them
Sampling
agentSampling lets a server borrow the agent's model for its own thinking: summarize this, classify that. The server hands over a question and gets an answer; it never touches the keys or your conversation.
sampling/createMessage
- isthe server borrowing the model, through the host
- hiddenkeys, model choice, your other context
- host mayedit, refuse, or put it in front of you
- shapeone request in, one completion back
Elicitation
agentSometimes a server needs the person to decide something mid job: which flight, which folder. Elicitation is that question, asked through the agent's own UI and answered with a click.
elicitation/create
- isthe server asking the person a question
- rendered bythe host's UI; server screens never cross
- answerschema-validated; declining is a valid outcome
Roots
agentRoots are how the agent tells a server where it is welcome to work: these folders, this repo. A courtesy boundary the server should respect, not a lock.
roots/list…/list_changed
- isthe host declaring where a server should operate
- powerscoping, not enforcement; locks stay with the files
- changeany time; a notification announces the new world
specconcepts · roots
References
- The specificationthe normative text
- Architecture overviewhost, client, server, officially drawn
- Who can talk to whom?our essay on the boundaries underneath
- The roadmapwhat changes next
fin · spec revisions welcome