# Claude Code MCP: Add Servers with One Command (2026 Guide)

> Source: <https://mcpize.com/blog/claude-code-mcp>
> Published: 2026-12-03 00:00:00+00:00

**Key takeaway:** Add remote MCP servers to Claude Code with `claude mcp add --transport http <name> <url>`, then run `/mcp` to sign in; use `--scope project` to share via a committed `.mcp.json` and keep secrets out of that file by using local scope or environment variables.

**TL;DR:** Run `claude mcp add --transport http <name> <url>` to connect a remote MCP server to Claude Code, then `/mcp` inside a session to sign in. Add `--scope project` to share the server with your team through `.mcp.json`. Local servers use the same command with `--` before the launch command.

Claude Code MCP support is what lets the agent read an issue, query a database or check an error tracker without you pasting anything into the terminal. This guide covers the `claude mcp add` command, the three scopes, authentication, seven servers to install first and the errors you are most likely to hit. Every command here comes from the [official Claude Code MCP docs](https://code.claude.com/docs/en/mcp) or the server's own README.

## Add a remote MCP server[#](#add-a-remote-mcp-server)

Remote servers over HTTP are the recommended option. One command adds one:

The name is yours to choose. It is how the server appears in `/mcp` and in the other `claude mcp` commands.

For a server that takes an API key instead of a sign-in, pass a header:

The SSE transport is deprecated. If a service still exposes only an SSE endpoint, the same `--transport http` command works on recent versions, because Claude Code tries HTTP first and falls back to SSE.

## Add a local stdio server[#](#add-a-local-stdio-server)

A stdio server runs as a process on your machine. It suits tools that need direct access to local files or a database on your network.

The double dash matters. Everything before `--` is an option for Claude Code, and everything after it is the command that starts the server. Without it, Claude Code tries to parse the server's own flags.

## Choose a scope: local, project or user[#](#choose-a-scope-local-project-or-user)

Scope decides where a server loads and who else gets it.

| Scope | Loads in | Shared with team | Stored in | 
|---|---|---|---|
| Local (default) | Current project | No | `~/.claude.json` | 
| Project | Current project | Yes, through version control | `.mcp.json` in the project root | 
| User | All your projects | No | `~/.claude.json` | 

A project-scoped server lands in `.mcp.json`, which you commit:

Claude Code asks each teammate to approve project-scoped servers before using them. When the same server name exists in more than one scope, local wins over project, and project wins over user.

Keep secrets out of `.mcp.json`. Use local scope for servers with personal credentials, or reference environment variables in the project file.

## Sign in to a server[#](#sign-in-to-a-server)

Many remote servers use OAuth. Add the server, then authenticate from inside a session:

Then, in Claude Code:

Select the server and follow the browser flow. Tokens are stored and refreshed for you. You can also sign in from your shell with `claude mcp login sentry`, which helps over SSH because it prints the URL when no browser is available. `claude mcp logout sentry` clears the stored credentials.

Headless runs with `claude -p` have no `/mcp` panel, so complete the sign-in from an interactive session first.

## Manage your servers[#](#manage-your-servers)

Inside a session, `/mcp` shows the status of each server and whether it needs sign-in. If you already set up servers in Claude Desktop, `claude mcp add-from-claude-desktop` imports them.

## Seven MCP servers to add to Claude Code first[#](#seven-mcp-servers-to-add-to-claude-code-first)

These cover the work most sessions involve: code hosting, errors, docs, a browser and a database. Each command is copied from Anthropic's docs or the project's README.

**1. GitHub.** Review pull requests, open issues and search repositories. It authenticates with a fine-grained personal access token.

**2. Sentry.** Pull the stack trace for a production error into the session that will fix it.

**3. Context7.** Fetch current library documentation, so the agent does not code against an API from its training data. The [Context7 README](https://github.com/upstash/context7) recommends a free API key for higher rate limits.

**4. Playwright.** Drive a real browser to check a UI change. The command is from the [Playwright MCP README](https://github.com/microsoft/playwright-mcp).

**5. A database through DBHub.** Query PostgreSQL and other relational databases. Use a read-only database user so the agent cannot change data.

**6. Notion.** Read specs and write docs back to the workspace.

**7. Stripe.** Work with your Stripe account from the session while you build billing code.

Add servers when a task needs them. A server that duplicates something Claude Code already does, such as reading files, adds noise without adding ability.

### More servers, one command each[#](#more-servers-one-command-each)

Every server on the [MCPize marketplace](https://mcpize.com/marketplace) is hosted at its own HTTPS endpoint, and its page shows the ready-made `claude mcp add --transport http` command, with your API key in a header when the server needs one. Browse [database servers](https://mcpize.com/marketplace/database), [version control](https://mcpize.com/marketplace/version-control) or [project management](https://mcpize.com/marketplace/project-management). Authentication, API keys and usage limits run through the [MCPize gateway](https://mcpize.com/gateway).

[Browse MCP servers for Claude Code](https://mcpize.com/marketplace)

## Connectors from claude.ai show up automatically[#](#connectors-from-claude-ai-show-up-automatically)

If you sign in to Claude Code with a claude.ai account, the connectors you added in claude.ai are available in Claude Code without extra setup. `/mcp` lists them with a marker showing where they come from. They do not load when you authenticate with an API key or through a third-party provider such as Amazon Bedrock.

A server you add with `claude mcp add` takes precedence over a claude.ai connector that points at the same URL. For the claude.ai side, see the [Claude connectors guide](https://mcpize.com/blog/claude-connectors).

## Keep context usage low[#](#keep-context-usage-low)

Tool definitions take up context. Tool search, on by default, defers them: only tool names and server instructions load at session start, and Claude fetches a tool's full definition when it needs it. Adding another server costs little context.

Large tool results are the other cost. Claude Code warns when a tool returns more than 10,000 tokens, and by default caps MCP output at 25,000 tokens. Raise the cap for a session when you need to:

## Fix common errors[#](#fix-common-errors)

| What you see | Cause | Fix | 
|---|---|---|
| `has a "url" but no "type"` | A JSON entry with a URL and no transport type is read as stdio | Add `"type": "http"` to the entry | 
| `MCP server <name> already exists in local config` | You added the same name at the same scope twice | Remove it first, or pick another name | 
| Server listed as needing authentication | The server returned 401 or 403 | Run `/mcp` , select the server and sign in | 
| Connection fails with a header configured | The token in `--header` is wrong or expired | Fix the token. Claude Code does not fall back to OAuth | 
| The server's flags are rejected | The `--` separator is missing | Put `--` before the launch command | 
| A teammate's `.mcp.json` server does not load | The approval prompt was declined | Run `claude mcp reset-project-choices` | 

`claude mcp add` saves a configuration without checking credentials. A placeholder token is accepted at add time and fails at connect time, so check `/mcp` for a checkmark after you add a server.

## FAQ[#](#faq)

### How do I add an MCP server to Claude Code?[#](#how-do-i-add-an-mcp-server-to-claude-code-)

Run `claude mcp add --transport http <name> <url>` for a remote server, or `claude mcp add <name> -- <command>` for a local one. Then open a session and run `/mcp` to confirm it connected.

### Where does Claude Code store MCP servers?[#](#where-does-claude-code-store-mcp-servers-)

Local and user scopes are stored in `~/.claude.json`. Project scope is stored in `.mcp.json` at the project root, which you commit so the team shares the same servers.

### What are the best MCP servers for Claude Code?[#](#what-are-the-best-mcp-servers-for-claude-code-)

Start with the ones that match daily work: GitHub for code review, Sentry for errors, Context7 for current docs, Playwright for browser checks and a database server such as DBHub. Add others when a task needs them.

### Does Claude Code support remote MCP servers?[#](#does-claude-code-support-remote-mcp-servers-)

Yes. HTTP is the recommended transport for remote servers, and Claude Code supports OAuth sign-in for them through `/mcp` or `claude mcp login <name>`.

### How do I remove an MCP server from Claude Code?[#](#how-do-i-remove-an-mcp-server-from-claude-code-)

Run `claude mcp remove <name>`. For a remote server this also deletes the OAuth tokens Claude Code stored for it. To revoke them at the provider as well, run `claude mcp logout <name>` first.

### Can I use Claude Desktop servers in Claude Code?[#](#can-i-use-claude-desktop-servers-in-claude-code-)

Yes. Run `claude mcp add-from-claude-desktop` and pick the servers to import. Remote connectors from your claude.ai account appear automatically when you sign in with that account.

## Next steps[#](#next-steps)

1. Add one remote server and sign in through `/mcp` .
2. Move the servers your team shares into project scope and commit `.mcp.json` .
3. Have an API of your own? [Host it as a remote MCP server](https://mcpize.com/hosting) and anyone can add it with one command.

[Find servers on MCPize](https://mcpize.com/marketplace)

[Build your own server](https://mcpize.com/developers/build-mcp-server)

**Sources:**

- [Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp) , Claude Code docs
- [Get started with connectors](https://claude.com/docs/connectors) , Claude docs
- [Playwright MCP](https://github.com/microsoft/playwright-mcp) , Microsoft
- [Context7](https://github.com/upstash/context7) , Upstash
