Claude Code adds an MCP server with one command. A remote server takes
claude mcp add --transport http <name> <url>, a local one takes
claude mcp add <name> -- <command>. Then run /mcp inside Claude Code to sign in and
see whether it connected. A plugin skips the command: it brings its servers with it.
What MCP gives Claude Code
MCP, the Model Context Protocol, is how Claude Code reaches tools outside your
repository: an issue tracker, a database, a browser, a publishing service. Each server
exposes named tools, and Claude Code calls them when a task needs them. The protocol and
the claude mcp commands cost nothing; a server may need its own account.
What MCP is, in plain terms, and how it differs from a
Skill, shown with a real server. Codex has its own commands for
the same job: the Codex MCP setup. If you are still choosing servers,
the best MCP servers are measured by tool count and token cost.
Add a remote server
Most hosted services run their server over HTTP. Give it a name and the address:
claude mcp add --transport http sentry https://mcp.sentry.dev/mcpIf the service hands out an API key instead of a browser sign-in, pass it as a header:
claude mcp add --transport http my-api https://api.example.com/mcp \
--header "Authorization: Bearer $MY_API_TOKEN"Without --transport, Claude Code assumes a local server, so the flag matters. The older
SSE transport (--transport sse) still works and is deprecated.
Add a local server
A local server is a program Claude Code starts on your machine. Everything after -- is
the command; -e sets the environment it gets:
claude mcp add airtable -e AIRTABLE_API_KEY=your_key -- npx -y airtable-mcp-serverOptions go before the name, the command goes after --. A server that already has a
JSON config goes in whole with claude mcp add-json <name> '<json>'.
Pick a scope
--scope decides who else gets the server.
| Scope | Who gets it | Stored in |
|---|---|---|
local (default) | you, this project | ~/.claude.json |
project | everyone in the repo | .mcp.json |
user | you, every project | ~/.claude.json |
A project server lands in .mcp.json at the repository root, so it goes into git:
{
"mcpServers": {
"sentry": { "type": "http", "url": "https://mcp.sentry.dev/mcp" }
}
}Keep secrets out of it with ${VAR}: Claude Code expands variables in the command,
arguments, environment, URL and headers. A teammate who opens the repo is asked to
approve project servers before they start. When the same name exists in several
scopes, local wins over project, and project over user.
Sign in and check it in /mcp
Inside Claude Code, /mcp lists every server with its status. A server marked
Needs authentication opens a browser sign-in when you pick it and choose
Authenticate. From the terminal, claude mcp list shows the same list and
claude mcp get <name> the details of one server. claude mcp login <name> signs in
without opening a session, and claude mcp logout <name> clears the stored token
before you remove a server.
Servers that come in a plugin
A plugin bundles MCP servers with skills, the instructions that tell Claude Code how to
use them well. One install adds both, with no claude mcp add:
/plugin marketplace add birtadev/plugins
/plugin install birta@birtaPlugin tools appear as mcp__plugin_<plugin>_<server>__<tool>. /mcp shows them and
can switch them off, but you add and remove them by installing and uninstalling the
plugin. Which plugins are worth the context they take is measured one by one in
the best Claude Code plugins, and the skills alone in
the best Claude skills.
A worked example: Birta
Birta's server publishes what Claude Code makes: a page, a report, a whole site, at a link people open and leave remarks on. Install the plugin with the two commands above, start a new session, and ask:
Read this repository's README and make a one-page overview of the project: what it does, how to run it, what is in progress. Publish it on Birta and send me the link.
On the first call Claude Code asks you to sign in to Birta in the browser with a code
sent to your email; there is no key to paste. If it does not ask, open /mcp, choose
the Birta server and Authenticate. The answer ends with a birta.link address. Open
it, leave a remark on a paragraph, and ask Claude Code to work the remarks: the next
version goes to the same link. Without plugins, the same server goes in by hand:
claude mcp add --transport http birta https://birta.dev/mcpThat route skips the skills, so pages come out plainer. The plugin is the shorter path. For a full site the steps are in deploying a website with Claude Code.
When a server does not connect
- Needs authentication. Sign in from
/mcp, or runclaude mcp login <name>. - Pending approval. A project server from
.mcp.jsonwaits for you to approve it when Claude Code starts.claude mcp reset-project-choicesasks again. - Failed to connect, local server. Run the command after
--yourself in a terminal: a missing package or variable shows up there. Local servers are not retried, so reconnect from/mcpafter fixing it. - Slow start. Raise the startup limit, in milliseconds:
MCP_TIMEOUT=20000 claude. - Output cut off. A tool answer is capped at 25,000 tokens by default; raise the
cap with
MAX_MCP_OUTPUT_TOKENS. - Tools missing after a plugin install. Start a new session.
Every connected server adds its tool list to the context, so connect the ones your work
uses and switch the rest off in /mcp. A server acts with your permission: connect
those you have a reason to trust.
Add Birta to Claude Code
One install adds the server and the skills; Claude Code publishes what it makes at a link people comment on.
