AI Trading API & MCP Server
Connect any AI agent to your trading account. Execute trades, manage positions, and stream market data through natural language.
#184729.Floating P&L: +$42.50
Margin usage: 12%
EURUSD
#184729GBPUSD
#184731Illustrative example. Not actual trading data. AI agent capabilities depend on the configured client and skill set.
Why XBTFX for AI Trading
Built for traders who want LLMs and agents in the loop, not on the side.
Build Your Own Trading Agent
Design the prompt, policy, and risk rules. Your agent runs against your XBTFX account around the clock — same authentication, same endpoints, same execution speed as your manual trades. Tweak the system prompt, swap models, layer in your own filters; the account doesn't care which agent is calling it.
LLM-Driven Decisions
Agents can reason over news, macro data, your open positions, and your strategy rules before acting. Every action is a structured API call you can audit and replay.
AI-Built Dashboards
Ask your AI agent to build you a custom trading dashboard against your API key. Web, terminal, mobile — whatever fits your workflow. No proprietary frontend to fight with.
Edge & ECN Account Compatibility
Connect any XBTFX MetaTrader 5 Edge or ECN account using any supported base currency. Your existing trading account just becomes programmable.
View account types →Unlimited Automation
REST + WebSocket via the MCP server means anything you can describe in natural language, an agent can execute. No proprietary SDK, no rate-limit walls — just programmable trading.
Works With Your Favorite AI Tools
Plus any other MCP-compatible client or any code that can make an HTTP request.
What You Can Do
Execute Trades via Natural Language
Tell your AI to buy, sell, set stops, take profits. It translates to API calls automatically.
Automated Risk Management
AI monitors your positions, adjusts stop losses, reduces exposure when margin gets tight.
Portfolio Rebalancing
Define target allocations. AI maintains them by sending adjustment trades when drift exceeds your threshold.
Event-Driven Strategies
AI watches news feeds, economic calendars, and price action — executing trades when conditions are met.
Trade History Analysis
Ask your AI to analyze past trades, calculate win rates by symbol, and identify your best setups.
Real-Time Market Monitoring
Stream live quotes via WebSocket. AI alerts you to price levels, spread changes, or volatility spikes.
How AI Trading Works
Three paths to connect AI to your XBTFX account. Choose the one that fits your workflow.
Skills Hub
Install a skill file into Claude Code, LangChain, CrewAI, or any agent framework. The skill teaches your AI how to use the XBTFX Trading API.
View Skills →MCP Server
Connect the XBTFX MCP server to Claude Desktop, Cursor, Windsurf, or VS Code Copilot. Your AI gets direct access to trading tools.
Learn More →Direct API
Build custom integrations using REST endpoints and WebSocket. Any language, any framework. Full programmatic control.
API Docs → Trading API Page →Connect in 30 Seconds
Add the XBTFX MCP server to your Claude Desktop config:
{
"mcpServers": {
"xbtfx": {
"command": "npx",
"args": ["@xbtfx/mcp-server"],
"env": {
"XBTFX_API_KEY": "your_key_here"
}
}
}
} That's it. Restart Claude Desktop and your agent can trade on your account through natural language. See full setup guide →
Start AI Trading in 3 Steps
Frequently
Asked Questions
Frequently Asked Questions
-
What is AI trading?
AI trading uses artificial intelligence to execute trades, manage positions, and analyze markets on your behalf. On XBTFX, you connect any AI agent to your trading account through the XBTFX Trading API.
-
Do I need programming experience?
Not necessarily. With the MCP Server, you can connect AI assistants like Claude or Cursor without writing code. For custom strategies, basic programming knowledge helps.
-
Is AI trading free on XBTFX?
Yes. The Trading API is included with every account at no additional cost. You only pay standard trading commissions and spreads.
-
Which AI assistants work with XBTFX?
Any AI that can make HTTP requests. Officially supported: Claude Code, Claude Desktop, Cursor, Windsurf, LangChain, CrewAI. The MCP server works with any MCP-compatible client.
-
Can AI trade crypto on XBTFX?
Yes. Every instrument on your account is accessible via the API, including cryptocurrency CFDs. You can also use BTC, ETH, or USDT denominated accounts.
-
Is it safe to let AI trade my account?
API keys are stored locally by the agent. You can revoke access instantly from the Console. We recommend starting with a demo account to test your setup.
-
What markets can AI trade?
Forex, crypto, metals, indices, stocks, and energies. Over 400 instruments accessible through the same API.
-
How do I get started?
Register at my.xbtfx.com, create a trading account, generate an API key at console.xbtfx.com, then connect your AI agent using the Skills Hub, MCP Server, or direct API integration.
Start AI Trading with XBTFX
Create an account, get your API key, and connect your AI in minutes.