October 14, 2026
If you only need the command, here it is. For a remote server (one with a URL):
claude mcp add --transport http my-server https://example.com/mcp
For a local server (one Claude Code starts on your machine):
claude mcp add my-server -- npx -y some-mcp-package
Then type /mcp inside Claude Code to check it connected. That covers
most cases. The rest of this guide covers the parts that trip people up: which
scope to choose, how Claude Desktop differs, authentication headers, Windows, and
what each error actually means.
Generate your config
Pick your client and server type and the generator writes the exact command or JSON, with the right file location. It is pre-filled with Enrichr’s remote server as an example. Replace the URL and header with your own server’s.
Remote vs. local servers
Every MCP server is one of two kinds, and the kind decides the command.
| Remote (HTTP) | Local (stdio) | |
|---|---|---|
| Where it runs | On someone’s server; you connect to a URL | On your machine; Claude Code starts it as a process |
| Command | claude mcp add --transport http name URL | claude mcp add name -- command args |
| Auth | A header (--header) or OAuth via /mcp | Environment variables (--env KEY=value) |
| Needs installed | Nothing | Usually Node (for npx) or Python (for uvx) |
| Good for | SaaS tools, hosted APIs, browser-based tools | Your files, local databases, private tools |
You may see guides that use --transport sse. SSE is the older remote
transport. Use http unless a server’s own docs say it only supports
SSE.
The -- in the local command matters. Everything after it is passed to
your server untouched, so its flags are not mistaken for Claude Code’s own.
Local, project or user scope?
Scope answers one question: who should get this server, and where? It is the part of the docs most people skip, and the reason a server “disappears” when you change folders.
--scope user.Project scope has one extra safety step. The first time a teammate opens the repo,
Claude Code asks them to approve the servers in .mcp.json before any of
them run. If someone clicked no by mistake, claude mcp reset-project-choices
brings the prompt back.
Never commit an API key in .mcp.json. The file supports environment
variable expansion, so reference the key instead:
{
"mcpServers": {
"enrichr": {
"type": "http",
"url": "https://enrichr.dev/mcp",
"headers": { "X-API-Key": "${ENRICHR_API_KEY}" }
}
}
}
Adding a server to Claude Desktop
Claude Desktop and Claude Code are separate apps with separate server lists. Desktop handles the two kinds of server in two different places:
- Remote servers: Settings → Connectors → Add custom connector. Paste the URL. Because connectors live on your account, they also appear on claude.ai. Some servers authenticate with OAuth (you sign in once in a popup). Others, like Enrichr, use a header. Follow the server’s own instructions for which one to pick.
- Local servers: Settings → Developer → Edit Config opens
claude_desktop_config.json. On macOS it lives at~/Library/Application Support/Claude/; on Windows at%APPDATA%\Claude\. Add your server undermcpServers, save, then fully quit the app and reopen it. Closing the window is not enough.
Already set servers up in Desktop? claude mcp add-from-claude-desktop
imports them into Claude Code (on macOS and WSL) and lets you choose which ones.
Managing your servers
| Command | What it does |
|---|---|
claude mcp list | Every configured server and whether it connects |
claude mcp get name | Details for one server, including its scope |
claude mcp remove name | Removes it (add --scope if it exists in more than one) |
claude mcp add-json name '{...}' | Adds a server from a JSON snippet, handy when docs give you JSON |
/mcp (inside a session) | Live status, tool counts, and OAuth sign-in for servers that need it |
Troubleshooting
What to add first
Once the mechanics work, the question becomes which servers are worth it. We keep a running list in 10 MCP servers that turn Claude Code from clever into unfair, and a free-only list in 9 free MCP servers. Before installing anything from a stranger’s repo, read how not to get burned by unaudited MCP servers. A local server runs code on your machine with your permissions.
If you build websites, the one we would add first is a way for Claude Code to see the rendered web. Without it, Claude cannot read half the pages you point it at (here is why). Client-specific setup pages: Claude, Cursor, VS Code, Windsurf, Cline.
FAQ
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 my-server https://example.com/mcp. For a local one: claude mcp add my-server -- npx -y some-package. Then run /mcp inside Claude Code to check it connected.
Where does Claude Code store MCP servers?
Local and user scoped servers are stored in ~/.claude.json. Project scoped servers are written to .mcp.json in the root of your repository, which you can commit so teammates get the same servers.
How do I add an MCP server to Claude Code globally?
Use the user scope: claude mcp add --scope user my-server ... It then loads in every project on your machine.
How do I add an MCP server to Claude Desktop?
For a remote server, go to Settings → Connectors → Add custom connector and paste the URL. For a local server, open Settings → Developer → Edit Config, add it under mcpServers in claude_desktop_config.json, then fully quit and reopen the app.
Can I import my Claude Desktop servers into Claude Code?
Yes. claude mcp add-from-claude-desktop reads your Desktop config and lets you pick which servers to import (on macOS and WSL).
Why does my MCP server not show up?
Check claude mcp list for its status. The usual causes are a URL missing its /mcp path, a missing auth header, a local command that fails on its own, the cmd /c wrapper on native Windows, or Claude Desktop not being fully restarted.