Use TraderX with Claude Code

Add TraderX to Claude Code with one command, then sign in or use a personal key.

Sign in with TraderX

The quickest way on your own computer. Add the server:

Terminal
claude mcp add traderx --transport http https://mcp.bbtraderx.com/mcp

Start Claude Code, run /mcp, pick traderx and choose to authenticate. Your browser opens a TraderX page that shows what Claude Code is asking for. Approve it and go back to the terminal.

Create a personal key

For servers, containers and CI, where there is no browser to sign in from.

Keep the key private

Store it in an environment variable or your app's secret settings. Never commit it or paste it into a chat. If it leaks, revoke it in Settings and make a new one.
  1. Open Settings > AI agents

    Sign in to TraderX and open Settings > AI agents.

  2. Create a key

    Give it a name you will recognise later, like the machine or app it runs on.

  3. Copy it once

    The key starts with bbtx_pat_ and is shown only once. It doesn't expire; it works until you revoke it.

Terminal
export TRADERX_API_KEY="bbtx_pat_..."

Add the server with the key

Terminal
claude mcp add traderx --transport http https://mcp.bbtraderx.com/mcp --header "Authorization: Bearer $TRADERX_API_KEY"

Your shell fills in the key when you run the command, and Claude Code saves it in your local config. Add --scope user to make TraderX available in every project.

To share the setup with a team through a project .mcp.json, don't put the key itself in the file. Claude Code expands environment variables there, so each person keeps their own key:

.mcp.json
{
  "mcpServers": {
    "traderx": {
      "type": "http",
      "url": "https://mcp.bbtraderx.com/mcp",
      "headers": { "Authorization": "Bearer ${TRADERX_API_KEY}" }
    }
  }
}

Verify the connection

Terminal
claude mcp list

traderx should show as connected. If it asks for authentication, run /mcp again. To remove it, run claude mcp remove traderx.

“localhost refused to connect” after Approve

Claude Code picks up the sign-in on your computer, so this page means it had stopped waiting. Your TraderX account is fine.

  1. Sign in to TraderX first

    Open bbtraderx.com in your browser and sign in, so the approval page opens straight away.

  2. Start again from the app

    Keep Claude Code open, start connecting again, and approve right away in a browser on the same computer.

  3. Or use a key

    A personal key skips the browser altogether: create one in Settings > AI agents and add it as an Authorization header.

Try it

Start a new Claude Code session and ask it to use TraderX:

  • Review

    List my TraderX strategies and tell me which are paused and why.

  • Monitor

    Show the latest trades on my BTC strategy and explain any runs that failed this week.

  • Discover

    Show the top published strategies on TraderX and what coins they trade.

More in Example prompts. These only read your account, so they never change your strategies.

Prefer a guided setup?

The TraderX skill: Tell Claude to install the TraderX skill, then say “setup traderx”.

Using Claude in the browser or the desktop app instead? See Claude.