Skip to main content
MCP

Model Context Protocol

Active

Open standard for connecting LLM applications to external tools, data sources, and prompt templates. Defines how AI hosts communicate with MCP servers over JSON-RPC 2.0.

AI AgentsLLMJSON-RPC 2.02024Anthropic
TransportsToolsErrors

In one line

MCP (Model Context Protocol) is an open standard by Anthropic (Nov 2024) that defines how LLM applications connect to external tools, resources, and prompts. Servers expose primitives over JSON-RPC 2.0 via stdio or Streamable HTTP. Any MCP client – Claude Desktop, Cursor, VS Code – works with any MCP server without custom integration code.

Quick Reference

FieldSizeDescription
Wire formatJSONJSON-RPC 2.0 messages, UTF-8 encoded, newline-delimited over stdio
initializeRequiredFirst message: client sends capabilities, server responds with its capabilities
tools/listRequestClient requests available tools from the server
tools/callRequestClient invokes a specific tool with arguments
resources/listRequestClient requests available resources (files, DB schemas, etc.)
resources/readRequestClient reads a specific resource by URI
prompts/listRequestClient requests available prompt templates
prompts/getRequestClient retrieves a specific prompt template with arguments

Key Characteristics

Primitive-based

Three primitives: tools (callable functions), resources (readable data), prompts (templates). Every server exposes a subset.

Bidirectional

Both client and server can send requests. Servers can request sampling (LLM calls) from clients that support it.

Transport-agnostic

stdio for local processes. Streamable HTTP for remote servers. Same JSON-RPC messages over both.

Capability negotiation

initialize handshake declares which features both sides support. Clients and servers negotiate at connection time.

Message Format

Request
http
// MCP initialize (JSON-RPC 2.0 over stdio)
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{"tools":{},"resources":{},"prompts":{}},"clientInfo":{"name":"claude-desktop","version":"1.0.0"}}}

// Server response
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":true},"resources":{"subscribe":true}},"serverInfo":{"name":"my-mcp-server","version":"1.0.0"}}}

// tools/call
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_weather","arguments":{"location":"San Francisco","units":"celsius"}}}
Response
http
// Tool result
{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"San Francisco: 18°C, Partly cloudy. Wind: 15 km/h SW."}],"isError":false}}

// Error response (JSON-RPC error)
{"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Method not found","data":{"method":"tools/call","tool":"get_weather"}}}

Implementations

linuxsince MCP SDKs: TypeScript, Python, Rust, Go, Javaavailable
macossince Claude Desktop, Cursor, VS Code MCP extensionavailable
windowssince Claude Desktop, Cursor, VS Code MCP extensionavailable
iossince Via HTTP transportavailable
androidsince Via HTTP transportavailable