Google Gemini CLI
Google Gemini CLI supports MCP with OAuth. Use this if you’re in the Google ecosystem.
Prerequisites
Section titled “Prerequisites”- Google Gemini CLI installed and configured
- Your FIX credentials (see Before You Start
- Google account
Method 1: Configuration File (OAuth)
Section titled “Method 1: Configuration File (OAuth)”Step 1: Add to Gemini Settings
Section titled “Step 1: Add to Gemini Settings”Edit ~/.gemini/settings.json (or wherever your Gemini config is):
{ "mcpServers": { "axiory-ai": { "url": "https://mcp.axiory.ai/mcp" } }}Step 2: Authenticate in Gemini CLI
Section titled “Step 2: Authenticate in Gemini CLI”When you start Gemini CLI, it should recognize the new server:
geminiIn the CLI, use the /mcp auth command to authenticate:
/mcp auth axiory-aiThis opens a browser with the FIX credentials form:
- Select your broker server
- Enter your SenderCompID (from cTrader Settings > FIX API)
- Enter your FIX API Password (NOT your cTrader login password)
- Set trading mode (readonly/paper/live)
- Click Connect
Step 3: Start Trading
Section titled “Step 3: Start Trading”Back in the Gemini CLI:
/use axiory-ai
> Show me my current positions> What's the EURUSD price?> Buy 100,000 units of EURUSD at marketMethod 2: Portal Token (Fallback)
Section titled “Method 2: Portal Token (Fallback)”If OAuth doesn’t work:
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
- Click Generate Token
- Copy the token
Step 2: Configure with Token
Section titled “Step 2: Configure with Token”Edit ~/.gemini/settings.json:
{ "mcpServers": { "axiory-ai": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.axiory.ai/mcp"], "env": { "AUTHORIZATION": "Bearer YOUR_TOKEN_HERE" } } }}Replace YOUR_TOKEN_HERE with your token from the Token Portal.
Step 3: Restart and Trade
Section titled “Step 3: Restart and Trade”Restart Gemini CLI:
gemini
> Show me my positions> Place a buy order for 50,000 units of EURUSDMaking Your First Trade
Section titled “Making Your First Trade”Once authenticated:
> Can you check that you're connected to cTrader?> Show me my account health.> I want to buy 100,000 units of EURUSD. What's the current price?> Place that buy order now.Gemini will validate, check your risk limits, and execute (or simulate in paper mode).
Token Rotation
Section titled “Token Rotation”Portal tokens expire after 30 days. Before expiry:
- Visit the Token Portal
- Generate a new token
- Update your settings.json with the new token
- Restart Gemini CLI
If your token expires, you’ll see “401 Unauthorized”. Generate a new one.
Troubleshooting
Section titled “Troubleshooting””Server not found” or “Connection refused”
Section titled “”Server not found” or “Connection refused””Check that ~/.gemini/settings.json was saved correctly:
cat ~/.gemini/settings.jsonRestart Gemini CLI after editing the config.
OAuth doesn’t open a browser
Section titled “OAuth doesn’t open a browser”Try using the Portal Token method instead (Method 2 above).
“401 Unauthorized” (Portal Token)
Section titled ““401 Unauthorized” (Portal Token)”Your token is invalid or expired.
- Generate a new token at the Token Portal
- Update settings.json with the new token
- Restart Gemini CLI
”Invalid credentials” in the OAuth form
Section titled “”Invalid credentials” in the OAuth form”Your FIX credentials are wrong:
- Go to cTrader Settings > FIX API
- Verify SenderCompID (includes broker prefix and account number)
- Verify FIX API Password (NOT your login password)
- Copy exactly and retry OAuth or regenerate your Portal Token
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.
