Claude Code MCP: how to add, list and remove MCP servers (with fixes)
Every Claude Code MCP command you need, from claude mcp add to /mcp, plus which scope to pick, how .mcp.json works, OAuth sign-in and what to do when a server won't connect.

Key takeaways
- Add a remote server with claude mcp add --transport http <name> <url>, a local one with claude mcp add <name> -- <command>.
- Scopes: local (default, just you, this project), project (shared through .mcp.json in Git) and user (all your projects).
- Check servers with claude mcp list or /mcp, remove them with claude mcp remove <name>.
- Sign in to OAuth servers through /mcp or claude mcp login; keep keys out of .mcp.json with ${VAR}.
- Slow or cut-off servers: raise MCP_TIMEOUT, MCP_TOOL_TIMEOUT or MAX_MCP_OUTPUT_TOKENS.
To add an MCP server to Claude Code, run claude mcp add in your terminal. For a remote server that's claude mcp add --transport http notion https://mcp.notion.com/mcp; for a program on your computer it's claude mcp add myserver -- npx -y some-mcp-server. Then check it with claude mcp list, and type /mcp inside Claude Code to see its status and sign in. That's Claude Code MCP setup in two commands.
This guide covers the rest: the three ways servers connect, which scope to choose so your team gets the same tools, the .mcp.json file, signing in with OAuth, importing from Claude Desktop, and fixing servers that won't connect. Every command comes from Anthropic's Claude Code MCP documentation, checked on 6 December 2026. New to MCP itself? Start with what is MCP, which explains the idea; this article is the hands-on part.
Claude Code MCP commands at a glance
| You want to | Command |
|---|---|
| Add a remote server | claude mcp add --transport http <name> <url> |
| Add a local program | claude mcp add <name> -- <command> [args...] |
| Add from a JSON snippet | claude mcp add-json <name> '<json>' |
| Import from Claude Desktop | claude mcp add-from-claude-desktop |
| List your servers | claude mcp list |
| See one server's details | claude mcp get <name> |
| Remove a server | claude mcp remove <name> |
| Sign in or out (OAuth) | claude mcp login <name> / claude mcp logout <name> |
| Status and sign-in inside a session | /mcp |
How to add an MCP server in Claude Code
MCP servers reach Claude Code in one of three ways, called transports. Pick the one the server's own docs mention.
Remote HTTP servers (recommended)
Most company-run servers (Notion, Sentry, Stripe, Linear and others) are remote. You give Claude Code a name and the address:
claude mcp add --transport http notion https://mcp.notion.com/mcp
If the server uses an API key instead of a sign-in, pass it as a header:
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
Remote SSE servers (older)
Some servers still use the older SSE transport: claude mcp add --transport sse asana https://mcp.asana.com/sse. Anthropic marks SSE as deprecated, so use HTTP when a server offers both. Recent Claude Code versions try HTTP first and fall back to SSE by themselves.
Local stdio servers
A local server is a program Claude Code starts on your computer, often through npx. Everything after the double dash -- is the server's own command, passed through unchanged:
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
--env (or -e) sets environment variables for that server, which is where most local servers expect their keys. Put all Claude Code options before the --; anything after it goes to the server.
Claude Code MCP scopes: local, project or user
The --scope flag (or -s) decides where a server is saved and who gets it. This is the part people most often get wrong.
| Scope | Works in | Shared with your team | Saved in |
|---|---|---|---|
local (default) | This project only | No | ~/.claude.json |
project | This project only | Yes, through Git | .mcp.json in the project folder |
user | All your projects | No | ~/.claude.json |
- Use local for a server only you need in one project, or one that holds your personal key.
- Use project when everyone on the project should have the same tools. Commit
.mcp.json, and teammates get the server when they open the project. Claude Code asks each person to approve project servers before it uses them. - Use user for tools you want everywhere, such as a docs server. Keep this list short: every server adds tools the agent has to know about.
claude mcp add --transport http shared-server --scope project https://example.com/mcp
claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic
The .mcp.json file
Project servers live in .mcp.json at the root of your project. You can write it by hand:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}
Never commit keys in this file. Claude Code expands environment variables in command, args, env, url and headers, so each person keeps their own key in their environment:
"headers": { "Authorization": "Bearer ${API_KEY}" }
${VAR:-default} uses a default value when the variable isn't set. If you already have a JSON snippet from a server's docs, claude mcp add-json <name> '<json>' adds it in one step.
Sign in to MCP servers with OAuth
Many remote servers ask you to sign in with your account instead of pasting a key. The flow is:
- Add the server:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp - Start Claude Code and type
/mcp. - Pick the server and follow the sign-in in your browser.
You can also sign in from the shell with claude mcp login sentry. On a machine with no browser, add --no-browser: Claude Code prints the sign-in link, and you paste the address you land on back into the terminal. claude mcp logout sentry signs out.
If you signed in to Claude Code with a claude.ai account, connectors you added in claude.ai show up in Claude Code automatically, so you may already have some servers without adding anything.
Import MCP servers from Claude Desktop
Set up servers in the Claude desktop app already? Run claude mcp add-from-claude-desktop, tick the ones you want in the list, then check with claude mcp list. One catch: Claude Code server names can only contain letters, numbers, hyphens and underscores, so a Desktop server with a space in its name is skipped. The import tells you which ones it rejected.
Example: add Sentry and use it in a session
Here's the whole loop with one real server, so you can see what each step looks like.
- In your project folder, add Sentry's remote server:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp. It's saved with the default local scope, so only you get it, in this project. - Start Claude Code with
claudeand type/mcp. Sentry shows that it needs a sign-in; pick it and approve in your browser. - Ask in plain words: "look at the newest Sentry errors for this project and tell me which one to fix first". Claude Code calls Sentry's tools, reads the errors, and can then open the files involved and propose a fix.
- If the whole team should have it, remove it and add it again with
--scope project, then commit the new.mcp.json.
List, check and remove Claude Code MCP servers
claude mcp listshows every server and whether it connects.claude mcp get notionshows one server's settings and scope.claude mcp remove notiondeletes it.claude mcp reset-project-choicesclears your approve or deny answers for a project's.mcp.jsonservers, so Claude Code asks again./mcpinside a session shows live status and lets you sign in again.
When an MCP server won't connect
- Check the status first. Run
claude mcp listor/mcp. A server that needs a sign-in says so. - Slow to start? Local servers installed through
npxcan take a while the first time. Raise the start-up timeout:MCP_TIMEOUT=10000 claudegives it 10 seconds. - Tool calls time out? Set
MCP_TOOL_TIMEOUT, or add"timeout"in milliseconds to that server's entry in.mcp.json. - Output cut off? Claude Code warns when one tool returns more than 10,000 tokens, and stops at 25,000 by default. Raise it with
export MAX_MCP_OUTPUT_TOKENS=50000before starting Claude Code, or better, ask the tool for less. - Options ignored? Check the order: Claude Code's flags go before
--, the server's own arguments after it. - Wrong project? A local-scope server only exists in the folder where you added it. Use
--scope userif you want it everywhere.
You don't need to worry about too many tools slowing every request: Claude Code's tool search is on by default, so it loads a server's tools only when it needs them.
Add only servers you trust
A local MCP server is a program that runs with your user's rights, and a remote one sees whatever data you send it. Anthropic's docs say to make sure you trust each server before connecting it, and warn that servers which fetch outside content can expose you to prompt injection. Prefer the official server from the company whose service it connects to, read what a local command does before adding it, give keys the smallest permissions that work, and remove servers you no longer use. That's text in a web page or a ticket that tries to give the agent instructions, so keep approvals on for actions that change things. The what is MCP article has a fuller security checklist.
You can also run Claude Code itself as an MCP server for another app with claude mcp serve; that app is then responsible for asking you before each tool call.
MCP servers without the terminal
If you'd rather not type commands, Ninja Builder, a desktop app that runs Claude Code with your own Claude account, has a Settings › MCPs page with two tabs. Library lists official connections such as GitHub, Linear, Notion, Sentry, Slack, Stripe, Supabase, Vercel and Figma: click Add, approve the sign-in in your browser, and the row shows Connected, ready in new chats on all your Claude accounts. Installed shows each connection with a green, orange or red status light. Add your own takes any server's name, type and address or command, and it also installs packaged .mcpb files, the same kind Claude Desktop installs.
Or just ask in a chat, for example "connect to Slack", and the builder sets it up and tells you any sign-in it needs. Download Ninja Builder to try it; installing Claude Code first is covered in our Install Claude Code page.
Frequently asked questions
How do I add an MCP server to Claude Code?
Run claude mcp add in your terminal. For a remote server: claude mcp add --transport http <name> <url>. For a local program: claude mcp add <name> -- <command> [args]. Then check it with claude mcp list or /mcp inside Claude Code.
Where does Claude Code store MCP servers?
Local and user-scope servers are saved in ~/.claude.json. Project-scope servers are saved in .mcp.json in the project folder, which you can commit so your team shares them.
How do I remove an MCP server from Claude Code?
Run claude mcp remove <name>. Use claude mcp list first to see the exact name.
How do I sign in to an MCP server in Claude Code?
Type /mcp inside Claude Code, pick the server and follow the browser sign-in, or run claude mcp login <name> from your terminal. Add --no-browser on a machine without a browser.
Can Claude Code use my Claude Desktop MCP servers?
Yes. Run claude mcp add-from-claude-desktop and pick the servers to import. Servers whose names contain spaces or other special characters are skipped.
Keep reading

What is MCP? The Model Context Protocol explained for developers
How the Model Context Protocol connects AI agents to your tools, how to add a server, and how to keep it safe.

Claude skills explained: what they are and how to write one
What Agent Skills are, how Claude loads them, and a working SKILL.md you can copy.

How to install Claude Code on Mac, Windows and Linux (with fixes for common errors)
Pick the right install method, check it with claude doctor, and fix the errors people actually hit: PATH, PowerShell policy, old npm copies and WSL sign-in.