Claude Code MCP — Add Tools to Your Terminal AI
Learn how to configure, use, and build MCP servers for Claude Code. Connect your terminal AI to databases, APIs, browsers, and custom tools through the Model Context Protocol.
Claude Code MCP lets you extend Claude Code — Anthropic's terminal-based AI assistant — with custom tools, data sources, and integrations through the Model Context Protocol. Add database access, browser automation, file management, and any other capability your workflow needs.
What Is Claude Code MCP?
Claude Code is Anthropic's command-line AI assistant for developers. Out of the box, it can read and write files, run shell commands, and navigate codebases. MCP extends these capabilities by letting you plug in additional tools — database servers, messaging tools, browser automation, and anything else you can wrap in an MCP server.
Unlike Claude Desktop, which uses a JSON config file, Claude Code manages MCP servers through CLI commands. This makes it easy to add, remove, and scope servers to specific projects or use them globally across all your work.
Adding MCP Servers to Claude Code
Claude Code provides a built-in command for managing MCP servers. Here is how to add the most popular servers:
Project-scoped servers are stored in .mcp.json in your project root. Global servers live in your home directory config. This separation lets you keep database credentials project-specific while sharing utility tools across all projects.
Project Scope
Stored in .mcp.json — version-controlled, shared with team. Best for project-specific databases and APIs.
Global Scope
Stored in ~/.claude/ — personal settings. Best for utility tools like browser, Slack, and GitHub.
Popular MCP Servers for Claude Code
Here are the MCP servers that developers use most frequently with Claude Code:
| Server | What It Adds | Install Command |
|---|---|---|
| Postgres | SQL queries, schema exploration | claude mcp add postgres npx @anthropic/mcp-postgres |
| Playwright | Browser automation, screenshots | claude mcp add pw npx @anthropic/mcp-playwright |
| Slack | Read channels, search messages | claude mcp add slack npx @anthropic/mcp-slack |
| GitHub | Issues, PRs, code search | claude mcp add gh npx @anthropic/mcp-github |
| Filesystem | Controlled file access | claude mcp add fs npx @anthropic/mcp-filesystem |
Building Custom MCP Servers for Claude Code
When the off-the-shelf servers do not cover your needs, build a custom MCP server tailored to your workflow. Claude Code works with both stdio (local) and SSE (remote) transport. Here is a practical example — an MCP server that queries your internal API:
Then add it to Claude Code: claude mcp add internal-api python server.py --env API_TOKEN=your-token
Claude Code vs Claude Desktop MCP
| Feature | Claude Code | Claude Desktop |
|---|---|---|
| Config method | CLI commands (claude mcp add) | JSON config file |
| Scoping | Project or global | Global only |
| Transport | stdio + SSE + streamable HTTP | stdio + SSE |
| Best for | Development workflows, CI/CD | General productivity |
Frequently Asked Questions
How many MCP servers can Claude Code run simultaneously?
There is no hard limit. Claude Code can connect to dozens of servers simultaneously. Each server runs as a separate process, so the practical limit depends on your system resources.
Do MCP servers slow down Claude Code?
Minimally. Servers are lazy-loaded — they only start when Claude needs them. The connection overhead is negligible, and tool calls add only the latency of the underlying operation (database query, API call, etc.).
Can I share MCP server configs with my team?
Yes. Project-scoped configs in .mcp.json can be committed to version control. Use environment variables for secrets so the config is safe to share.
Last updated: 2026 • Browse all courses