Guide

Claude Code MCP: How to Add, Configure and Share Servers

15 min read·
Claude Code MCP: How to Add, Configure and Share Servers

Quick answer: Run claude mcp add --transport http <name> <url> for a hosted server, or claude mcp add <name> -- <command> for one that runs on your machine. Then run claude mcp list and check it says Connected. Servers are private to you in the current project by default. Add --scope project to share them through .mcp.json.

Questions this page answers

  • What is MCP in Claude Code, in plain words?
  • Which command do I run for the setup instructions I was given?
  • Where does the config live, and which scope should I pick?
  • How do I share a server with my team without sharing my keys?
  • How do I give Claude Code hundreds of tools through one connection?
  • Why does my server say "Failed to connect" or "Needs authentication"?

Setting up MCP just so an agent can reach your apps?

In Bento, Gmail, Slack, Notion and thousands more apps are connected once for the whole workspace, and every agent you allow can use them. No config files, no tokens to paste. It covers work you run in Bento, not Claude Code in your own terminal. See Bento's plans.

Updated November 5, 2026: rewritten and checked against Claude Code 2.1.310. We ran every claude mcp command on this page and copied the status lines from real output. The long "best servers" list moved to its own article. The new section covers adding many tools through one connection.

Pick your command. Server docs are often written for another app. Match what you were given:

You were given…Run this
A URL like https://mcp.example.com/mcpclaude mcp add --transport http example https://mcp.example.com/mcp
A command like npx -y @example/serverclaude mcp add example -- npx -y @example/server
An mcpServers JSON blockclaude mcp add-json example '<the object inside mcpServers>'
A Claude Code plugin name/plugin install <name>@<marketplace> inside Claude Code

Everything else is in Anthropic's full MCP reference. This page covers the parts people actually get stuck on.

What is MCP in Claude Code?

MCP is the plug that lets Claude Code use other apps' tools. It stands for the Model Context Protocol, an open standard. An MCP server is a small program, hosted or running on your machine, that offers tools such as "search issues" or "query the database". Claude Code connects to it and calls those tools when your request needs them.

Connect a server when you notice you keep copying things into the chat from another tool: tickets, error logs, rows from a table. Once it's connected, Claude reads the source directly.

MCP is only the connection. A skill is a set of written instructions for doing a job, and the two often work together. If the difference is fuzzy, here's how MCP differs from skills and plain tools. Claude Cowork, the Claude app's agent for non-developers, uses the same protocol but manages connections for you. See Claude Code vs Claude Cowork.

How do I add an MCP server to Claude Code?

Use claude mcp add in your terminal, from inside the project folder. Start with a server that needs no sign-in so you know the basics work:

claude mcp add --transport http claude-code-docs https://code.claude.com/docs/mcp
claude mcp list
# claude-code-docs: https://code.claude.com/docs/mcp (HTTP) - ✔ Connected

A hosted server that needs a login. Add it the same way, then sign in:

claude mcp add --transport http notion https://mcp.notion.com/mcp
# then, inside Claude Code:
/mcp

/mcp opens your browser to sign in. Over SSH, run claude mcp login notion --no-browser from your shell and paste the redirect URL back. If a server uses an API key instead, pass it as a header: --header "Authorization: Bearer $TOKEN".

A server that runs on your machine (called stdio):

claude mcp add --transport stdio filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects/site

Everything after -- is passed to the server untouched. Leave the -- out and Claude Code tries to read the server's own flags as its options. Put --env KEY=value after the name, and don't put the name directly after --env (see the troubleshooting table).

From a JSON block: claude mcp add-json <name> '{"type":"http","url":"https://…"}'. Always include "type". Without one, Claude Code treats the entry as a local command and refuses it.

Which transport? HTTP is the right answer for anything hosted:

TransportUse it forHow to add
HTTPHosted services. Supports OAuth sign-in--transport http
SSEOlder hosted servers. Deprecated; --transport http now falls back to it automatically (v2.1.265+)--transport http or sse
stdioPrograms on your machine: files, local databases, scripts-- <command>
WebSocketServers that push events. Header auth only, no OAuthadd-json with "type":"ws"

Manage servers with claude mcp list, claude mcp get <name> and claude mcp remove <name>.

Where does Claude Code store MCP config, and which scope should I pick?

A scope decides which projects see a server and whether anyone else gets it. The default, local, is right for most personal setups.

ScopeLoads inShared with teamStored in
local (default)This project onlyNo~/.claude.json, under this project's path
projectThis project onlyYes, through git.mcp.json in the project root
userAll your projectsNo~/.claude.json

