Skip to main content
MCP

Model Context Protocol (MCP)

Connect Claude Code to external tools and data sources — databases, APIs, design tools, and more — through a standardized protocol.

What Is MCP?

MCP (Model Context Protocol) is an open standard that lets Claude Code communicate with external services. Instead of copy-pasting data into prompts, MCP servers provide Claude with direct access to tools and resources.

Think of MCP servers as plugins that give Claude new abilities beyond reading and writing files.

Configuration

MCP servers are configured in .claude/settings.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://localhost:5432/mydb"
      }
    }
  }
}

Each server has a name, a command to start it, optional arguments, and optional environment variables.

Common MCP Servers

Database Access

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": { "DATABASE_URL": "postgresql://localhost:5432/mydb" }
    }
  }
}

Claude can now query your database directly: how many users signed up this week?

Extended Filesystem

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    }
  }
}

GitHub

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_..." }
    }
  }
}

Enables: list open PRs, check CI status for PR #42, create an issue for this bug

Other Popular Servers

  • Slack — Search messages, post updates
  • Google Drive — Read documents and spreadsheets
  • Figma — Extract design specs and assets
  • Linear / Jira — Read and create issues
  • Sentry — Query error logs and exceptions

Browse the full directory at github.com/modelcontextprotocol/servers.

Configuration Scope

  • .claude/settings.json — Project-level (committed to repo, shared with team)
  • ~/.claude/settings.json — User-level (your personal servers across all projects)

Project-level settings are merged with user-level settings. Project settings take precedence for servers with the same name.

Building Your Own MCP Server

MCP servers are simple programs that communicate over stdio. You can build one in any language:

npx @modelcontextprotocol/create-server my-server

This scaffolds a TypeScript MCP server project. Define tools (actions Claude can take) and resources (data Claude can read), then configure it in your settings.

MCP is how agents connect to the world

The Model Context Protocol defines a universal interface between AI agents and external tools. Understanding MCP helps you see how agent systems are built — from single-tool agents to complex multi-service orchestration.

Learn about Tool Use & agent architecture

Next Steps

  • Skills & Subagents — Modular capabilities that can use MCP tools
  • Hooks — Automate actions around MCP tool use
  • Workflows — Integrate MCP into development workflows