# 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.

- Canonical: https://guides-ai.pages.dev/guides/install-mcp-server-claude-code/
- Plate 05.01 · Topic: MCP (https://guides-ai.pages.dev/topics/mcp/)
- Published: 10 Jun 2026 · Updated: 06 Sept 2026 · 3 min read
- Source site: guides-ai — https://guides-ai.pages.dev/

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.

```powershell
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.

```bash
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.

```powershell
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

```bash
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

```bash
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.

```text
/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](/glossary/#mcp-server) runs with your permissions, and its tool
output enters your prompt. Start with
[the maintained shortlist](/guides/best-mcp-servers-to-start/) — several servers people still
recommend have been archived. For GitHub, see
[connect Claude Code to GitHub](/guides/connect-claude-code-to-github/).

Source: [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp).
