Configuration
Environment Variables
Section titled “Environment Variables”| Variable | Required | Description |
|---|---|---|
XBTFX_API_KEY | Yes | Your API key from console.xbtfx.com |
The API key binds to a single MT5 login. The MCP server uses the same authentication as the REST API.
Installation Methods
Section titled “Installation Methods”npx (recommended)
Section titled “npx (recommended)”No install needed — runs the latest version directly:
npx @xbtfx/mcp-tradingGlobal install
Section titled “Global install”npm install -g @xbtfx/mcp-tradingxbtfx-mcpFrom source
Section titled “From source”git clone https://github.com/XBTFX/xbtfx-mcp-server.gitcd xbtfx-mcp-servernpm install && npm run buildXBTFX_API_KEY=your_key node dist/index.jsClient Configuration
Section titled “Client Configuration”Each AI client has its own way of registering MCP servers:
Claude Code
Section titled “Claude Code”claude mcp add xbtfx-trading -e XBTFX_API_KEY=xbtfx_live_your_key_here -- npx @xbtfx/mcp-tradingClaude Desktop
Section titled “Claude Desktop”Add to claude_desktop_config.json:
{ "mcpServers": { "xbtfx-trading": { "command": "npx", "args": ["@xbtfx/mcp-trading"], "env": { "XBTFX_API_KEY": "xbtfx_live_your_key_here" } } }}Cursor
Section titled “Cursor”Add to .cursor/mcp.json:
{ "mcpServers": { "xbtfx-trading": { "command": "npx", "args": ["@xbtfx/mcp-trading"], "env": { "XBTFX_API_KEY": "xbtfx_live_your_key_here" } } }}OpenAI Codex
Section titled “OpenAI Codex”codex mcp add xbtfx-trading -- npx @xbtfx/mcp-tradingSet the API key in your environment before running:
export XBTFX_API_KEY="xbtfx_live_your_key_here"API Endpoint
Section titled “API Endpoint”The MCP server connects to:
https://interface.xbtfx.comThis is hardcoded and cannot be changed. All requests go through Cloudflare and use the same rate limits as direct REST API access (600 weight per minute per API key).
Requirements
Section titled “Requirements”- Node.js 18 or later
- A valid XBTFX API key with
trade,readpermissions