§05.01

How to Install an MCP Server in Claude Code

Add an MCP server with claude mcp add: -- for local commands, --transport http for hosted ones, --scope to choose who gets it, then /mcp to confirm.

published 10 Jun 2026 updated 06 Sept 2026 checked against docs 06 Sept 2026 3 min in MCP Markdown

On this page5 sections
  1. 1. Local command, or hosted URL
  2. 2. Choose the scope
  3. 3. Pass secrets properly
  4. 4. Confirm it connected
  5. If it fails

MCP lets Claude Code use external tools — filesystems, databases, APIs. Adding one is a single command; the only thing to get right first is which of the two shapes you have.

1. Local command, or hosted URL

A stdio server is a program Claude Code launches as a child process. An http server is one somebody else hosts, reached by URL. sse still exists but is deprecated.

claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem C:\path\to\allow

What it does: registers a stdio server. The -- separator is required — everything after it is passed to the server untouched, and the trailing path is the only directory it may reach.

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

What it does: registers a hosted server by URL instead of a command.

2. Choose the scope

  • --scope local (default) — just you, this project. Stored in ~/.claude.json.
  • --scope project — shared with your team via a committed .mcp.json at the repo root.
  • --scope user — available in all your projects.
claude mcp add --scope user --transport http github https://api.githubcopilot.com/mcp/

What it does: makes one server available everywhere you work. Never commit a token in a project-scoped .mcp.json.

3. Pass secrets properly

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

What it does: sets an environment variable for a stdio server. For hosted servers use a header instead: --header "Authorization: Bearer YOUR_TOKEN".

4. Confirm it connected

claude mcp list

What it does: lists every configured server with its health status. claude mcp get <name> shows one in detail, and claude mcp remove <name> deletes it.

/mcp

What it does: the in-session panel — ✔ Connected, ! Needs authentication or ✘ Failed to connect, with a tool count and options to re-authenticate or disable a server.

If it fails

Servers load at session start, so add one and then start a new session. A server that fails immediately is usually a wrong command path or a missing runtime — run the part after -- in your own shell and read the error. ! Needs authentication means claude mcp login <name>.

Pick carefully: an MCP server runs with your permissions, and its tool output enters your prompt. Start with the maintained shortlist — several servers people still recommend have been archived. For GitHub, see connect Claude Code to GitHub.

Source: Claude Code MCP documentation.

← All MCP plates · Search all guides

↑↓ move↵ openalt+↵ copy first command

Keyboard

⌘/ctrl+K or /
Search all guides
alt+↵
In search: copy the guide's first command
j / k
Move through a list of guides
c
On a guide: copy its first command
t
Toggle light / dark
?
This list