PlugWiki
Claude Code logo

How to add an MCP server to Claude Code

Add MCP servers to Claude Code with one claude mcp add command, then pick whether the server is for this project, your team or every project.

Local servers
Yes
runs stdio servers
Hosted servers
Yes
connects by URL
Config
CLI + JSON
how servers are added
Plugins
Yes
plugin marketplaces
Picks
7
ranked

Run claude mcp add in your terminal with the server's web address or launch command, and Claude Code saves it for you. By default the server only loads in the project where you added it; add --scope user for every project or --scope project to share it through .mcp.json. Servers you already connected on claude.ai show up on their own when you sign in with that account.

Good for

  • Developers who want Claude Code to reach GitHub, Sentry, Notion or a database
  • Teams that want everyone in a repo to get the same servers from one .mcp.json file
  • People moving servers over from Claude Desktop, Cursor or another app
  • Anyone stuck on "No MCP servers configured" or a server that will not connect

Install Claude Code

Claude Code

  1. 1

    Copy this prompt.

    Add the Claude Code MCP server to Claude Code. Run this command:
    
    curl -fsSL https://claude.ai/install.sh | bash
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Pro, Max, Ultra, Team, Enterprise or Console account.

The native install updates itself. Homebrew and WinGet installs do not; upgrade them yourself. After installing, run claude and sign in.

From the vendor's docs. Source.

At a glance

Add an MCP server to Claude Code

Claude

  1. 1

    Open a terminal in your project

    Run the add command in your shell, not inside a claude session. Go to the project folder first, because the default scope ties the server to that folder.

  2. 2

    Add a hosted server by its address

    claude mcp add --transport http notion https://mcp.notion.com/mcp

    The name (notion) is yours to choose. If the service gives you a token instead of a sign-in, add it as a header:

    claude mcp add --transport http secure-api https://api.example.com/mcp \
      --header "Authorization: Bearer your-token"

    Uses Notion MCP

  3. 3

    Or add a local server by its command

    Put the launch command after --, and any keys with --env before the name:

    claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
      -- npx -y airtable-mcp-server

    Everything after -- goes to the server unchanged, so flags like -y are not read by Claude Code.

  4. 4

    Pick the scope

    | Scope | Loads in | Saved in | |---|---|---| | local (default) | this project, just you | ~/.claude.json | | project | this project, whole team | .mcp.json in the project root | | user | all your projects | ~/.claude.json |

    Add it to the command, for example claude mcp add --scope user --transport http sentry https://mcp.sentry.dev/mcp.

    Uses sentry-mcp

  5. 5

    Have a JSON block from another app?

    Pass the object inside mcpServers to add-json. Add "type": "http" to any entry that has a url, or Claude Code treats it as a local command and skips it.

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

    On macOS or WSL, claude mcp add-from-claude-desktop copies servers from Claude Desktop.

  6. 6

    Check it connected

    Run claude mcp list. You want ✔ Connected. ! Needs authentication means sign in next; ⏸ Pending approval means a .mcp.json server waits for you to approve it in claude. Use claude mcp get <name> for the error detail.

  7. 7

    Sign in and use it

    Start claude, type /mcp, pick the server and follow the browser sign-in, or run claude mcp login <name> from the shell. Then ask for something by name.

    Prompt
    Use the sentry server to list the top unresolved errors in my project from the last 24 hours.

    Uses sentry-mcp

  8. 8

    Restart the session after editing .mcp.json

    Claude Code reads .mcp.json when a session starts. After you edit it, type /exit and run claude -c to continue your last conversation in that folder. To retry servers that failed or need sign-in, type /mcp reconnect all.

Best MCP servers for Claude Code

MCP servers that work in Claude Code

40 · official first, then servers with a page, then by stars

Show all 40

