Claude Code MCP: Add, Configure, and Use MCP Servers
Claude Code is one of the first hosts to ship Model Context Protocol support out of the box. This page covers what "Claude Code MCP" actually means, how to add servers with the claude mcp add command, the three config scopes, the MCP servers most Claude Code users install, and how the experience differs from Cursor or Windsurf.
The short answer
Claude Code is Anthropic's terminal-native AI coding assistant. Out of the box it talks to Claude (the model) and your filesystem. Once you add MCP servers, that same Claude session can also call GitHub, query a Postgres database, run Playwright in a real browser, search Reddit, transfer files to a different AI agent, or anything else an MCP server exposes as a tool.
Two things to understand:
- MCP is the protocol, not a Claude-specific feature. See What is Model Context Protocol for the spec, primitives, and wire format.
- Claude Code is one of several MCP hosts. Cursor, Windsurf, OpenClaw, OpenCode, Continue.dev, Zed, and Cline all speak the same protocol. A server you add to Claude Code today will work in any of them tomorrow with no code change.
What "Claude Code MCP" actually means
Three pieces interact when you say "Claude Code MCP":
- The host. Claude Code itself, running in your terminal. Owns the conversation, the model session, and the user-facing chat.
- The MCP client. The part of Claude Code that speaks the protocol. Reads your config, spawns each MCP server as a child process, manages JSON-RPC messages, registers each server's tools with the model.
- The MCP server. The external program. Could be written by Anthropic, by a vendor (GitHub, Stripe, Cloudflare), or by a third party. Announces tools, resources, and prompts at handshake. Executes calls the host routes to it.
When the model decides to call a tool, the flow looks like this: model emits a tool-call message, Claude Code routes it to whichever MCP server registered that tool name, the server runs the implementation, the result returns to the model as the tool's response. The whole exchange is JSON-RPC 2.0 over stdio (or HTTP+SSE for remote servers).
How to add an MCP server to Claude Code
The shortest path: the claude mcp add command. Open a terminal in any project and run it.
# Add the AgentDrop MCP server (file transfer between AI agents)
claude mcp add agentdrop -- npx -y @agentdrop/mcp-server
# Add the GitHub MCP server
claude mcp add github -- npx -y @modelcontextprotocol/server-github
# Add a server with environment variables
claude mcp add postgres -e DATABASE_URL=postgresql://localhost/mydb -- \
npx -y @modelcontextprotocol/server-postgresFormat: claude mcp add <name> [flags] -- <command> [args...]. The double dash separates Claude Code's flags from the command-and-args that get spawned as the server. Common flags:
--scope project|user|local. Which config file to write to. Default is project. See the next section.-e KEY=VALUE. Environment variables passed to the server when spawned. Repeatable.--transport stdio|sse|http. Almost alwaysstdio(the default). Use HTTP/SSE only for remote servers.
Verify it landed with claude mcp list. Restart your Claude Code session and the new tools appear in the model's tool list. Remove servers with claude mcp remove <name>.
If you prefer config-as-code, edit the JSON directly. Claude Code reads the same files the CLI writes. Drop a .mcp.json at the repo root with the structure below and Claude Code picks it up next session.
{
"mcpServers": {
"agentdrop": {
"command": "npx",
"args": ["-y", "@agentdrop/mcp-server"],
"env": {
"AGENTDROP_API_KEY": "agd_..."
}
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}
}
}The three config scopes
Claude Code reads MCP configs from three locations. Each has a different purpose. Order of precedence: local overrides project overrides user.
Project scope
Lives in .mcp.json or .claude/mcp.json at your repository root. Commits to git. Travels with the repo. A new contributor who clones the project and runs Claude Code gets the same MCP setup automatically. Use this for servers the whole team needs (the project's database, its file transfer service, its test runner).
User scope
Lives in ~/.claude.json on macOS and Linux, or %USERPROFILE%\.claude.json on Windows. Applies to every project you open with Claude Code. Use this for personal tools you want everywhere: GitHub access, your own filesystem permissions, a memory server, a personal note-taking MCP.
Local scope
A private overlay that overrides both project and user without being committed. Useful for personal credentials in a shared repo, or for experimenting with a server you do not yet want the team to depend on. Created automatically when you pass --scope local to claude mcp add.
The same MCP server name in two scopes resolves by precedence: local beats project, project beats user. This lets you keep team defaults in .mcp.json while pinning a different version of the same server in your local overlay.
The MCP servers most Claude Code users install
Looking at the public MCP server directories and Claude Code-tagged GitHub stars in 2026, the servers most Claude Code users actually install fall into seven groups.
Anthropic reference servers
Filesystem, git, GitHub, GitLab, Postgres, SQLite, fetch, memory, Sentry, Slack. MIT-licensed and maintained at github.com/modelcontextprotocol. If you install only one MCP server, install filesystem.
Browser automation
Playwright MCP is the dominant one (4.1K Bing impressions per quarter for the head term). Lets Claude Code drive a real browser: take screenshots, fill forms, scrape rendered HTML, click through flows. Indispensable for QA work.
Database access
Postgres and SQLite from the reference servers. Postgres MCP gets installed for analytics and data exploration. SQLite is used as a quick scratchpad inside Claude Code sessions, not just as production access.
Code review and repo metadata
GitHub MCP server (6.5K Bing impressions) for repo browsing, PR review, issue management. The official Microsoft Azure MCP server for cloud resources.
Memory and context
Mem0 (long-term memory across sessions), Matrix (semantic memory specifically tuned for Claude Code, hit Hacker News in early 2026), and the official Anthropic memory server. Used by power users who want Claude Code to remember decisions across sessions.
Agent-to-agent communication
AgentDrop runs as an MCP server in Claude Code (the package is @agentdrop/mcp-server). Once installed, the Claude Code session has tools for sending encrypted files to other AI agents (Cursor, OpenCode, OpenClaw, another Claude Code instance), checking its own inbox, and downloading received files. Useful when work spans multiple agents on different machines or accounts.
Cloud and infrastructure
Cloudflare (Workers, KV, R2, DNS), AWS (now in Bing top 10 SERP since GA), Stripe, Vercel. Each major cloud vendor ships an official MCP server in 2026.
For a curated directory grouped by category, see MCP servers directory. For a deeper look at the server side specifically, see What is an MCP server.
Claude Code MCP versus Cursor and Windsurf
All three are MCP-aware hosts. The protocol is identical: a server you write today works in all three with no code change. Where they differ is config layout, CLI ergonomics, and a few feature decisions.
Config file location
- Claude Code:
.mcp.json/.claude/mcp.json(project) plus~/.claude.json(user) - Cursor:
.cursor/mcp.json(project) plus~/.cursor/mcp.json(user) - Windsurf:
~/.codeium/windsurf/mcp_config.json(single global file)
Same JSON shape across all of them. The config schema lives in the MCP spec, not in any host. You can copy a working entry from one file to another and it just runs.
CLI ergonomics
Claude Code ships claude mcp add, claude mcp list, and claude mcp remove. Cursor and Windsurf expect you to edit JSON directly. The CLI helpers do not change anything the host can do; they are just a faster way to write the same JSON entries.
Feature parity
The MCP spec has three primitives: tools, resources, prompts. All three hosts support tools fully. Resources are supported but underused (most servers ship tools first). Prompts adoption varies: Claude Code surfaces them as slash commands, Cursor shows them as quick actions, Windsurf adds them to its command palette.
The wire format is the spec
Anything specific to one host is a UI choice, not a protocol difference. The model-to-server contract (JSON-RPC 2.0, the handshake, the tool/resource/prompt structures) is shared. This matters because it means you do not pick a host for its MCP ecosystem; the ecosystem is shared.
Common Claude Code MCP problems and fixes
Server installs but tools never show up
The most common cause is a forgotten restart. Claude Code reads MCP config at session start. After claude mcp add, exit and reopen the session. Run claude mcp list to confirm the server is registered, then check that the model can see the tools by asking it directly ("list the tools you have access to").
Server crashes immediately on startup
Run the spawn command manually outside Claude Code with the same environment variables. Most spawn failures are missing dependencies (npx -y fixes most of these), wrong Node version, or missing API keys. Claude Code surfaces server stderr in its log but does not always show it inline.
"command not found" on Windows
Windows resolves npx to npx.cmd. If your config uses just npx, switch to npx.cmd or use the full path. Equivalently, configure the server with cmd /c npx -y ... as the command.
Conflicting tool names across servers
Two MCP servers can both expose a tool called read_file. Claude Code routes by the name, so the second server's read_file masks the first. Either rename one of them in its source (most servers expose this through env config) or remove the one you do not need.
Slow startup with many servers
Each MCP server spawns as a separate process at session start. Twelve servers means twelve child processes initialising in parallel. If startup feels slow, audit your claude mcp list and remove anything you have not used this month. Project-scope servers committed in .mcp.json tend to accumulate; the ones in user scope tend to be the ones actively used.
AgentDrop as an MCP server in Claude Code
The agent-to-agent communication group above mentions agent-drop.com in passing. Quick concrete summary for Claude Code users specifically:
Install:
claude mcp add agentdrop -e AGENTDROP_API_KEY=agd_... -- \
npx -y @agentdrop/mcp-serverOnce installed, the Claude Code session has tools to send a file to another AI agent (send_file), check the inbox of files others have sent (check_inbox), and download a transfer (download_transfer). Encryption is end-to-end with X25519 ECDH key exchange and AES-256-GCM. Files never leave R2 in plaintext. The free tier covers 50 transfers and 50 MB files per month, no card required. For the cryptography in detail, see Encrypted file transfer for AI agents. For a worked Claude Code to Cursor handoff example, see MCP server for file transfer.
Where Claude Code MCP is going
Three trends from May 2026 worth tracking:
Enterprise vendors crowding the directory. AWS hit general availability and now ranks in the Bing top 10 for "mcp server". Microsoft has three SERP slots (learn.microsoft.com, visualstudiomagazine.com, code.visualstudio.com). Google Cloud, Cloudflare, Stripe, and Figma all ship official servers. Five years of cloud-vendor lock-in habits are migrating into the MCP layer in Claude Code.
India and emerging markets are the fastest growth segment. Zerodha's Kite Connect MCP server (Zerodha has 30 million retail trading clients in India) introduced a generation of Indian developers to MCP through a financial-services use case. India is now the number-one market for "what is mcp server" on Bing (2.7K vs 1.7K in the US). Claude Code adoption follows.
Cross-host workflows are normal. The same developer uses Claude Code for backend work, Cursor for frontend, and OpenCode on a different machine. The MCP server they wrote for one runs in all three. The interesting layer is no longer the host; it is what the servers do, who they connect to, and how secure the transit between agents is. AgentDrop sits in that layer.
FAQ
How do I add an MCP server to Claude Code?
Run claude mcp add <name> -- <command> [args...] from your terminal. Claude Code writes the entry to your project or user config, restarts the server on next session, and registers its tools with the model. Manual edits to .mcp.json or ~/.claude.json work too if you prefer config-as-code.
What does the claude mcp add command do?
It writes a JSON entry to either your project config (.mcp.json or .claude/mcp.json), your user config (~/.claude.json), or a local-scoped file, depending on the --scope flag. The entry tells Claude Code how to spawn the MCP server: which command to run, which arguments, which environment variables.
Where does Claude Code store MCP server configs?
Three scopes. Project scope lives in .mcp.json or .claude/mcp.json at the repo root and ships in version control. User scope lives in ~/.claude.json and applies across every project. Local scope is a private overlay that does not get committed. Order of precedence: local beats project, project beats user.
Can Claude Code use MCP servers across projects?
Yes. Servers added at user scope (~/.claude.json) are available in every project you open with Claude Code. Project-scoped entries in .mcp.json travel with the repo so a new contributor cloning the project gets the same MCP setup automatically.
What is the best MCP server for Claude Code?
Depends on the workflow. The most-used by Claude Code users in 2026 are filesystem and git from the Anthropic reference servers, GitHub for repo metadata, Playwright for browser automation, Postgres or SQLite for database queries, and AgentDrop for sending files to other AI agents on different machines. The MCP servers directory has more grouped by category.
How is Claude Code MCP support different from Cursor or Windsurf?
All three are MCP-aware hosts running the same protocol, so a server written once works in all of them. Differences are in config layout (Claude Code uses .mcp.json or ~/.claude.json, Cursor uses ~/.cursor/mcp.json, Windsurf uses ~/.codeium/windsurf/mcp_config.json), CLI ergonomics (Claude Code has claude mcp add, others edit JSON directly), and which MCP features each ships first. The protocol itself is identical.
Where to go next
Related guides on agent-drop.com:
- What is Model Context Protocol - the open standard Claude Code, Cursor, and Windsurf all implement
- What is an MCP server - focused on the server side: how they expose tools, how to install, real examples by category
- MCP servers directory - curated list grouped by what they do, with Claude Code install commands
- MCP server for file transfer - how AgentDrop drops into Claude Code as an MCP server, plus a Claude Code to Cursor handoff walkthrough
- Encrypted file transfer for AI agents - the cryptography layer used by the AgentDrop MCP server
For the canonical Claude Code MCP documentation, visit code.claude.com/docs/en/mcp. To run AgentDrop as an MCP server in Claude Code in about 60 seconds, the quickstart gets you running. Free tier: 50 transfers and 50 MB files per month, no card required.