Pick user for tools you want everywhere, like a docs search. Pick project for anything the whole repo depends on. Keep anything with a personal key at local.

When one name appears in several places, Claude Code uses exactly one definition, in this order: local, then project, then user, then plugins, then claude.ai connectors. The whole entry from the winner is used, and nothing is merged.

When the same server name is in more than one scope, Claude Code uses the local one, then project, then user, and never merges them.

One naming trap: MCP's "local" scope lives in ~/.claude.json in your home folder. It has nothing to do with .claude/settings.local.json in the project.

How do I share MCP servers with my team?

Add the server with --scope project and commit the .mcp.json it writes. Each teammate then approves it once.

claude mcp add --transport http --scope project sentry https://mcp.sentry.dev/mcp

That writes:

{
  "mcpServers": {
    "sentry": { "type": "http", "url": "https://mcp.sentry.dev/mcp" }
  }
}

Until a teammate opens claude in the repo and accepts it, their list shows ⏸ Pending approval (run claude to approve). That's deliberate: a cloned repo can't switch on its own servers. To ask again, run claude mcp reset-project-choices.

Keep keys out of the file with environment variables. .mcp.json expands ${VAR} and ${VAR:-default} in the command, args, env, URL and headers:

"headers": { "Authorization": "Bearer ${SENTRY_TOKEN}" }

If the team mostly needs those connections for work outside the repo, like inbox triage or a Slack summary, a Bento workspace shares them without a .mcp.json: teammates join at no extra cost per person, and connected accounts stay encrypted.

One catch for automation: claude -p runs and Agent SDK sessions load project servers without asking. Block the ones you don't want with disabledMcpjsonServers. More on rolling Claude Code out to a team.

How do I give Claude Code many tools with one connection?

Add one server that sits in front of hundreds of apps, sign in once, and connect your apps on that service's side. The other route is a command-line tool plus a skill that teaches Claude to use it.

ServiceAdd it to Claude CodeSign-inWhat it costs to useWe tested
Composioclaude mcp add --transport http composio https://connect.composio.dev/mcpOAuth in /mcpSet by ComposioReaches sign-in
Zapier MCPclaude mcp add --transport http zapier https://mcp.zapier.com/api/v1/connect, or /plugin install zapier@claude-plugins-officialOAuth2 Zapier tasks per successful callReaches sign-in
tregclaude mcp add --transport http treg https://treg.to/mcp/, or /plugin marketplace add superdesigndev/treg then /plugin install treg@tregOAuth or bearer tokenFree on your own provider keys. Otherwise per call at the provider's rate, from a prepaid balanceReaches sign-in, but only with the trailing slash
ArcadeCreate a gateway, pick its tools, then claude mcp add --transport http arcade "<gateway URL>"Arcade accountSet by ArcadeNot tested (needs an account)
MonidNot MCP: npm install -g @monid-ai/cli@latest, monid setup, then save its SKILL.md as a skillAPI keySet per endpoint; some are paidNot tested (needs a key)

Each service describes its own scale: Composio says over 1,500 apps, and treg lists 4,100+ provider endpoints. Pipedream works differently. It offers one MCP server per app, so it doesn't fit the "one connection" pattern.

Is one big server a problem for context? Usually not. Claude Code's tool search is on by default, so only tool names load at the start, and full definitions load when Claude needs them. Anthropic's docs say there is "no fixed per-server tool cap". Your context window is the practical limit.

The trade-off. One connection means one sign-in and one bill. It also puts one company between Claude Code and every app you connect, so read its permissions screen.

These services don't choose tools for you, either. treg's docs say plainly that it compares providers but "does not route between providers automatically." For a side-by-side of the services themselves, see how tool routers compare.

If what you actually want is many tools without per-machine setup, that's what a Bento workspace does. Gmail, Slack, Notion and thousands more apps are connected once for the whole workspace, and you choose which agents may use each connection.

Nobody edits ~/.claude.json on their laptop or pastes tokens into .mcp.json. Every agent with access uses the same connection, and a teammate gets it without setting anything up.

The limit, honestly: this covers work you run in Bento. Claude Code in your own terminal still needs its own servers, set up as described above.

If most of your MCP setup exists so an agent can read your inbox, update a CRM or post a summary to Slack, rather than to work inside a code repo, try Bento with your apps connected and skip the config.

Can I use my Claude app connectors in Claude Code?

Yes. Connectors you add at claude.ai appear in Claude Code automatically when you're logged in with a claude.ai account. They're labeled as coming from claude.ai in /mcp. If they're missing, run /status: an ANTHROPIC_API_KEY, an apiKeyHelper or a third-party provider such as Bedrock stops them from loading.

