Use TraderX with Codex

Add TraderX to Codex's MCP config with a personal key kept in an environment variable.

Create a personal key

Codex reads the key from an environment variable, so it never sits in a config file.

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 TraderX to Codex

Add this to your Codex config file (usually ~/.codex/config.toml). Codex sends the key from TRADERX_API_KEY as a bearer token.

config.toml
[mcp_servers.traderx]
url = "https://mcp.bbtraderx.com/mcp"
bearer_token_env_var = "TRADERX_API_KEY"

Codex's MCP options change between versions. If your version doesn't accept this, add the same URL and bearer key through its MCP settings; the details for any client are in Any MCP client.

Verify the connection

Start a new Codex session in a terminal where TRADERX_API_KEY is set, and ask it what the TraderX connection can do. It should call limits_get and report read access.

Try it

Start a new chat and ask about your account. A few things to try:

  • 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.