How to Add MCP Servers to Claude Code (2026)
If you want to know how to add mcp servers to claude code, this guide walks you through the whole process in plain language. You will learn the essential background first, then follow clear steps, avoid the mistakes that catch most beginners, and finish with answers to the questions people ask most often. No specialist knowledge is assumed, and every step explains not just what to do but why it matters, so you can adapt the method to your own situation instead of following instructions blindly.
Claude Code connects to MCP servers from the terminal using the claude mcp command, which stores server definitions in user, project, or local scopes. Each server extends what the coding assistant can do, from querying databases to browsing documentation and managing tickets.
Understanding How to add mcp servers to claude code
Scope is the key idea to understand first: user scope applies everywhere, project scope is shared with your team through a checked-in file, and local scope applies only to you in one project. Picking the right scope avoids leaking personal servers into shared repositories.
It also helps to set expectations before you begin. Most people get a good result on their first attempt by working slowly and checking each stage as they go, rather than rushing to the finish. Keep your original files, accounts, or materials safe until the new result is confirmed, and treat your first run as a learning pass: the second time you do this, it will take half as long and feel far more predictable.
What You Need Before You Start
Preparation is the difference between a smooth ten-minute job and a frustrating afternoon. Gather everything the steps below mention before you start: the right device or software, any accounts or files involved, and enough uninterrupted time to finish. Working on a machine with a stable connection and up-to-date software prevents most mid-process failures.
- Your main tool or device — ready, updated, and signed in where needed.
- The files, content, or information the task works on, kept in one easy-to-find place.
- A backup or copy of anything important, so a mistake never becomes a loss.
- A little patience — a careful first attempt beats two rushed ones.
Useful servers for coding include database servers for Postgres or SQLite, the GitHub server for issues and pull requests, documentation servers, and browser automation servers for testing web apps. Project scope stores servers in a .mcp.json file at the repository root, which teammates approve when they first open the project.

Step-by-Step: How to add mcp servers to claude code
Follow these steps in order the first time you try this. Each one builds on the last, and skipping ahead is the most common reason people have to start over. Once the process feels familiar, you can safely combine or reorder steps to suit your own workflow.
Step 1: Check the exact add syntax. Run claude mcp add with the server name, a separator, and the command that starts the server. Use the –scope flag if you do not want the default local scope.
Step 2: Add a local stdio server. For a Node-based server the pattern is claude mcp add name — npx -y package-name, followed by any arguments the server needs, such as an allowed folder path.
Step 3: Add a remote HTTP server. For hosted servers use the transport flag for HTTP and provide the server URL. Many hosted servers then ask you to authenticate in the browser on first use.
Step 4: Set environment variables safely. Pass keys with the –env flag as KEY=value pairs. For project scope, reference environment variables instead of pasting real secrets into a file your team can read.
Step 5: List and inspect your servers. Run claude mcp list to confirm the server is registered, then claude mcp get with its name to review the stored configuration.
Step 6: Test inside a session. Start Claude Code and use the /mcp command to check connection status, then ask for a task that needs the server and approve the tool call.

How to add mcp servers to claude code: Tips That Make It Easier
Keep the number of connected servers modest: every server adds tool descriptions to the context, so ten servers you never use still cost tokens on every request. Remove servers with claude mcp remove when a project ends. If a server fails, start its command manually in a terminal to see the real error message.
Another habit worth building is checking your result the way a stranger would. Step away for a few minutes, come back, and look at the outcome with fresh eyes: small problems that were invisible while you were deep in the process become obvious. If the result will be shared, published, or relied on by someone else, this final review is not optional decoration; it is the step that protects your credibility.

Common Mistakes to Avoid
Almost every failed attempt at this task traces back to one of a handful of predictable errors. Read this list before your first attempt, and again if something goes wrong, because the fix is usually here.
- Committing real API keys. Project configuration is meant to be shared. Put placeholder references in the shared file and keep real keys in your own environment or local scope.
- Skipping the separator. Without the double dash before the server command, flags meant for the server are swallowed by the CLI and the server starts with wrong arguments.
- Adding duplicates under different scopes. The same server name in two scopes creates confusing overrides. List your servers and remove stale entries before adding new ones.
- Assuming a listed server is connected. A server can be registered but failing to start. Always check status with /mcp inside a session after adding it.
If you have already made one of these mistakes, do not panic. In most cases you can return to the last good step, correct the problem, and continue without starting from zero. The exceptions are destructive actions, which is exactly why this guide keeps reminding you to protect originals and backups along the way.
Frequently Asked Questions
What is the difference between local, project, and user scope?
Local applies to you in one project, project is shared with everyone on the repository, and user applies to all your projects on that machine.
How do I remove an MCP server from Claude Code?
Run claude mcp remove followed by the server name, and add the scope flag if it was not added at the default scope.
Why does my server show as failed?
Usually the start command is wrong, a required package is not installed, or an environment variable is missing. Running the command by hand shows the actual error.
Can MCP servers slow Claude Code down?
They add context overhead and startup work. Connect the servers a project actually needs rather than every server you own.
Conclusion
You now know how to add mcp servers to claude code from start to finish: the background that makes the steps make sense, the preparation that prevents most failures, and the checks that confirm your result is genuinely good. Work through the steps once, slowly, and keep this guide open beside you; by the second or third time, the process will feel routine. Most importantly, verify your outcome before you rely on it or share it, keep your originals safe, and improve your approach a little each time you repeat the task.