A server you add in Claude Code wins over a connector that points at the same URL. The connector then shows as hidden. Already set servers up in Claude Desktop? claude mcp add-from-claude-desktop imports them on macOS and WSL. More on connectors in the Claude app.

Which MCP servers should I start with?

Start with the one app you paste from most, usually your issue tracker, your error monitor or your database. Add one, use it for a week, then add the next. For a vetted shortlist with install commands, see 8 MCP servers for Claude Code you can defend.

Why is my MCP server not connecting?

Run claude mcp list, then claude mcp get <name> for the full Issue: line. Most failures fall into one of these:

What you seeWhat it meansFix
! Needs authenticationAdded, but not signed in/mcp → sign in, or claude mcp login <name>
✘ Failed to connect — Protected resource … does not match expected …The URL differs from the one the server's sign-in expects, often by a trailing slashUse the vendor's URL exactly. For treg, https://treg.to/mcp/ works and https://treg.to/mcp fails
⏸ Pending approvalA project server from .mcp.json you haven't approvedRun claude in the repo and accept
401 when the header is Bearer ${ANTHROPIC_API_KEY}Claude Code deliberately reads its own and other credential variables as empty in remote URLs and headersCopy the key into a variable with your own name
Invalid environment variable format: <name>The server name came right after --envPut --transport stdio between --env and the name
has a "url" but no "type"A JSON entry without "type" is treated as a local commandAdd "type": "http"
Conflicting scopes warningSame name in two scopes with different URLsKeep one: claude mcp remove <name> -s user (or -s local)
"Leading or trailing whitespace" warningA pasted token carried a newlineEdit the value; Claude Code won't trim it
Server missing from /mcpAdded in another project folder, or hidden by a duplicateclaude mcp get <name> shows the scope; add with --scope user if you want it everywhere
Slow start or timeoutsStartup is too slow, or a long callMCP_TIMEOUT=10000 claude, or a per-server "timeout" in milliseconds. Calls still running after 2 minutes move to the background on their own
"Output exceeds" warningA tool returned more than 10,000 tokensDefault cap is 25,000; raise with MAX_MCP_OUTPUT_TOKENS. Text over 50,000 characters is saved to a file

Hosted servers that drop mid-session are retried five times automatically. A local server that crashes stays failed until you pick Reconnect in /mcp. To retry everything at once, run /mcp reconnect all.

Most rows in that table are sign-in and config problems. For agent work outside your code repo, a Bento workspace connects each app once, so there's no local config to drift.

When is Bento simpler than setting up MCP?

When the tools are for jobs around the code, not inside it. If an agent should read your inbox, update a CRM, research on the web or post a summary to Slack on a schedule, Bento does that without any servers to add.

Each workspace runs on its own always-on computer, so scheduled agents keep running after you close the laptop. Bento picks the best AI for each job, works with Gmail, Slack, Notion and thousands more apps, and never trains on your files. Your whole team joins at no extra cost per person.

Plans are $20, $50 or $200 a month, and credits refresh monthly. For Claude Code in your own terminal, keep the setup above: Bento doesn't replace it.

Make anything. One subscription. Start with $5 of free credits.

Frequently Asked Questions

Is Claude Code MCP free?

Connecting servers is part of Claude Code and costs nothing extra. The servers themselves may charge: Zapier counts two tasks per successful call, and treg meters calls that use its keys. Many servers, such as the filesystem server, are free.

How do I remove an MCP server?

Run claude mcp logout <name> first if you signed in, then claude mcp remove <name>. Removing deletes the stored sign-in on your machine but doesn't revoke it at the provider. Logging out does, where the provider supports it.

Can subagents use MCP tools?

Yes. MCP tools are named mcp__<server>__<tool>, and that's the name to use in a subagent's tools list, a skill's allowed-tools or a permission rule. Tools from a plugin's server use the longer mcp__plugin_<plugin>_<server>__<tool> form.

Do more MCP servers slow Claude Code down?

Not much, while tool search is on (the default). Only tool names load up front. Claude Code sets no per-server tool limit, so your context window is the real ceiling.

Can I use the same servers in the Claude app?

Hosted ones, often yes. Connectors in Anthropic's directory run on the same MCP setup, so any remote server listed there can also be added with claude mcp add. Local stdio servers run only where Claude Code runs. More on connectors in the Claude app.

Is MCP the same as a skill?

No. MCP connects Claude to a tool, and a skill tells Claude how to do a job, often using those tools. Here's how MCP differs from skills and plain tools.

Make anything. One subscription.

Posts, reels, ads, apps and games, made with the best AI.

Free credits to try it all. Nothing to set up.

Related guides