Best AI Code Tools

How to set up MCP servers in Claude Code

Updated Oct 26, 2026 · Sources listed at the end

To connect an MCP server to Claude Code, run claude mcp add with a name and either a URL (remote server) or a command (local server). By default the server is available only to you in the current project; add --scope project to share it through a .mcp.json file, or --scope user to use it in all your projects.1

Remote (HTTP) server

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

Claude Code tries the HTTP transport first and switches to SSE when a server does not accept it. Servers that only speak SSE can be added with --transport sse.1

Scopes

ScopeWho can use itWhere it is stored
local (default)Only you, current projectYour project’s entry in ~/.claude.json
projectEveryone in the project.mcp.json in the repo
userYou, in all projects~/.claude.json

Environment variables are set with -e KEY=value.1

Check it worked

Each claude mcp add prints an “Added” line. Run claude mcp get <name> to see the connection status; project servers from .mcp.json need approval before they load.1

Safety

Only connect servers you trust. Anthropic warns that servers fetching external content can expose you to prompt injection.1

Footnotes

  1. Claude Code docs, MCP. ↩ ↩2 ↩3 ↩4 ↩5

Tools mentioned

Sources

  1. Claude Code docs: Connect Claude Code to tools via MCP

Related lists

Related comparisons and alternatives

Related guides