Back to magertron.com

Claude Code

Magertron for Claude Code

Anthropic’s terminal agent, pointed at your platform. One config file, one token — and every tool call it makes is authorized when it happens, billed to a contract, and written down with your name on it.

1 · Called Claude picks a tool and calls it through the gateway, as you.
2 · Judged Your entitlements are evaluated for that call, at that moment.
3 · Recorded Allowed or refused, the decision and the rules behind it are kept.

Install

Claude Code is Anthropic’s, not ours. It installs from npm and needs Node 18 or later.

npm install -g @anthropic-ai/claude-code
claude --version
Version 2.1.202 or later. Earlier versions report a malformed config as command: expected string, received undefined, which tells you nothing about what is actually wrong.

Get your config

The Developer Portal writes it for you, from the servers you can actually call.

  1. Open the Developer Portal and click Add to IDE
  2. Choose Claude Code from the dropdown
  3. Download the file and save it as .mcp.json at your project root
Your browser will drop the leading dot. Most refuse to write a dotfile, so the download arrives as mcp.json. Rename it — Claude Code looks for .mcp.json and will not find the other.

Pick the right client in that dropdown. Claude Code needs a type field on every entry and expands ${MCP_TOKEN}, where Cursor and VS Code expect ${env:MCP_TOKEN}. Give it the wrong one and it either skips the server or sends the literal text as your token — a 401 that looks like a permissions problem and is not.

Authenticate

Mint a token in the portal, then export it in the shell you will run Claude Code from.

export MCP_TOKEN="<your token>"

The file itself holds no credential — only the reference. It is safe to commit, and committing it is the point: your team gets the same servers without anyone mailing a token around.

The token is yours, not a service account’s. Every call Claude Code makes carries it, so the audit trail names a person. When someone asks who ran a query six weeks ago, there is an answer.

Approve and connect

Servers from a project file need your say-so before Claude Code will use them.

cd your-project
claude

It asks you to approve the servers it found. That is Claude Code’s own safety step, not ours — a repository you cloned should not be able to silently point your agent at a server you have never seen. Approve them, then check with /mcp.

Then ask for something

What time is it in Tokyo?

Claude picks the tool, calls it through the gateway, and answers. The vendor credential that call needed was injected on the way through. You never held it.

When it does not work

Run claude mcp get <server>. The Issue: line carries the status and whatever the server said.

What you seeWhat it means
Pending approval Run claude in that directory. claude mcp list cannot approve on your behalf
401 Your token is missing, expired, or exported in a different shell than the one you started Claude Code in
403 Magertron refused. You are connected and authenticated but not entitled — ask your administrator
upstream connect error That server’s own backend is unreachable. Nothing to do with your setup
A tool that vanished was probably not revoked. Magertron refuses calls to tool definitions that changed since a human last reviewed them, which is what stops a server quietly widening what it can do after you connected to it. Your administrator approves the new definition and it comes back.

Why route through Magertron at all

You could point Claude Code straight at these servers. Here is what you would be giving up.

DirectThrough Magertron
A vendor key per server, on your machine One Magertron token. The gateway holds the vendor credentials and injects them per call
Whatever the key allows, until someone rotates it Your entitlements as they are at the moment of the call. A grant revoked five minutes ago is already gone
Spend on a shared key nobody can attribute Cost against a contract, attributed to you
Whatever the vendor happens to log Who called, what the rules were at the time, and what was decided — signed, and reconstructed from the audit trail on read

Terminal notes

Claude Code redraws as it works, which some terminals take better than others.

In Konsole, copy and paste are Ctrl+Shift+C and Ctrl+Shift+V — plain Ctrl+C interrupts. For one question without the interactive interface:

claude -p "what time is it in Tokyo?"

That prints an answer and exits. It cannot approve project servers, so run claude interactively once first.

Claude Code also has extensions for VS Code and JetBrains, which run the same agent inside your editor. The configuration is identical — the same .mcp.json, in the same place.