Common errors and fixes

  • /mcp shows No MCP servers configured

    Cause: The server was added in another project folder, or the config was edited at a path Claude Code does not read.

    Fix: Re-add it from this project or with --scope user; edit only ~/.claude.json or .mcp.json.

    claude-code Source

  • MCP server has a "url" but no "type"

    Cause: Claude Code reads an entry without type as a local command.

    Fix: Add "type": "http" (or "sse" or "ws") to the entry.

    claude-code Source

  • Server shows Pending approval

    Cause: Servers from a project .mcp.json need your approval first.

    Fix: Run claude in the project and approve it, or approve it later from /mcp.

    claude-code Source

  • Failed to connect or MCP endpoint not found

    Cause: Wrong URL path, a rejected token, or a local command that does not start.

    Fix: Run claude mcp get <name>, check the path, and run the local command by hand to see its error.

    claude-code Source

  • Connection timed out at startup

    Cause: A local server took longer than 30 seconds, often while npx downloads it.

    Fix: Raise MCP_TIMEOUT, in milliseconds, before starting claude.

    claude-code Source

  • Server flags like -y or --port are rejected

    Cause: The -- separator is missing, so Claude Code reads the server's flags as its own.

    Fix: Remove the server and add it again with -- before the launch command.

    claude-code Source

Verdict

Claude Code covers every common MCP setup: local, hosted and WebSocket servers, three scopes and a shared .mcp.json for teams. The main limit is that local scope ties a server to one folder, which is why servers seem to disappear in other projects.

Claude Code covers every common MCP setup: local, hosted and WebSocket servers, three scopes and a shared .mcp.json for teams. The main limit is that local scope ties a server to one folder, which is why servers seem to disappear in other projects.

Best for

  • Developers who want MCP servers inside their terminal and repo
  • Teams sharing one server setup through git

Skip it if

  • You want to set up servers by clicking, not by commands
  • You only have a free claude.ai plan

Questions

How do I add an MCP server to Claude Code?

Run claude mcp add --transport http <name> <url> for a hosted server, or claude mcp add <name> -- <command> for a local one. Run it in your terminal before you start claude.

Where is the Claude Code MCP config file?

Personal servers live in ~/.claude.json, and team servers live in .mcp.json at the project root. Claude Code does not read ~/.claude/mcp.json or ~/.claude/.mcp.json, a common mistake.

What is the difference between local, project and user scope?

Local, the default, loads the server only in this project and only for you. Project writes it to .mcp.json so your team gets it through git. User loads it in every project on your computer.

How do I use claude mcp add-json?

Give it a name and the JSON for one server: claude mcp add-json weather-api '{"type":"http","url":"https://api.weather.com/mcp"}'. Pass only the object inside mcpServers, and include type for any server with a URL.

How do I restart Claude Code?

Type /exit, then run claude -c to continue your last conversation in that folder, or claude -r <name> to pick a named one. The /restart command restarts and resumes a session to apply an update; it needs a Pro, Max or Ultra plan and the native install on macOS or Linux, not WSL.

Why does /mcp say No MCP servers configured?

You probably added the server in a different project folder, since local scope is tied to the folder. Re-add it here, or add it with --scope user. A hand-edited file at the wrong path or a broken .mcp.json entry causes the same message.

How do I sign in to a remote MCP server?

Type /mcp inside Claude Code and follow the browser steps, or run claude mcp login <name> in your shell. Over SSH, add --no-browser and paste the redirect URL back.

Do my claude.ai connectors work in Claude Code?

Yes, when you log in to Claude Code with your claude.ai subscription. They do not load when you use an API key or a cloud provider such as Amazon Bedrock.

Do I need a paid plan for Claude Code?

Yes. Claude Code needs a Pro, Max, Ultra, Team, Enterprise or Console account; the free claude.ai plan does not include it.

Information

updated Nov 1, 2026

Transports
stdio, SSE, Streamable HTTP
Config file (all)
.mcp.json (project) or ~/.claude.json (user)

Docs

Sources

Docs, issue trackers and discussions this page is built from.

Show all 5
  1. Set up Claude Code · code.claude.com
  2. Connect Claude Code to tools via MCP · code.claude.com
  3. MCP quickstart · code.claude.com
  4. Commands · code.claude.com
  5. CLI reference · code.claude.com

Updated Nov 1, 2026.