MCP Servers
MCP (Model Context Protocol) is how Claude Code connects to external tools and data sources. It is a bidirectional JSON-RPC 2.0 protocol with capability negotiation, session state, and structured primitives. Not an API. Not a plugin system. A protocol.
Why MCP Matters
Without MCP, Claude Code operates in a closed loop: it reads files, writes files, and runs shell commands. MCP breaks that boundary. A connected MCP server gives Claude direct access to databases, monitoring dashboards, CI/CD pipelines, GraphQL endpoints, and any system you can wrap in a tool interface. The agent stops guessing and starts querying.
Build vs. Reuse
| Situation | Approach |
|---|---|
| Standard service (GitHub, Datadog, Postgres) | Use an existing MCP server |
| Internal API or proprietary system | Build a custom server |
| Need fine-grained access control | Build a custom server with scoped permissions |
| Quick prototype or exploration | Use DBHub or a generic REST wrapper |
| Enterprise deployment with policy controls | Use managed-mcp.json with allowlists |
The ecosystem has production-grade servers for GitHub, Datadog, Grafana, PostgreSQL, MySQL, Jenkins, and GraphQL. Building custom makes sense when you need domain-specific tool descriptions, output shaping, or access control that generic wrappers cannot provide.
What's Inside
Explore the sub-pages for deep expertise:
- Mental Model -- How the MCP protocol works under the hood: transports, handshakes, tool discovery, and the security model
- Playbook -- Building production MCP servers in TypeScript and Python, plus configuration patterns for databases, APIs, and CI/CD
- Compositions -- MCP servers combined with hooks, skills, subagents, CLAUDE.md, and memory for integrated workflows
- Pitfalls -- Startup failures, timeout traps, transport corruption, security risks, and debugging strategies
Mental Model
The MCP protocol internals — transport layers, capability negotiation, tool registration, and how Claude discovers and uses MCP tools.
Playbook
Building production MCP servers — database queries, API wrappers, monitoring integration, and CI/CD servers with full implementation examples.
Compositions
MCP servers combined with hooks, skills, agents, CLAUDE.md, and memory for integrated external tool workflows.
Pitfalls
Startup failures, timeout traps, transport issues, security risks, and debugging MCP communication problems.