Skip to content
MCP Shelf

Set up your app

Adding MCP servers to Claude Code

By Sophie Filer · Updated 6 Nov 2026

Claude Code manages MCP servers with one command, claude mcp add. You never have to open a JSON file unless you want to share servers with your team. Here is the short version, then the details that catch people out.

Add with
claude mcp add
Team file
.mcp.json in the project
Local servers
Yes
Remote URLs
Yes

At a glance

  1. 1. Pick a server

    Find one on the shelf and open its page.

  2. 2. Run one command

    Copy the Claude Code tab: claude mcp add ...

  3. 3. Check it starts

    Run claude mcp list and look for Connected.

  4. 4. Ask Claude

    Type /mcp to see its tools, then ask away.

The short version

Local server (runs on your machine)
claude mcp add playwright -- npx -y @playwright/mcp@latest
Remote server (a URL)
claude mcp add --transport http context7 https://mcp.context7.com/mcp
Check it actually starts
claude mcp list

The double dash matters: everything after it is the command Claude Code runs to start the server, passed through untouched. claude mcp list starts each server and prints its status, such as Connected, Needs authentication or Failed to connect, so run it after every add.

Every server page on MCP Shelf has a Claude Code tab with the exact command, including any keys it needs.

Choosing where the server is saved

Every server has a scope. The default is local: only you, only in the folder you ran the command from.

ScopeHow to set itSaved inAvailable to
localdefault~/.claude.json, under this projectYou, in this project
project--scope project.mcp.json in the project rootAnyone who clones the repo
user--scope user~/.claude.json, top levelYou, in every project

Project scope writes a .mcp.json file you can commit. Claude Code will not start servers from that file until each person approves them, which is why a fresh clone shows "Pending approval" in claude mcp list. Start claude in the folder and accept the prompt. claude mcp reset-project-choices clears those answers if you need to choose again.

If the same name exists in more than one scope, local wins over project, and project wins over user. The whole entry from the winning scope is used; fields are not mixed.

Passing API keys

Use -e (or --env) for environment variables and put it after the server name. If it comes straight before the name, Claude Code reads the name as another variable and stops with "Invalid environment variable format".

claude mcp add firecrawl -e FIRECRAWL_API_KEY=fc-your-key -- npx -y firecrawl-mcp

For remote servers that take a key in a header, use --header:

claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_TOKEN"

Keys end up in plain text in ~/.claude.json, or in .mcp.json for project scope. For a file you commit, refer to environment variables instead. Claude Code expands ${NAME} and ${NAME:-default} in the command, args, env, url and headers of .mcp.json, so each person keeps their own key in their shell:

.mcp.json, safe to commit
{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": ["-y", "firecrawl-mcp"],
      "env": { "FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}" }
    }
  }
}

Pasting a config written for another app

Most READMEs give a Claude Desktop or Cursor JSON block. Pass the object inside "mcpServers" to claude mcp add-json, not the whole block:

claude mcp add-json playwright '{"command":"npx","args":["-y","@playwright/mcp@latest"]}'

Server names may only use letters, numbers, hyphens and underscores. Rename a key such as "my server" before you add it.

The same works for servers that ship inside another app rather than as an npm package. The config for Burp Suite's MCP extension, for example, starts a small Java proxy, and claude mcp add-json takes it as it is.

Signing in to remote servers

Servers that use OAuth show "Needs authentication" in claude mcp list. Type /mcp inside a session and pick the server, or run claude mcp login <name> from your shell; both open the browser. Over SSH, claude mcp login prints the address to open on your own computer instead. claude mcp logout <name> signs you out.

Other commands worth knowing

CommandWhat it does
claude mcp get <name>Shows one server: scope, command, arguments, env, status and any error
claude mcp remove <name>Removes it (add -s <scope> if the name exists in more than one)
claude mcp add-json <name> '<json>'Adds a server from a JSON block, such as the configs on MCP Shelf
claude mcp add-from-claude-desktopCopies servers over from Claude Desktop (macOS and WSL)
claude mcp login <name>Signs in to a remote server from your shell
/mcp (inside a session)Shows connected servers and tool counts, signs in, and turns servers on or off for this project

Timeouts and large results

  • A server that is slow to start, such as one npx has to download first, can time out. Start Claude Code with a longer limit in milliseconds: MCP_TIMEOUT=60000 claude.
  • Claude Code warns when one tool result passes 10,000 tokens and caps it at 25,000 by default. Raise the cap with MAX_MCP_OUTPUT_TOKENS=50000 claude for servers that return big pages or query results.
  • A server you do not need in a project can be switched off in /mcp without removing it.

Questions

Where does Claude Code keep MCP servers?

Local and user servers are in ~/.claude.json. Project servers are in .mcp.json at the root of the project.

Can I paste the JSON configs from MCP Shelf into Claude Code?

Yes. Use claude mcp add-json with the server's inner block, for example claude mcp add-json playwright '{"command":"npx","args":["-y","@playwright/mcp@latest"]}'. Add "type": "http" to a block that only has a url.

Do Claude Code and Claude Desktop share servers?

No, they keep separate lists. claude mcp add-from-claude-desktop copies the Desktop ones across on macOS and WSL.

Why does claude mcp list say "Failed to connect"?

Claude Code could not start or reach that server. Run claude mcp get <name> to see the error, then look it up in Fixing MCP server errors.

Plant Your First Pea

Every server on the shelf has a tab with the exact config for your app.

Browse servers

For bots & AI agents

Machine-readable versions of this guide and MCP Shelf. Fetch these instead of parsing this page.

This guide (.md)llms.txtllms-full.txtai.txtFull catalog (.md)API specMCP serverMCP manifestDeveloper docs