MCP

How to Add MCP Servers to Claude Code in One Entry

By Kavin M KPublished Updated 8 min read

Quick answer
Run Setup for Claude Code in Prism's MCP tab. Prism writes a single HTTP entry into ~/.claude.json under mcpServers, pointing at http://127.0.0.1:11434/mcp/claude-code with Authorization: Bearer prism. Only the servers you allow for that agent id are reachable.

Claude Code supports MCP servers natively, and adding one is easy. Adding the fifth one is not. Each server needs its own entry, its own token, and — if it uses OAuth — its own consent flow run from Claude Code itself. When you also use Cursor, Codex or Zed, you configure the same servers again in each.

There is a shorter path. Configure your MCP servers once in Prism, then give Claude Code a single entry that reaches all of them. Claude Code has no idea the other servers exist; it just sees a bigger tool list.

How Claude Code stores MCP servers

User-scope MCP servers live in ~/.claude.json under the mcpServers key. Note that this is a different file from ~/.claude/settings.json, which holds the environment variables that route its model traffic. Prism writes both, to different files, for different reasons.

{
  "mcpServers": {
    "weather": { "command": "npx", "args": ["-y", "@example/weather-mcp"] },
    "linear": { "type": "http", "url": "https://mcp.linear.app/mcp" }
  }
}

Without a gateway that list grows one entry per server, and the credentials inside it are Claude Code's problem to manage.

What Prism writes instead

1

Add your servers in Prism

Open the MCP tab and add each server, choosing a transport and an auth mode. Authorise any OAuth servers once.
2

Grant Claude Code access

In the Agent access panel, tick the servers Claude Code should reach. A shorter list is a deliberate security choice, not a limitation.
3

Restart Claude Code

Claude Code reads its MCP config at startup. Restart it after Prism writes the entry.
4

Check the tool list

Ask Claude Code what tools it has, or call /mcp. You should see names of the form mcp__<server>__<tool>.
{
  "mcpServers": {
    "prism": {
      "type": "http",
      "url": "http://127.0.0.1:11434/mcp/claude-code",
      "headers": { "Authorization": "Bearer prism" }
    }
  }
}
One entry, an explicit allowlist
The /mcp/claude-codepath is the per-agent endpoint. Claude Code can reach exactly the servers you ticked for that agent id and nothing else — a call to any other server is rejected with "server is not enabled for this endpoint". Using /mcp without the suffix would expose every enabled server instead.

Why namespacing matters here

Once several servers are behind one endpoint, collisions become possible: two servers can both define a tool called search. Prism prefixes every tool with its server id, so mcp__github__search and mcp__docs__search stay distinct and route to the right upstream. Only the first double underscore after the server id splits the name, so an upstream tool whose own name contains __ still works.

OAuth without five consent screens

This is the part that saves the most time. Instead of each client running its own MCP OAuth flow, Prism discovers the server's authorization server, registers a client, opens the browser once, and stores the access and refresh tokens locally with file mode 0600. Tokens are refreshed automatically before expiry, and an upstream 401 triggers a refresh and a single retry.

If a server is not authorised yet and auto_connect is on (the default), the first call that hits it opens the sign-in window by itself. Claude Code gets an error on that one call and succeeds on the retry after you approve.

When tools do not appear

curl http://127.0.0.1:11434/mcp/status -H "Authorization: Bearer prism"

Four states explain almost every case:

needs_auth

The upstream rejected the stored credential. Authorise the server in the MCP tab.

runtime_missing

The stdio command could not be found. Install Node or uv, or give an absolute path.

idle

Normal. A local server process was reaped after 300 idle seconds and starts again on the next call.

"not enabled for this endpoint"

The server exists but is not on Claude Code's allowlist. Add it in Agent access.

Keeping model and MCP setup separate

It is worth knowing that these two integrations touch different files and fail independently: model routing lives in ~/.claude/settings.json, MCP in ~/.claude.json. If Claude Code suddenly talks to Anthropic directly, that is the settings file being rewritten by Claude Code's own file watcher — restart Prism and it re-syncs. If tools vanish instead, the MCP side is the place to look.

Undoing it
Clicking Disable in Prism removes only Prism's MCP entry and its model env keys, leaving every server you configured yourself in place.

Reference

Every claim on this page is checked against the Prism source, and the reference documentation is where those details live in full.

Try it yourself

Prism is a free, MIT-licensed local proxy for AI coding agents. Install it, point one agent at http://127.0.0.1:11434, and the rest of this post applies as written.