Claude Code
Phantom connects to Claude Code as a channel: the messages you write on Phantom's Agent page or panel arrive in a running Claude Code session at once, Claude works on your workstation with every Phantom tool, and its answer comes back into the same conversation. One registration gives both the live channel and the tools. Clients without channels use the plain MCP endpoint instead (tools only).
Settings → AI & Agents → Add connection → Bridge → Claude Code shows these steps, numbered, with this machine's real commands filled in: the Python that runs the backend, the absolute path of backend/mcp_server.py, the backend's own address and the token just created (or rotated from the connection's row menu). Copy them from there; nothing below needs to be typed by hand.
Troubleshooting, rotation and how the channel works: Claude Code: troubleshooting.
Before you start
Phantom is running. Any of these starts the backend on port 8000:
bashpython run.pybashmake runbashdocker compose up --buildWith Docker the backend's paths are the container's, so the channel command shown in Settings does not apply on the host: run Phantom from a checkout for the channel, or use tools only.
Claude Code is installed and up to date. Channels are a research preview and change between releases.
bashclaude updateYou are signed in with a claude.ai account or a Console API key. Channels are not available through Amazon Bedrock, Google Cloud or Microsoft Foundry.
Team and Enterprise plans: an Owner must enable channels (Organization settings → Claude Code → Channels, or
channelsEnabledin managed settings). Pro, Max and Ultra accounts without an organization need nothing.
1. Turn MCP on
Settings → AI & Agents → Overview (first step) or Connections, MCP server. It is on by default. Off, every agent request (MCP and the Agent Bridge) answers 503 mcp_disabled and open agent streams close; the interface keeps working. Agents can never change this switch.
2. Create a token
Settings → AI & Agents → Add connection → Bridge → Claude Code (recommended). Name it and pick a preset; the token reaches every vault (AI access is global). Full access is literally everything a grant can allow, including scope changes, deleting history and vaults, finalising and exporting reports:
| Preset | Good for |
|---|---|
| Read only | Exploring: Claude reads traffic, notes and findings and replies in Phantom |
| Research assistant | Day-to-day work: also writes notes, works tasks and asks for approvals |
Research assistant + testing.execute | Only when Claude may replay requests and start scans |
The channel needs bridge.read and bridge.create, which every preset has. The token is shown once; the result view shows the commands of the next steps with it filled in.
3. Register Phantom in Claude Code
Remove an earlier registration first; Claude Code refuses a second phantom entry ("already exists"), and on a first setup this only reports that none was found:
claude mcp remove phantom --scope userThen run the registration command from Settings once. On Linux and macOS it looks like this (the values are this machine's):
claude mcp add phantom --scope user --transport stdio --env PHANTOM_URL=http://127.0.0.1:8000 --env PHANTOM_MCP_TOKEN=<token> -- <python> <checkout>/backend/mcp_server.py --channelOn Windows the paths are Windows paths, quoted where they hold spaces. When Phantom runs in WSL, Settings first asks where Claude Code runs, Windows or WSL, and shows only that side's commands: on Windows the script starts through wsl.exe (Windows and WSL). Check the result with claude mcp get phantom: Status should read Connected. The command stores the server, with its token, in Claude Code's user configuration (~/.claude.json, readable by your user only). Treat that file like a password: never commit it, and never paste the token into chats or issues. If it was exposed, rotate the token.
PHANTOM_URL is the backend itself (port 8000), not the interface's development server on 5173. The channel derives the MCP endpoint (/mcp) and the Bridge (/api/v1/bridge) from it.
4. Start Claude Code with the channel
claude --dangerously-load-development-channels server:phantomClaude Code shows a warning that lists the development channels being loaded. Choose I am using this for local development: Phantom's channel is not on Anthropic's channel allowlist yet, and this flag is how a channel outside it is opted in, one session at a time. Without the flag the tools still work but no message arrives. Below the startup banner Claude Code then confirms that messages from server:phantom inject directly in this session.
5. Write from Phantom
Open the Agent page (or the panel), start a conversation with the claude-code agent, which appears once the session has started, and write. Attach flows, notes or findings as references if you like. The message arrives in the session as:
<channel source="phantom" conversation_id="3" message_id="41" vault_id="1" sender="phantom_user">
Look at the login flow
Attached: flow:812
</channel>Only your own messages are pushed; replies of agents and system messages never are. Messages you wrote while Claude Code was closed arrive when the session starts.
6. How Claude replies
Claude answers with the phantom_reply tool, passing the conversation id; the reply appears in Phantom at once. phantom_conversation reads the recent history. Claude also has every Phantom tool (flow_get, note_get, finding_list, …) within the token's grants. Your terminal shows the tool call, not the reply text: read the answer in Phantom.
7. Approve tool prompts from Phantom (optional)
When Claude wants to run a local tool that needs approval (Bash, Write, Edit), Claude Code asks in the terminal. With the permission relay, the same prompt also appears as an approval card in the Phantom conversation you last wrote from, marked Claude Code local tool, with the tool, what it does and its input. Approve or deny it there; whichever answer comes first, terminal or Phantom, wins.
The risk: whoever can use this Phantom interface can then approve commands on this machine. Phantom's token grants do not limit those tools: they run in Claude Code, not in Phantom. Leave the relay off unless you are the only person with access to the workstation.
To turn it on, remove the registration and register again with the relay command from Settings, which adds one variable:
claude mcp remove phantom --scope userclaude mcp add phantom --scope user --transport stdio --env PHANTOM_URL=http://127.0.0.1:8000 --env PHANTOM_MCP_TOKEN=<token> --env PHANTOM_CHANNEL_PERMISSIONS=1 -- <python> <checkout>/backend/mcp_server.py --channelA relayed prompt waits ten minutes in Phantom; after that the card expires and the terminal prompt stays open.
8. Check the connection
claude mcp listphantom is listed as connected. Inside the session, /mcp shows its status and tools. In Phantom, Settings → AI & Agents → Connections shows the connection as Connected, with claude-code as its client.
Tools only
For clients or sessions without channels, the same tools over HTTP, with no live messages:
claude mcp add --transport http phantom http://127.0.0.1:8000/mcp --header "Authorization: Bearer phm_pat_…"Other clients: Phantom MCP server.