Guide
Claude Code MCP servers
Harrowtech.ai · last checked 13 October 2026
Claude Code MCP support lets Claude read from and act on other tools, such as an issue tracker or a database, through small connectors called MCP servers. This page shows how to add, check and remove one, what the three scopes mean, and what Anthropic says to be careful about.
Harrowtech.ai is independent of Anthropic.
What MCP is
The Model Context Protocol (MCP) is, in Anthropic's words, an open source standard for AI-tool integrations. An MCP server gives Claude Code access to your tools, databases and APIs. Anthropic's advice on when to bother: connect one when you keep copying data into the chat from another tool, so that Claude can read and act on that system directly. Its examples include working from Jira issues, checking Sentry error data, querying PostgreSQL and creating Gmail drafts.
Adding a server
A server connects in one of four ways. For the first three, you pick with --transport.
Remote HTTP is the option Anthropic recommends:
claude mcp add --transport http notion https://mcp.notion.com/mcp
If the server wants a token, add a header:
claude mcp add --transport http secure-api https://api.example.com/mcp \
--header "Authorization: Bearer your-token"
Local stdio servers are programs that run on your machine. Everything after a lone -- is passed to the server unchanged:
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
Remote SSE is deprecated, and Anthropic says to use HTTP where the server offers it. For a service that still only offers SSE, the same --transport http command now works: from version 2.1.265, Claude Code tries HTTP first and switches to SSE when the server does not accept it. On older versions, pass --transport sse.
Remote WebSocket ("type": "ws") is a fourth option, meant for servers that push events to Claude unprompted. --transport does not accept it, so add it as JSON. It supports header tokens only, not OAuth sign-in, so Anthropic says to prefer HTTP for a server that only answers requests.
If you already have the settings as JSON, claude mcp add-json <name> '<json>' adds a server from that. Setup instructions written for Claude Desktop or another client often give an mcpServers block: pass add-json the object inside it, not the wrapper, and add a "type" to any entry that has a url but no type.
Listing, checking and removing
claude mcp list # all servers, with health status
claude mcp get notion # details for one server
claude mcp remove notion # remove it
Anthropic notes that removing a remote server also deletes the sign-in tokens and client registration stored for it. Inside a session, /mcp shows server status, lets you sign in to remote servers, reconnect, or switch a server off without deleting its configuration. In claude mcp list you will see markers such as Connected, Needs authentication and Failed to connect.
What a test run showed
Tested on Claude Code 2.1.296 on 13 October 2026: a server was added in a throwaway folder with claude mcp add --transport http demo --scope project https://example.com/mcp. That is a placeholder address, not a real MCP server. The command created a .mcp.json file containing "type": "http" and the URL. claude mcp list showed it as Pending approval (run claude to approve) and did not connect. claude mcp get demo printed its scope, type and URL, and claude mcp remove demo --scope project emptied the file again. The test did not cover sign-in or a working server.
Scopes: who gets the server
Choose a scope with --scope (or -s). The default is local.
| Local (default) | This project only, just for you. Stored in ~/.claude.json under the project's path. |
|---|---|
| Project | This project only, shared with the team through version control. Stored in .mcp.json at the project root. |
| User | All your projects, just for you. Stored in ~/.claude.json. |
When the same server name is defined in more than one place, Claude Code uses the highest-precedence definition whole, with no merging of fields. The order is local, then project, then user, then plugin-provided servers, then claude.ai connectors. The three scopes are matched by name, while plugin servers and connectors are matched by endpoint, so one pointing at the same URL or command as a server above counts as a duplicate. From version 2.1.259, a server an organisation provides through managed settings outranks all of them.
A shared .mcp.json looks like this:
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}
It can refer to environment variables as ${VAR} or ${VAR:-default}, so a token need not be written into a file you commit. An entry with a url but no type is a configuration error.
Security
Anthropic's warning on its MCP page: verify you trust each server before connecting it. Servers that fetch external content can expose you to prompt injection risk.
That is the main point. Further details from the same page:
- In an interactive session, Claude Code asks you to approve a project-scoped server from
.mcp.jsonbefore it uses it.claude mcp reset-project-choicesclears those answers. - In
claude -p, the Agent SDK and cloud sessions there is nobody to ask, so project servers load without a prompt unless you exclude them. Anthropic names three ways: add them todisabledMcpjsonServers, use--setting-sources, or use--strict-mcp-configwith--mcp-configso that only the servers you name are used. - In a remote server's
urlandheaders, Claude Code's own and cloud-provider credential variables, such asANTHROPIC_API_KEY, read as empty. A project config therefore cannot send them out.
Large results, images and many servers
Three behaviours explain most surprises once a server is connected:
- Big text results. Claude Code warns when a tool's output passes 10,000 tokens, and that warning level is fixed. The default maximum is 25,000 tokens, which you can change with the
MAX_MCP_OUTPUT_TOKENSenvironment variable. A successful text result over the limit is not cut off: Claude Code saves it to a file in the session'stool-resultsfolder and gives Claude the path. Separately, a text result over 50,000 characters is saved the same way whatever its token count, unless the server raises that tool's own limit. - Images. When a tool returns a PNG, JPEG, GIF or WebP image, Claude sees it in the conversation, possibly scaled down or compressed. From version 2.1.283, Claude Code also saves the original file in the same
tool-resultsfolder and gives Claude the path, so it can crop or convert the full-resolution copy. With--no-session-persistence, no file is written and Claude gets only the inline copy. - Many servers. Tool search is on by default. Only tool names and server instructions load at the start of a session, and full tool definitions load when Claude needs them, so Anthropic says adding servers has minimal impact on your context window. Each tool description and each server's instructions are cut off at 2,048 characters by default.
What this guide does not cover
It does not cover writing your own MCP server, OAuth setup for servers that need a pre-registered app, importing servers from Claude Desktop (claude mcp add-from-claude-desktop, macOS and WSL only), using connectors from claude.ai, servers bundled in plugins, or organisation-wide managed MCP files. Anthropic's MCP page covers each.
Sources
- Anthropic: Connect Claude Code to tools via MCP, read 13 October 2026.
- Anthropic: CLI reference, for
--mcp-configand--strict-mcp-config, read 13 October 2026. - Commands run on Claude Code 2.1.296 on 13 October 2026, including
claude mcp add --help.
Related: All Harrowtech.ai guides · Claude Code CLI and headless mode · Claude Code hooks · Claude Code commands and shortcuts