Claude Code MCP Servers: Connect Any Tool via Model Context Protocol
By Tyler Cyert
Claude Code MCP servers connect your coding agent to external tools, databases, and APIs through the Model Context Protocol — an open standard for AI-tool integrations. Instead of copying data into chat or running commands manually, MCP lets Claude interact with services directly.
MCP stands for Model Context Protocol. It is an open-source standard that defines how AI assistants communicate with external tools. Claude Code has built-in MCP support — you configure servers in your settings.json and Claude gains access to their tools automatically.
What MCP Servers Provide
MCP servers can expose three types of capabilities:
| Capability | What It Does | Example |
|---|---|---|
| Tools | Functions Claude can call | Create a GitHub issue, query a database |
| Resources | Data Claude can read | File contents, API responses |
| Prompts | Pre-built instruction templates | "Summarize this PR," "Generate migration" |
Most MCP servers focus on tools — giving Claude the ability to take actions in external systems.
Adding an MCP Server
Add MCP servers to your settings.json under the mcpServers key. Each entry specifies a command to start the server, args for command-line arguments, and optional env for environment variables.
For example, adding the GitHub MCP server requires specifying npx as the command, the server package as an argument, and a GITHUB_TOKEN environment variable.
You can also add MCP servers via the command line with claude mcp add.
Where MCP Config Lives
| File | Scope | Use Case |
|---|---|---|
.mcp.json | Project (git-tracked) | Shared MCP servers for the team |
.claude/settings.local.json | Project (gitignored) | Personal servers with API keys |
~/.claude/settings.local.json | Global (gitignored) | Servers available in every project |
Separate configuration from secrets. Put the server definition in .mcp.json (committed) and the API key in settings.local.json (gitignored).
Popular MCP Servers
GitHub
Lets Claude create issues, review PRs, manage branches, and search repositories without leaving your terminal. One of the most useful starting points.
Database Servers
Connect Claude to PostgreSQL, MySQL, or SQLite. Claude can query your database, inspect schemas, and help debug data issues with real data instead of guessing.
Filesystem Server
Gives Claude controlled access to directories outside your project. Useful when your workflow spans multiple repositories or needs to read configuration from a shared location.
Custom Internal Servers
Build your own MCP server to connect Claude to internal APIs, deployment systems, or monitoring tools. The MCP SDK supports TypeScript and Python.
Context Management
One concern with MCP servers is context consumption. Every tool definition from every connected server gets loaded into Claude's context. Claude Code uses Tool Search to manage this — it dynamically loads only the tool definitions needed for each task rather than loading all tools from all servers at once.
Security Considerations
MCP servers run as separate processes with access to your system. Treat them like any other dependency:
- Review what you install. Only use servers from trusted sources.
- Scope permissions. Give servers the minimum access they need.
- Use gitignored files for secrets. API keys go in settings.local.json, never in committed config.
- Monitor tool usage. Claude Code logs which MCP tools it calls.
Building Your Own MCP Server
If you need Claude to interact with an internal system, you can build a custom MCP server. The MCP SDK is available in TypeScript and Python. A basic server defines a set of tools (functions with input schemas), starts a server process, and communicates with Claude Code over stdio.
The pattern is straightforward: define tools with names, descriptions, and input schemas. Claude sees the tool descriptions and calls them when relevant. Your server executes the function and returns the result.
MCP in Multi-Agent Workflows
MCP servers are especially powerful in agent orchestration setups. Different agents can use different MCP servers based on their role — a research agent connects to search APIs, a database agent connects to your data layer, a deployment agent connects to your CI/CD system. Define which servers each agent needs in your .claude/ configuration.
MCP Servers in a DotBox Setup
Configuring MCP servers requires JSON with the right schema, separating credentials from configuration, and deciding what goes in project vs. global settings. DotBox sets up the agents that will use those servers: draw the system, copy the setup prompt, and add a line naming the servers you want in .mcp.json before you paste it. Keep credentials out of the prompt; have the agent reference environment variables instead.