MCP in Claude Code. Add a server with one command and decide who gets access

What MCP is, how to connect a server with claude mcp add, how the local, project and user scopes differ, and what the .mcp.json file and the /mcp command do.

Part of the guideClaude Code, the complete guide. From installation to your own skills and plugins

In this article
  1. What MCP is in Claude Code
  2. The claude mcp add command
  3. Local, project and user scopes
  4. The /mcp command and managing servers
  5. What to watch out for

In short

MCP is an open standard that lets Claude Code connect to outside tools, databases and APIs. You add a server with the claude mcp add command, and the local, project or user scope decides who sees it and in which projects. The /mcp command shows the state of each connection and lets you sign in to a server.

A developer copies a ticket from the issue tracker into Claude Code, then pastes an error from the monitoring tool, then a query result from the database. Anthropic describes exactly this moment as the sign to connect an MCP server. Then Claude reads the ticket and checks the database itself, instead of working from whatever someone pasted.

This page is part of our Claude Code guide. The commands come from the Claude Code MCP documentation, as of 10 November 2026.

What MCP is in Claude Code

MCP, the Model Context Protocol, is an open standard for connecting AI tools to outside systems. An MCP server is a small program or service that gives Claude a set of tools, such as reading tickets, querying a database or drafting emails. Claude Code is the client that uses those tools.

A server can run in the provider's cloud, and you connect to it over the internet. It can also run on your own computer as a local process. That decides which command you use. In the Claude chat, connectors play a similar role, which we describe in our post on connecting AI to your calendar.

The claude mcp add command

You run these commands in a normal terminal, not inside a Claude Code session. A remote server is added over HTTP. Anthropic recommends this transport for cloud services.

bash
claude mcp add --transport http notion https://mcp.notion.com/mcp

If the server needs a key in a header, add it with --header.

bash
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
  --header "Authorization: Bearer YOUR_GITHUB_PAT"

A local server runs as a process on your machine and uses the stdio transport. The double dash separates Claude Code's own options from the command that starts the server. Everything after it goes to the server unchanged.

bash
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
  --dsn "postgresql://readonly:pass@localhost:5432/shop"

The older SSE transport is deprecated. Since version 2.1.265, a command with --transport http falls back to SSE by itself when the server does not accept HTTP. WebSocket servers can only be added with claude mcp add-json or in .mcp.json.

Local, project and user scopes

Every server has a scope. You pick it with --scope, and the default is local.

ScopeWhere it loadsWho sees itWhere it is saved
localCurrent project onlyOnly you~/.claude.json
projectCurrent project onlyThe team via the repository.mcp.json in the project
userAll your projectsOnly you~/.claude.json

A server that holds a key to your account is better kept at local or user. The project scope writes a .mcp.json file that goes into the repository, so everyone on the team gets the same tools.

.mcp.json
{
  "mcpServers": {
    "api-server": {
      "type": "http",
      "url": "https://api.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${API_KEY}"
      }
    }
  }
}

${API_KEY} is an environment variable. The key stays on each person's machine, and only the variable name goes into the repository. When the same server is defined in several scopes, local wins, then project, then user.

The /mcp command and managing servers

In the terminal, claude mcp list shows all servers with their connection state, claude mcp get name shows one in detail and claude mcp remove name removes it. claude mcp add saves the config without checking the key, so a wrong token only shows up when Claude Code connects.

Inside Claude Code you type /mcp. The panel shows which servers are connected and which are waiting for sign in. Many cloud servers use OAuth, and this is where you finish the sign in, in the browser. The panel can also switch a server off without deleting its config.

If you log in to Claude Code with a claude.ai account, connectors you added in claude.ai appear in /mcp by themselves. On Team and Enterprise plans only admins can add connectors in claude.ai.

What to watch out for

Anthropic says plainly that you should check you trust a server before you connect it. A server that fetches content from the internet can bring in prompt injection, an instruction hidden in data that Claude may treat as a command.

Connect databases with a read only user, as in the DBHub example in the docs. Then no query Claude runs can change the data.

Servers from .mcp.json need your approval the first time in a normal session. You can reset those choices with claude mcp reset-project-choices. In claude -p runs and in some cloud sessions there is no such prompt, and project servers load straight away, as we explain in our post on Claude Code in scripts and CI. A next step is hooks, which can also react to tools from MCP servers.

Start with the one system you copy data from by hand most often, and connect it at local scope. If you want to know which of your systems are worth connecting to AI, ask for our free AI audit.

What would you like to change in your business?

Leave your number. We will talk about your process and see whether we can help. The first call is free.

When is the best time to call?
Controller: Oleksandr Bondarenko (BondSoft)Privacy PolicyTerms of Service
Legal details

The data controller is Oleksandr Bondarenko, trading as Oleksandr Bondarenko Software Solutions (BondSoft), ul. Jana Heweliusza 11, 80-890 Gdańsk, Poland, NIP 5833576264, e-mail: office@bondsoft.pl.

We process your data solely to contact you about your enquiry and to present an offer — on the basis of your consent (Art. 6(1)(a) GDPR and Art. 398 of the Polish Electronic Communications Law) and our legitimate interest in handling the enquiry (Art. 6(1)(f) GDPR).

Providing the data is voluntary but necessary for us to reply. You may withdraw your consent at any time by writing to office@bondsoft.pl — this does not affect the lawfulness of processing before the withdrawal.

You have the right to access your data, rectify it, erase it, restrict its processing, transfer it, and lodge a complaint with the President of the Polish Personal Data Protection Office.

Full information: Privacy Policy.

Send us an email

The service this text is about

Automation and AI / OCR

Automation of document re-typing, OCR and checking rules, and your data stays with you.