Claude Code CLI
Claude Code is Anthropic’s command-line interface for Claude. Use it if you prefer terminal-based workflows.
Prerequisites
Section titled “Prerequisites”- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Your FIX credentials (see Before You Start
OAuth Method (Recommended)
Section titled “OAuth Method (Recommended)”Step 1: Add the Server
Section titled “Step 1: Add the Server”claude mcp add axiory-ai --transport http \ https://mcp.axiory.ai/mcpStep 2: OAuth Login
Section titled “Step 2: OAuth Login”The CLI opens a browser automatically. Complete the OAuth flow:
- Select your broker server (if available)
- Enter your SenderCompID and FIX API Password
- Set trading mode (readonly/paper/live)
- Click Connect
Step 3: Use in Claude Code
Section titled “Step 3: Use in Claude Code”Now you can interact with the trading tools:
claude
# In the Claude Code prompt:> Show me my open positions> What's the current price of EURUSD?> Buy 100,000 units of EURUSD at marketPortal Token Method (Fallback)
Section titled “Portal Token Method (Fallback)”If OAuth doesn’t open a browser (headless environments):
Step 1: Generate a Token
Section titled “Step 1: Generate a Token”Visit in your browser:
https://mcp.axiory.ai/token-portal- Select your broker server
- Enter your FIX credentials
- Choose trading mode (readonly/paper/live)
- Click Generate Token
- Copy the token (shown once, never again)
Step 2: Configure Claude Code
Section titled “Step 2: Configure Claude Code”Set the token in your shell environment:
export AXIORY_TOKEN="your-token-here"Add the server with the token:
claude mcp add axiory-ai --transport http \ --header "Authorization: Bearer $AXIORY_TOKEN" \ https://mcp.axiory.ai/mcpStep 3: Use It
Section titled “Step 3: Use It”claude
# In the Claude Code prompt:> What's my current account balance?> Place a buy order for EURUSD, 50,000 unitsMaking Your First Trade
Section titled “Making Your First Trade”Once connected:
claude
# Ask Claude:> Can you check that you're connected to cTrader and show me my current positions?
# If connected, place a trade:> I want to buy 100,000 units of EURUSD at the market price. Can you do that?
# In paper mode, it simulates. In live mode, it executes.Token Rotation
Section titled “Token Rotation”Portal tokens expire after 30 days. Before expiry:
- Visit the Token Portal again
- Generate a new token
- Update your environment variable:
Terminal window export AXIORY_TOKEN="new-token-here"
If your token expires, you’ll see “401 Unauthorized” errors. Generate a new one at the Token Portal.
Troubleshooting
Section titled “Troubleshooting””Server not found” or “Connection refused”
Section titled “”Server not found” or “Connection refused””Check that the server was added correctly:
claude mcp listYou should see axiory-ai in the list. If not, re-run the add command.
”401 Unauthorized” (Portal Token)
Section titled “”401 Unauthorized” (Portal Token)”Your token has expired or is invalid.
- Check the token is set:
echo $AXIORY_TOKEN - If empty, set it:
export AXIORY_TOKEN="your-token" - If invalid, generate a new one at the Token Portal
- Update the environment variable and try again
”Invalid credentials”
Section titled “”Invalid credentials””Your FIX credentials are wrong:
- Go to cTrader Settings > FIX API
- Verify your SenderCompID and FIX API Password (NOT your login password)
- Re-generate the token or re-authenticate via OAuth
- Try again
OAuth flow doesn’t open a browser
Section titled “OAuth flow doesn’t open a browser”If you’re on a headless server (no GUI):
- Use the Portal Token method instead
- Or, run
DISPLAY=:0 claude mcp add ...to force X11 display - Or, manually navigate to the OAuth
authorizeendpoint (advanced)
Next Steps
Section titled “Next Steps”- Operating Modes — Understand readonly, paper, and live
- Risk Limits — Position size and daily loss limits
- Choosing an Agent — Compare with other MCP clients
Start with paper mode to test, then switch to live when confident.
