title: "MCP Servers" last_updated: 2026-03-21 status: experimental difficulty: intermediate prerequisites: [04-hooks-and-commands]

MCP Servers

Coming in V2. This module is scaffolded with an outline.

Core Question

How do I extend agent capabilities with external tools and data?

Module Outline

Concepts

  1. What is MCP (Model Context Protocol)? — An open protocol for connecting AI agents to external tools, data sources, and services. MCP servers expose capabilities that agents can discover and invoke.

  2. Why MCP matters — Without MCP, your agent can only read files, run commands, and search. With MCP, it can query databases, call APIs, access knowledge bases, manage cloud infrastructure, and more.

  3. The MCP architecture — Client (the AI agent) ↔ Server (your tool/service) ↔ Resource (the actual data or capability). Servers declare what they can do; clients discover and use those capabilities.

  4. Built-in vs. custom MCP servers — Many tools come with pre-built MCP servers (databases, GitHub, Slack, etc.). You can also build custom servers for your specific tools and workflows.

  5. When to use MCP vs. bash commands — MCP provides structured, discoverable interfaces. Bash is ad-hoc. Use MCP when you want the agent to understand what's available and use it reliably.

  6. Security considerations — MCP servers can access sensitive resources. Permission models, scoping, and audit logging matter.

Tool-Specific Content

  • Claude Code: MCP server configuration in settings.json, built-in MCP support, connecting to databases, APIs, custom tools
  • Codex CLI: MCP support status, alternative approaches, Agents SDK integration

Exercises

  1. Connect to a pre-built MCP server (e.g., filesystem, GitHub)
  2. Use an MCP-connected agent to query a database
  3. Build a minimal custom MCP server
  4. Compare agent performance with and without MCP tools available

Key Resources