Protocol Primitives
MCP defines three primitives, each with a different control model that determines who initiates the interaction.
| Primitive | Control | Description | Example |
|---|---|---|---|
| Tools | Model-controlled | Functions the AI model can invoke to take actions or retrieve data | get_weather(), query_db() |
| Resources | App-controlled | Structured data the host application can expose to the model as context | file://project/src, config://app |
| Prompts | User-controlled | Templated messages and workflows the user selects from a menu | explain_code, review_pr |
The control model matters for safety. Tools are model-initiated (the AI decides to call them), resources are application-initiated (the host decides what context to attach), and prompts are user-initiated (the human picks a workflow). This layered control keeps humans in the loop.
Transport Comparison
| Transport | Use Case | Communication | Auth |
|---|---|---|---|
| stdio | Local processes, CLI tools, IDE extensions | stdin/stdout JSON-RPC messages | OS process isolation |
| Streamable HTTP | Remote servers, cloud services, multi-client | HTTP POST + optional SSE streaming | OAuth 2.1 / API keys |
Core JSON-RPC Methods
| Method | Direction | Description |
|---|---|---|
initialize |
Client → Server | Handshake: exchange protocol version and capabilities |
tools/list |
Client → Server | Discover available tools with names, descriptions, and input schemas |
tools/call |
Client → Server | Invoke a tool with arguments, receive result or error |
resources/list |
Client → Server | Discover available resources with URIs and MIME types |
resources/read |
Client → Server | Fetch content of a specific resource by URI |
prompts/list |
Client → Server | Discover available prompt templates |
prompts/get |
Client → Server | Resolve a prompt template with arguments into messages |
Capability Negotiation
During initialization, client and server declare what features they support. Only negotiated capabilities are used during the session.
Client Capabilities
Features the client can provide to the server
roots · sampling · elicitation
Server Capabilities
Features the server offers to the client
tools · resources · prompts · logging · completions