Model Context Protocol Quick Reference
text
# Three roles
Host -- the application the user interacts with (chat app, IDE assistant)
Client -- lives inside the host, maintains one connection to one server
Server -- exposes tools / resources / prompts, wraps a real backend system
# Three things a server can expose
Tool -- model calls it with arguments, gets a result back (an action)
Resource -- readable data the host pulls in as context (no model call needed)
Prompt -- a reusable, parameterized prompt template the server offers
# Connection sequence
1. Client connects to server
2. Initialization handshake -- agree on protocol version + capabilities
3. Client lists what the server actually offers (don't assume!)
4. Model calls tools / host reads resources / prompts get used as needed
5. Results flow back through the client into the model's context
# Transport (how bytes move -- separate from the message protocol itself)
stdio -- local process on the same machine
HTTP-based -- server reachable over a network
# Security checklist before connecting a host to a new server
[ ] Does this server expose only what THIS task needs, or far more?
[ ] Does any exposed tool have real side effects (delete, send, pay)?
[ ] Do consequential tool calls require explicit human confirmation?
[ ] Is this server's connection logged, so "which server enabled this
call" is answerable after the fact, not guesswork?
[ ] Combined with every OTHER server this host is connected to, what's
the full capability surface -- not just this one server in isolation?
# Error handling
Tool execution error -- comes back as a normal, readable result
Protocol-level error -- malformed request / unsupported capability,
breaks the exchange rather than returning a result
# Verify against the current spec before relying on these
- Exact handshake message shapes and protocol version numbers
- Current role/capability terminology (actively developed protocol)
