# 3.1 Model Context Protocol (MCP)

A JSON-RPC standard that collapses M×N integrations into M+N.

1. Bespoke connectors: M × N = 12 integrations.
2. MCP: one JSON-RPC protocol, M + N = 7 adapters.
3. Server primitives: Tools, Resources, Prompts.
4. Any host invokes any server via tools/call.

- **Use when:** Tools must be portable across hosts.
- **Avoid:** Eagerly loading every server schema: pair with tool search or Code Mode.

```
# what can this server do?
-> { method: "tools/list" }
<- { tools: [{ name: "query_sql", ... }] }

# use one of its tools
-> { method: "tools/call",
     params: { name: "query_sql", arguments: { sql } } }
<- { content: [{ type: "text", text: "42 rows" }] }
```

## References

- [MCP architecture overview](https://modelcontextprotocol.io/docs/learn/architecture) (MCP)
- [MCP specification](https://modelcontextprotocol.io/specification/latest) (MCP)
- [Code execution with MCP](https://www.anthropic.com/engineering/code-execution-with-mcp) (Anthropic)
- [Writing effective tools for AI agents](https://www.anthropic.com/engineering/writing-tools-for-agents) (Anthropic)
