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 or the server's own README.
Add a remote MCP server#
Remote servers over HTTP are the recommended option. One command adds one:
# Syntax
claude mcp add --transport http <name> <url>
# Example: Notion
claude mcp add --transport http notion https://mcp.notion.com/mcpThe 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:
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"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#
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.
# Syntax
claude mcp add [options] <name> -- <command> [args...]
# Example: Airtable
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-serverThe 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#
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 |
# Share with the team
claude mcp add --transport http shared-server --scope project https://example.com/mcp
# Available in every project on your machine
claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropicA project-scoped server lands in .mcp.json, which you commit:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}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#
Many remote servers use OAuth. Add the server, then authenticate from inside a session:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcpThen, in Claude Code:
/mcpSelect 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#
claude mcp list # all configured servers
claude mcp get notion # details for one server
claude mcp remove notion # remove itInside 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#
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.
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_PAT"2. Sentry. Pull the stack trace for a production error into the session that will fix it.
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp3. Context7. Fetch current library documentation, so the agent does not code against an API from its training data. The Context7 README recommends a free API key for higher rate limits.
claude mcp add --transport http context7 https://mcp.context7.com/mcp \
--header "Authorization: Bearer YOUR_API_KEY"4. Playwright. Drive a real browser to check a UI change. The command is from the Playwright MCP README.
claude mcp add playwright npx @playwright/mcp@latest5. A database through DBHub. Query PostgreSQL and other relational databases. Use a read-only database user so the agent cannot change data.
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
--dsn "postgresql://readonly:pass@prod.db.com:5432/analytics"6. Notion. Read specs and write docs back to the workspace.
claude mcp add --transport http notion https://mcp.notion.com/mcp7. Stripe. Work with your Stripe account from the session while you build billing code.
claude mcp add --transport http stripe https://mcp.stripe.comAdd 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#
Every server on the MCPize 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, version control or project management. Authentication, API keys and usage limits run through the MCPize gateway.
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.
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:
export MAX_MCP_OUTPUT_TOKENS=50000
claudeFix 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#
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?#
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?#
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?#
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?#
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?#
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#
- Add one remote server and sign in through
/mcp. - Move the servers your team shares into project scope and commit
.mcp.json. - Have an API of your own? Host it as a remote MCP server and anyone can add it with one command.
Sources:
- Connect Claude Code to tools via MCP, Claude Code docs
- Get started with connectors, Claude docs
- Playwright MCP, Microsoft
- Context7, Upstash






