
How to Add an MCP Server to Claude Code
I add MCP servers to Claude Code all the time, and the command is short once you know which piece of a server's setup instructions to copy. Here's the process I use, based on Anthropic's current Claude Code MCP docs [1].
Step 1: Figure out what kind of server you have
Open the server's listing on MCP Lantern (or its own README) and look for one of these [1]:
- A URL like
https://mcp.example.com/mcp: it's a remote server. - A launch command like
npx -y @example/mcp-server: it's a local stdio server that runs on your machine. - An
mcpServersJSON block: config written for another client, such as Claude Desktop.
Not sure which fits you? I compare the two in Remote MCP vs Local MCP.
Step 2: Add a remote HTTP server
Remote HTTP is the transport Anthropic recommends for cloud services [1]:
claude mcp add --transport http <name> <url>
# Example from the docs
claude mcp add --transport http notion https://mcp.notion.com/mcp
If the server wants an API key instead of a browser sign-in, pass a header [1]:
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
Some older services only offer SSE, which is deprecated. On recent Claude Code versions, --transport http falls back to SSE automatically; otherwise use --transport sse [1].
Step 3: Or add a local stdio server
Put the launch command after a double dash --. Everything after it goes to the server untouched, so flags like -y aren't read by Claude Code [1]:
claude mcp add [options] <name> -- <command> [args...]
# Example from the docs
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
Got a JSON block instead? Pass the object inside mcpServers to claude mcp add-json [1]:
claude mcp add-json example '{"command":"npx","args":["-y","@example/mcp-server"]}'
Pick the right scope
Add --scope (or -s) to control where the config lives [1]:
| Scope | Loads in | Shared with team | Stored in |
|---|---|---|---|
local (default) | Current project only | No | ~/.claude.json |
project | Current project only | Yes, via version control | .mcp.json in the project root |
user | All your projects | No | ~/.claude.json |
I keep anything with credentials in local or user. Claude Code asks you to approve project-scoped servers from .mcp.json before it uses them in interactive sessions [1].
Sign in (OAuth)
Many remote servers use OAuth. After adding one, run /mcp inside Claude Code and finish the login in your browser, or run claude mcp login <name> from your shell [1]. A few things to know:
claude mcp addsaves the config without checking your credentials, so a typo'd token only shows up later as a failed connection [1].- If you set your own
Authorizationheader, Claude Code uses it and won't fall back to OAuth [1]. - Some servers don't support automatic client registration and need
--client-id/--client-secretfrom an app you register with that service [1].
Check that it works
claude mcp list # every server, with a health status
claude mcp get <name> # details for one server
Inside a session, /mcp shows status and tool counts [1]. In claude mcp list you'll see statuses such as ✔ Connected, ! Needs authentication or ✘ Failed to connect [1]. If it fails, checking the server's status on its MCP Lantern page helps you tell an outage from a config problem. It won't catch everything, though.
Remove a server
claude mcp logout <name> # optional: revoke tokens where the auth server supports it
claude mcp remove <name>
Removing a remote server deletes the OAuth tokens Claude Code stored, but it doesn't revoke them at the provider. That's why the docs suggest running logout first [1]. To pause a server without deleting it, toggle it off in /mcp [1].
10 servers to try (practical picks, not a ranking)
These aren't the "most installed" servers. I haven't found a reliable public source for install counts. Each command below comes straight from the official source cited next to it. Trust matters, so read Official vs Community MCP Servers before connecting anything that touches real data.
| Category | Server | Command | Source |
|---|---|---|---|
| Docs & notes | Notion | claude mcp add --transport http notion https://mcp.notion.com/mcp | [1] |
| Project tracking | Linear | claude mcp add --transport http linear-server https://mcp.linear.app/mcp | [2] |
| Project tracking | Asana (SSE) | claude mcp add --transport sse asana https://mcp.asana.com/sse | [1] |
| Code | GitHub | claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_GITHUB_PAT" | [1] |
| Errors | Sentry | claude mcp add --transport http sentry https://mcp.sentry.dev/mcp | [1] |
| Payments | Stripe | claude mcp add --transport http stripe https://mcp.stripe.com | [1] |
| CRM | HubSpot | claude mcp add --transport http hubspot --scope user https://mcp.hubspot.com/anthropic | [1] |
| Database | Airtable (local) | claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server | [1] |
| Database | DBHub / Postgres (local) | claude mcp add --transport stdio db -- npx -y @bytebase/dbhub --dsn "postgresql://readonly:pass@host:5432/db" | [1] |
| Browser | Playwright (local) | claude mcp add playwright npx @playwright/mcp@latest | [3] |
Swap every placeholder (YOUR_KEY, YOUR_GITHUB_PAT, the DSN) for your own values. For databases, use a read-only user, as Anthropic suggests [1].
References
- Anthropic, "Connect Claude Code to tools via MCP," Claude Code Docs. https://code.claude.com/docs/en/mcp
- Linear, "MCP server," Linear Docs. https://linear.app/docs/mcp
- Microsoft, "Playwright MCP" README, GitHub. https://github.com/microsoft/playwright-mcp