Before MCP, every agent framework re-implemented every integration. MCP defines a JSON-RPC 2.0 protocol between an MCP host/client (your agent) and MCP servers (capability providers), so one server works with any compliant client.
Three primitives:
- Tools — callable functions with JSON Schema input (model-controlled). - Resources — readable content addressed by URI (application-controlled). - Prompts — reusable parameterised prompt templates (user-controlled).
Transports: stdio for local servers launched as subprocesses, and streamable HTTP for remote servers. The client calls `initialize`, then `tools/list`, then `tools/call`.
json
{ "jsonrpc": "2.0", "id": 4, "method": "tools/call",
"params": { "name": "read_file", "arguments": { "path": "README.md" } } }The payoff is composition: connect a Postgres server, a filesystem server, and your internal API server, and the agent gains all three tool sets without new adapter code.
Exercise: list the capabilities of a local MCP server over stdio and print the tool names and schemas it advertises.