MCP Servers in Claude Code: Connect It to Your Tools (2026)
MCP servers let Claude Code read and act on your other systems: databases, issue trackers, design files and business apps. How to add one, which scope to choose, how sign-in works and how to limit what each server can do.
An MCP server connects Claude Code to another system, such as a database, an issue tracker or a payments account, through the open Model Context Protocol. Add one with claude mcp add, choose local, project or user scope, sign in through /mcp, and set permission rules for which of its tools Claude may call.
The Model Context Protocol (MCP) is an open-source standard for connecting AI applications to outside systems such as files, databases and other tools. In Claude Code, an MCP server is the piece that gives Claude access to one of those systems. Anthropic's MCP documentation suggests connecting a server when you find yourself copying data into chat from another tool, such as an issue tracker or a monitoring dashboard. Once it's connected, Claude reads and acts on that system directly.
For an owner or operations lead building internal tools, that might be the database behind a quoting app, the payments account, the CRM or the ticket queue. If Claude Code itself is new to you, start with What Is Claude Code?.
What you can ask once a server is connected
The docs give requests like these:
- "Add the feature described in JIRA issue ENG-4521 and create a PR on GitHub."
- "Find emails of 10 random users who used feature ENG-4521, based on our PostgreSQL database."
- "Update our standard email template based on the new Figma designs that were posted in Slack."
Each one works only if the matching servers are connected and signed in.
Add your first server
The quickstart uses Anthropic's documentation server, which needs no sign-in. Run this in your terminal, outside a Claude Code session:
claude mcp add --transport http claude-code-docs https://code.claude.com/docs/mcpThe name after the transport flag is one you choose. Claude Code uses it to label the server's tools and in commands such as claude mcp remove. Then run claude mcp list to see the server and its status.
The three kinds of server
Remote HTTP servers are the recommended option for cloud services:
claude mcp add --transport http notion https://mcp.notion.com/mcp
# With a token sent as a header
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"Some services still offer only SSE, an older transport that Anthropic marks as deprecated. From Claude Code v2.1.265, the same --transport http command tries HTTP first and switches to SSE when the server needs it.
Local stdio servers run as a program on your own machine. Everything after the -- is the command that starts the server, and --env passes it a key:
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-serverWebSocket servers exist too, for servers that push events to Claude. You add those with claude mcp add-json or in .mcp.json.
Choose who gets the server
The scope decides which projects load the server and whether your team shares it:
| Scope | Loads in | Shared with the team | Stored in |
|---|---|---|---|
| Local, the default | This project only | No | ~/.claude.json |
| Project | This project only | Yes, through version control | .mcp.json in the project root |
| User | All your projects | No | ~/.claude.json |
Add --scope project or --scope user to the add command to change it. When the same server name appears in more than one scope, Claude Code uses the local definition first, then project, then user.
A project .mcp.json can reference environment variables, so the file can be committed without anyone's key in it:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}Claude Code reads its own credentials, such as ANTHROPIC_API_KEY, as empty when they appear in a remote server's URL or headers, so a shared file can't send them to a server it names. In an interactive session, Claude Code asks you to approve a project's .mcp.json servers before it uses them, and claude mcp reset-project-choices clears those answers. A claude -p run can't show that prompt and loads them without asking.
Signing in
Many remote servers use OAuth. Run /mcp inside Claude Code, select the server and sign in from its menu, or run claude mcp login <name> in your shell. A claude -p script can't run the sign-in, so sign in from an interactive session first.
If you log in to Claude Code with a claude.ai account, the connectors you added at claude.ai appear in /mcp without extra setup. That only happens with a claude.ai subscription login. It doesn't happen when an Anthropic API key is in use.
Examples worth copying
GitHub's remote server takes a fine-grained personal access token limited to the repositories you want Claude to work in:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_PAT"The add command saves the configuration without checking the token. Run /mcp afterwards and look for a checkmark on the server's row.
For a database, the docs use DBHub with a read-only database user, so the queries Claude runs can't change data:
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
--dsn "postgresql://readonly:pass@prod.db.com:5432/analytics"After that you can ask questions such as "Show me the schema for the orders table" or "Find customers who haven't made a purchase in 90 days".
Limit what each server can do
Every tool from a server appears in Claude Code as mcp__<server>__<tool>. Permission rules in a settings file use the same names. mcp__github__* matches every tool from the github server, and a full tool name matches one tool. Put the read-only tools you trust under permissions.allow and anything that writes or deletes under permissions.ask or permissions.deny. The permissions page explains the rule syntax, and the settings page explains which settings file reaches whom.
Anthropic's docs warn you to check that you trust each server before connecting it, because a server that fetches outside content can expose you to prompt injection. Use the narrowest account that does the job, such as a read-only database user or a token limited to the repositories involved.
Large results and many servers
Claude Code shows a warning when one tool result passes 10,000 tokens, and the default maximum is 25,000 tokens. A text result over the maximum is saved to a file, and Claude reads the file when it needs the content. The MAX_MCP_OUTPUT_TOKENS environment variable changes the limit.
With tool search, only tool names and server instructions load at the start of a session, and full tool definitions load when Claude needs them. Adding more servers then has little effect on context, and Claude Code sets no fixed cap on tools per server.
Day-to-day commands
claude mcp list shows every server with a status such as connected, needs authentication or failed to connect. claude mcp get <name> shows one server's details, and claude mcp remove <name> deletes it. Inside a session, /mcp shows the same status and handles sign-in. To build a server of your own, the Model Context Protocol site has a server guide, and Anthropic lists reviewed connectors in its directory at claude.ai/directory.
Sources
- Connect Claude Code to tools via MCP (Anthropic documentation) (checked 2026-12-02)
- Connect to MCP servers, quickstart (Anthropic documentation) (checked 2026-12-02)
- What is the Model Context Protocol? (modelcontextprotocol.io) (checked 2026-12-02)
- Configure permissions: rules for MCP tools (Anthropic documentation) (checked 2026-12-02)
- Settings files and precedence (Anthropic documentation) (checked 2026-12-02)
Get the next one.
Field notes from real deployments, written the way this one was. No schedule promised and nothing sold to you. Unsubscribe whenever.
Frequently asked questions
What is MCP in Claude Code?
MCP, the Model Context Protocol, is an open-source standard for connecting AI applications to outside systems. In Claude Code, an MCP server gives Claude access to a tool, database or API, so it can read and act on that system instead of working from text you paste in.
How do I add an MCP server to Claude Code?
Run claude mcp add in your terminal. For a hosted server, use --transport http with a name and the server's URL. For a local program, use --transport stdio and put the start command after --. Then run claude mcp list or /mcp to check the connection.
What's the difference between local, project and user scope?
Local, the default, loads the server only in the current project and keeps it private, stored in ~/.claude.json. Project scope writes it to .mcp.json so your team gets it through version control. User scope loads it in all your projects and keeps it private.
Are MCP servers safe to use?
Anthropic's docs say to check that you trust each server before connecting it, because one that fetches outside content can expose you to prompt injection. Use read-only or narrowly scoped credentials, keep keys in environment variables, and set permission rules for which of a server's tools Claude may call.
Can I build my own MCP server?
Yes. The Model Context Protocol site has a guide to building servers, and Anthropic's docs point to its connector-building docs for authentication, testing and listing in its directory. A local server you build runs with claude mcp add --transport stdio.
Need help implementing this?
Prometheus does AI consulting and implementation, remote, with onsite days available in Milwaukee. We set it up, train your team, and make sure it works.
let's talk
