ctrader
MCP server from akinabudu/ctrader-mcp-server
claude mcp add --transport stdio akinabudu-ctrader-mcp-server python server.py \ --env HOST="demo" \ --env CLIENT_ID="your_client_id_here" \ --env ACCOUNT_ID="your_account_id_here" \ --env ACCESS_TOKEN="your_access_token_here" \ --env CLIENT_SECRET="your_client_secret_here"
How to use
This MCP server exposes a Python-based API that lets AI assistants interact with the cTrader trading platform. It supports trading operations (market, limit, and stop orders), position and order management, market data access (OHLCV, indicators, real-time ticks), and account information retrieval. Tools like get_account_status, create_market_order, get_historical_data, and subscribe_to_ticks enable dynamic conversations such as checking balances, placing trades, fetching indicators, or subscribing to live price feeds. To use it, configure your MCP client (e.g., Claude Desktop or another MCP client) to point at the ctrader server, and ensure your environment variables provide valid cTrader credentials. Once connected, you can issue natural-language prompts that map to the available tools (for example, “Show my balance” or “Buy 0.01 lots of EURUSD with stop at 1.08”).
How to install
Prerequisites:
- Python 3.10 or higher
- A cTrader account (demo or live) with API credentials
- Network access to the cTrader API
- Clone the repository:
git clone https://github.com/akinabudu-ctrader-mcp-server/ctrader-mcp-server.git
cd ctrader-mcp-server
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Configure credentials: create a .env file in the project root and populate it with your cTrader credentials (these values can also be exported as environment variables if you prefer).
CLIENT_ID=your_client_id_here
CLIENT_SECRET=your_client_secret_here
ACCESS_TOKEN=your_access_token_here
ACCOUNT_ID=your_account_id_here
HOST=demo # use 'live' for live trading
- Run the server:
python server.py
- Optional: run tests to verify setup:
python test_server.py
Additional notes
Tips and common issues:
- Ensure HOST is set to demo for testing; switch to live only after thorough testing.
- Keep credentials in a .env file or environment variables; do not commit them to version control.
- If you encounter authentication errors, re-check CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN, and ACCOUNT_ID against your cTrader developer console.
- The server respects cTrader rate limits (trading operations: ~50 req/sec, historical data: ~5 req/sec). Implement client-side pacing if issuing bursts of requests.
- For Claude/Desktop users, ensure the path to the Python interpreter and server.py is correctly specified in the MCP config, and that the working directory (cwd) is set to the project root if your client requires it.
- If symbols or indicators fail to load, verify API connectivity and that your account has permissions for the requested instruments and data.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP