Claude MCP Explained: Where Each Connection Actually Comes From

Claude connects to MCP servers three different ways: a local config file in Claude Desktop, a claude mcp add command in Claude Code, and a connector parameter in the API. The surface decides who opens the connection, so it decides what can work.

Tech Talk News Editorial8 min read
#mcp#model context protocol#ai#anthropic#agents
ShareXLinkedInRedditEmail
Claude MCP Explained: Where Each Connection Actually Comes From

Key takeaways

  • Claude uses the Model Context Protocol (MCP), which Anthropic announced on November 25, 2024, through a client built into each host app: Claude Desktop, Claude Code, and the Claude API each connect to MCP servers differently.
  • Claude Desktop starts local servers from a claude_desktop_config.json file, while remote servers are added as custom connectors, and those connections originate from Anthropic's cloud, so the server must be reachable over the public internet on port 443.
  • Claude Code adds servers with claude mcp add using http, sse, or stdio transport, stores them in local, project, or user scope, and warns when a tool result exceeds 10,000 tokens, with a default maximum of 25,000 tokens set by MAX_MCP_OUTPUT_TOKENS.
  • The Claude API connector takes remote servers through an mcp_servers array and a matching mcp_toolset, supports only tool calls from the MCP specification, cannot reach local stdio servers, and leaves OAuth token handling to your code.
  • Anthropic's own docs tell you to connect only to servers you trust, because servers that fetch external content can expose you to prompt injection.

Claude connects to MCP servers through a client built into whichever app you're using, and each of the three places Claude can run, Claude Desktop, Claude Code, and the Claude API, makes that connection a different way. The Model Context Protocol (MCP) is the open standard underneath, which Anthropic announced on November 25, 2024.[1]

Most guides treat these as one feature with three menus. I think that hides the thing that actually decides whether your setup works: who opens the connection, and from where. A server on your laptop works in one place, a server behind your company VPN works in another, and a server on the public internet works in all three.

Nov 25, 2024
MCP announced, with local server support in Claude Desktop
443
The only port custom connectors can reach on your server
10,000
Tokens of MCP tool output before Claude Code flags a warning
25,000
Default maximum MCP output tokens in Claude Code

MCP gives Claude one client per server

The architecture is short. An MCP host is “an AI application like Claude Code or Claude Desktop,” and it creates one MCP client for each MCP server it connects to. Each client keeps a dedicated connection to its server.[2] The server is just a program that provides context, wherever it runs.

Servers can expose three things: tools (functions Claude can invoke to take actions), resources (data that gives Claude context), and prompts (reusable templates).[2] They talk over one of two transports.

Stdio uses a local process on the same machine, and Streamable HTTP, which supports bearer tokens and API keys and recommends OAuth, serves remote clients.[2] If the basics are new, start with what MCP is, and if you want to write a server, see the production MCP server guide.

One protocol, three Claude surfaces

The host app opens the connection, so the host decides what can connect.

Where the server runs

  • Local process on your machineStdio transport
  • Public HTTPS serverStreamable HTTP transport

MCP client inside the host app

One client per server

Where Claude uses it

  • Claude DesktopConfig file or custom connector
  • Claude Codeclaude mcp add
  • Claude APImcp_servers plus mcp_toolset
Out of reach for the APILocal stdio serversThe connector needs a publicly exposed HTTP server

The same server can work in some surfaces and not others, depending on where the connection starts.

Claude Desktop runs local servers as you, and reaches remote ones from the cloud

Local servers go in a JSON file. In Claude Desktop you open Settings, go to the Developer tab, and click Edit Config, which opens claude_desktop_config.json.[3] The docs' own example starts the filesystem server with two folders it may access.

claude_desktop_config.jsonJSON
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Desktop",
        "/Users/username/Downloads"
      ]
    }
  }
}
The filesystem server example from modelcontextprotocol.io (macOS paths). Fully quit and restart Claude Desktop after saving.

Two details from that page matter. Each action needs your approval before it runs. And the warning is blunt: “The server runs with your user account permissions, so it can perform any file operations you can perform manually.”[3] The config file is also where most first attempts fail.

The docs' troubleshooting list starts with restarting completely, checking the JSON syntax, and using absolute paths.[3]

“The server runs with your user account permissions, so it can perform any file operations you can perform manually.”
modelcontextprotocol.io, Connect to local MCP servers

Remote servers take a different route. On the MCP project's docs, Claude's way in is a custom connector.[4]

On Pro and Max you go to Customize, then Connectors, click Add, choose Add custom connector, and enter the server's URL. Free, Pro, Max, Ultra, Team, and Enterprise plans can all add them, and Free users are limited to one.[5]

Here is the catch that the menu doesn't tell you. Per the Help Center, connections start from Anthropic's cloud infrastructure, not your device, so your MCP server “must be reachable over the public internet from Anthropic's IP ranges,” on standard HTTPS port 443.[5]

A server behind a VPN or firewall won't connect unless you allowlist those addresses.[5] That one fact explains most “works in Claude Code, fails in Claude” reports.

Heads up

Anthropic's docs warn that custom connectors reach services “that haven't been verified by Anthropic,” and that Research “can invoke connector tools without approval,” so be careful with write actions.[5] That second line made me wince. A tool that can change things plus a mode that skips the confirmation prompt is the combination I'd keep read-only.

Claude Code adds servers from the terminal, in three scopes

Claude Code is the one where you'll spend the least time in a settings screen. The docs call HTTP “the recommended option for connecting to remote MCP servers,” mark the SSE transport as deprecated, and describe stdio servers as local processes on your machine.[6]

terminalShell
# Remote server over HTTP
claude mcp add --transport http notion https://mcp.notion.com/mcp

# Local stdio server
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
  -- npx -y airtable-mcp-server

# See what you have
claude mcp list
The three transports, using the examples in the Claude Code docs. The double dash separates Claude's options from the server command.

Where a server is stored depends on its scope. Local scope (the default) keeps it in ~/.claude.json for the current project only. Project scope writes a .mcp.json file in the project root that your team shares through version control. User scope loads it in all your projects.[6]

Project servers need approval in interactive sessions, and the docs note that “a cloned repository can't approve its own servers.”[6] I like that rule. A .mcp.json that could run itself would be an easy way to turn a git clone into code execution.

There are limits that affect how tools behave. Claude Code warns when any MCP tool output exceeds 10,000 tokens and sets a default maximum of 25,000 tokens, which you can change with the MAX_MCP_OUTPUT_TOKENS environment variable.[6]

Authentication for OAuth servers goes through the /mcp command, where you “follow the steps in your browser to log in.”[6] It also runs the other direction: running claude mcp serve starts Claude Code itself as a stdio MCP server for other apps.[6] For what that agent loop looks like when it runs unattended, see Claude Code routines.

The Claude API connector is the narrowest door

The API route skips the MCP client entirely. Anthropic's MCP connector lets you “connect to remote MCP servers directly from the Messages API without a separate MCP client.” It's in beta, and the docs list mcp-client-2026-09-15 and mcp-client-2025-11-20 as beta headers, with the example using the latter.[7] You pass two things on each request:

request body (excerpt)JSON
{
  "mcp_servers": [
    {
      "type": "url",
      "url": "https://example-server.modelcontextprotocol.io/sse",
      "name": "example-mcp",
      "authorization_token": "YOUR_TOKEN"
    }
  ],
  "tools": [
    {
      "type": "mcp_toolset",
      "mcp_server_name": "example-mcp"
    }
  ]
}
The mcp_servers array defines the connection. The mcp_toolset entry in tools decides which of its tools Claude may use. From the Claude API docs.

The limits are stated plainly. Of the MCP specification's feature set, “only tool calls are currently supported,” so no resources or prompts.

The server “must be publicly exposed through HTTP” (Streamable HTTP and SSE both work), and local stdio servers “cannot be connected directly.”[7] For OAuth, you do the work: “API consumers are expected to handle the OAuth flow and obtain the access token,” and refresh it yourself.[7]

What you get in exchange is control. A toolset can enable or disable tools, either individually or by setting a default of enabled: false and switching on only the ones you want, and it can defer loading tool descriptions so a large server doesn't eat your context.[7]

For an agent you ship to customers, an allowlist is the sane default.

SurfaceHow you add a serverLocal stdioWho opens the connection
Claude Desktop, localEdit claude_desktop_config.jsonYesYour machine
Claude Desktop, custom connectorAdd custom connector with a URLNoAnthropic's cloud, port 443
Claude Codeclaude mcp add, or .mcp.jsonYesYour terminal session
Claude API connectormcp_servers plus mcp_toolsetNoThe API, using your token

Sources: modelcontextprotocol.io, Claude Help Center, Claude Code docs, and Claude API docs.

Takeaway

Before you pick a surface, ask where your server lives. A local process belongs in Claude Desktop or Claude Code. A server that only your network can see needs Claude Code, or an allowlist of Anthropic's IP ranges. Anything customer-facing goes through the API with an allowlisted toolset.

The protocol changed shape, and that matters less than the trust

One more current detail. The architecture docs I read on November 18, 2026 describe protocol version 2026-07-28 as stateless: “every request contains all the information needed to process it,” with the protocol version and capabilities carried on each request.[2]

That's a real change from the connection-based picture in older tutorials, and it's the kind of thing the client handles for you. You'll rarely touch it unless you write a server.

What you will touch is the trust decision, and the docs are consistent about it.

Claude Code's page says to “verify you trust each server before connecting it,” because servers that fetch external content can expose you to prompt injection.[6] The same risk is why I'd read the MCP security problem before installing anything from a registry, and why a toolset allowlist isn't optional for production.

If you're choosing between coding agents that use these servers, see Claude Code vs Cursor, and if you're building one, the Claude Agent SDK is the next stop.

Pick one server you already trust, add it in Claude Code with a single command, and watch which tools show up in /mcp. It takes about a minute, and then the rest of this post stops being abstract.

Primary sources

  1. 1.PrimaryAnthropic, "Introducing the Model Context Protocol". November 25, 2024. The problem MCP solves, pre-built servers, and local MCP support in Claude Desktop.
  2. 2.PrimaryModel Context Protocol, "Architecture overview". Host, client, and server roles; stdio and Streamable HTTP transports; tools, resources, and prompts; stateless protocol version 2026-07-28.
  3. 3.PrimaryModel Context Protocol, "Connect to local MCP servers". Claude Desktop config file, Developer settings, filesystem example, approval flow, and troubleshooting.
  4. 4.PrimaryModel Context Protocol, "Connect to remote MCP servers". Custom connectors as the route from Claude to remote servers, and the best-practice security notes.
  5. 5.PrimaryClaude Help Center, "Get started with custom connectors using remote MCP". Plans, how to add a connector, cloud-originated connections, port 443, and the security warnings.
  6. 6.PrimaryClaude Code documentation, "Connect Claude Code to tools via MCP". claude mcp add, transports, scopes and storage, OAuth, output limits, claude mcp serve, and the trust warning.
  7. 7.PrimaryClaude API documentation, "MCP connector". Beta status and headers, mcp_servers and mcp_toolset, tool-calls-only and public-HTTP limits, and OAuth handling.

Frequently asked questions

What is Claude MCP?
Claude MCP is Claude's support for the Model Context Protocol, an open standard that lets an AI application connect to outside tools and data through servers. Anthropic announced MCP on November 25, 2024. Claude Desktop, Claude Code, and the Claude API each include an MCP client, and each client talks to MCP servers that expose tools, resources, and prompts.
How do I add an MCP server to Claude Desktop?
For a local server, open Settings, go to the Developer tab, click Edit Config, add the server under mcpServers in claude_desktop_config.json, and fully restart Claude Desktop. For a remote server, add a custom connector from the Connectors settings by entering the server's URL. Local servers run on your machine, and remote connectors are reached from Anthropic's cloud.
How do I add an MCP server to Claude Code?
Run claude mcp add with a transport and a name, for example claude mcp add --transport http notion https://mcp.notion.com/mcp for a remote server. Use --transport stdio with a command after a double dash for a local process. Claude Code stores the server in local scope by default, or in a .mcp.json file if you choose project scope, and you manage servers with claude mcp list and the /mcp command.
Can the Claude API use MCP servers?
Yes, through the MCP connector, which is in beta. You pass an mcp_servers array and a matching mcp_toolset in the tools array on a Messages API request. It supports only tool calls from the MCP specification and needs a remote server reachable over HTTP, so local stdio servers can't connect directly. If the server needs OAuth, your code obtains and refreshes the token.
Is it safe to connect Claude to an MCP server?
It is as safe as the server you connect. Anthropic's docs say to verify you trust each server, because servers that fetch external content can expose you to prompt injection, and a local server runs with your user account's permissions. Connect only to servers from organizations you trust, limit scopes, and turn off tools you don't need.

Written by

Tech Talk News Editorial

Computer engineering background. Writes about software, AI, markets, and real estate, and the places where the three meet.

More about the author
ShareXLinkedInRedditEmail