ATAS MCP Bridge
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ATAS MCP Bridge Show me the current order book depth and recent trades for NQ."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ATAS MCP Bridge
Model Context Protocol (MCP) server connecting ATAS Platform (7.x) and ATAS X (8.x) to AI agents and development assistants.
Overview
ATAS MCP Bridge bridges the gap between institutional-grade order flow trading in ATAS and modern AI models. It exposes real-time market data, full order book depth (DOM), delta volume candles, account positions, open orders, trade executions, and automated order routing directly to AI assistants.
Compatible with all major AI coding agents and MCP clients:
OpenCode
Qwen Code
Kiro (CLI & IDE)
Claude Code
OpenAI Codex / Developers Platform
OpenClaw
Kimi Kode
Z Code
Google Antigravity (AGY CLI & IDE)
Cursor
Claude Desktop
Windsurf / VS Code (Cline & Roo Code)
Related MCP server: MetaTrader 5 MCP Server
Architecture
+------------------------------------+ HTTP / SSE (127.0.0.1:8787) +----------------------+
| ATAS Platform | <------------------------------------------> | MCP Server (Py) |
| "MCP Bridge" | GET /api/* | server.py |
| (ChartStrategy in C# / .NET) | POST /api/order | (mcp 2.0) |
+------------------------------------+ GET /api/stream +----------------------+
^
| MCP (stdio)
v
+----------------------+
| AI Clients |
| - OpenCode |
| - Qwen Code |
| - Kiro |
| - Claude Code |
| - OpenAI Codex |
| - OpenClaw |
| - Kimi Kode |
| - Z Code |
| - Antigravity |
| - Cursor |
| - Claude Desktop |
+----------------------+Communication Flow:
C# Addon (
ATAS.McpBridge): Runs inside the ATAS process as a nativeChartStrategy. It hosts an embedded HTTP and Server-Sent Events (SSE) listener on127.0.0.1:8787.Thread Safety & Lock-Free Design: All ATAS API calls occur strictly on the main ATAS thread within
OnCalculate(). Incoming HTTP execution requests are queued in a thread-safeConcurrentQueueand processed on the next tick. Read requests are answered immediately from volatile in-memory JSON snapshots without interrupting market data processing.Python MCP Server (
server.py): Speaks Model Context Protocol over standard I/O (stdio), exposing 12 production-ready tools with robust structured error handling.Python HTTP Client (
atas_client.py): Zero-dependency client using Python standard library with automated port discovery and environment variable support.
MCP Tools (12 Tools)
Tool | Description | Parameters |
| Returns bridge connectivity status, symbol, portfolio account, tick size, activation state, and active port. | None |
| Live quote snapshot: last price, best bid and ask with volumes, DOM cumulative volume (order flow imbalance), spread, and tick size. | None |
| Full order book depth (DOM): sorted bids (highest first) and asks (lowest first) with exact price and size. |
|
| Historical bars (up to 2000 candles) for the chart: open, high, low, close, volume, delta, timestamp, and the current forming candle. | None |
| Current open position details: net volume, average entry price, direction (Buy/Sell), open PnL, and closed PnL. | None |
| Working orders: ID, direction, order type, price, trigger price, executed volume, remaining volume, and order state. | None |
| Execution log (fills) completed during the active session. | None |
| Consolidates status, quote, DOM, candles, orders, position, and trades in a single call. | None |
| Places an order through ATAS. Prices are automatically rounded and snapped to instrument tick size. |
|
| Cancels an open working order by its unique ID. |
|
| Closes (flattens) the current position using an opposing market order for the full or partial volume. |
|
| Retrieves recent diagnostic logs from the C# bridge inside ATAS for debugging. | None |
HTTP REST and SSE Endpoints
The C# addon serves the following endpoints locally at http://127.0.0.1:8787:
Endpoint | Method | Description |
| GET | Health check ( |
| GET | Metadata: platform version, instrument, security code, portfolio, and tick size. |
| GET | Live ticker, best bid/ask, and cumulative order book imbalance. |
| GET | Full depth of market book snapshot. |
| GET | Array of completed candles plus current active bar. |
| GET | List of working orders. |
| GET | Calculated net position and session PnL. |
| GET | Session trade executions (fills). |
| GET | All-in-one consolidated payload. |
| GET | Diagnostic log buffer. |
| POST | Submits a new order ( |
| POST | Cancels an existing order ( |
| POST | Flattens the open position ( |
| GET (SSE) | Real-time Server-Sent Events: |
Prerequisites
Operating System: Windows 10 / 11 (x64)
Platform: ATAS Platform (7.x) or ATAS X (8.x) installed
.NET SDK: .NET 8 SDK or higher (
winget install Microsoft.DotNet.SDK.8ordotnet --version)Python: Python 3.10 or higher with pip
Installation and Quickstart
1. Clone the repository and install dependencies
git clone https://github.com/Ax3lsk3r3/atas-mcp.git
cd atas-mcp
pip install -r requirements.txtOptionally install as an editable package so the atas-mcp CLI command is globally available:
pip install -e .2. Compile and deploy the C# Addon
Run the build script:
build.batThe script compiles the project in Release mode and copies ATAS.McpBridge.dll to both ATAS strategy folders:
%APPDATA%\ATAS\Strategies\(ATAS Platform 7.x)%APPDATA%\ATAS X\Strategies\(ATAS X 8.x)
3. Attach the Strategy in ATAS
Launch ATAS (or ATAS X).
Open a chart for the instrument you want to trade (e.g. NQ, ES, BTCUSDT, EURUSD).
Right-click the chart -> select Indicators (or Add Indicator).
Search for MCP Bridge and add it to the chart.
In the strategy properties panel:
Check the
IsActivatedcheckbox.Select your portfolio / account (simulation or demo accounts recommended).
Verify in your web browser:
Navigate to
http://127.0.0.1:8787/api/healthExpected output:
{"ok":true,"id":"atas-mcp-bridge","version":"1.0.0"}
4. Run the Automated Smoke Test
Verify the Python client against a local mock bridge without launching ATAS:
python test_client.pyAll 13 automated tests should pass.
5. Start the MCP Server
The server supports two primary modes:
Mode A: Stdio (for local desktop IDEs and CLIs):
start_mcp.bat
# or directly:
python server.py
# or if installed via pip:
atas-mcpMode B: Server-Sent Events (SSE) (for web applications, remote environments, cloud agents):
start_mcp_sse.bat
# or directly:
python server.py --transport sse --host 127.0.0.1 --port 8000
# or with Docker:
docker compose up -dThe SSE endpoint will be available at http://127.0.0.1:8000/sse for web chat UIs (LibreChat, Open WebUI, AnythingLLM) and remote agent runners (OpenClaw, LangChain, CrewAI, AutoGen).
Client Integration Examples
Detailed setup guides for all supported clients are provided in mcp-config-examples.md.
OpenCode
Add to ~/.config/opencode/config.json or project opencode.json:
{
"mcp": {
"atas": {
"type": "stdio",
"command": "python",
"args": ["<PATH_TO_ATAS_MCP>/server.py"]
}
}
}Qwen Code
Run via CLI:
qwen mcp add atas python "<PATH_TO_ATAS_MCP>/server.py"Kiro (CLI & IDE)
Run via CLI:
kiro mcp add atas python "<PATH_TO_ATAS_MCP>/server.py"Claude Code (CLI)
Run via CLI:
claude mcp add atas -- python "<PATH_TO_ATAS_MCP>/server.py"Google Antigravity (AGY)
Add to %USERPROFILE%\.gemini\config\mcp_config.json:
{
"mcpServers": {
"atas": {
"command": "python",
"args": ["<PATH_TO_ATAS_MCP>/server.py"]
}
}
}Cursor
Add to %USERPROFILE%\.cursor\mcp.json:
{
"mcpServers": {
"atas": {
"command": "python",
"args": ["<PATH_TO_ATAS_MCP>/server.py"]
}
}
}Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"atas": {
"command": "python",
"args": ["<PATH_TO_ATAS_MCP>\\server.py"],
"cwd": "<PATH_TO_ATAS_MCP>"
}
}
}Technical Details
ATAS 7.x and 8.x Compatibility:
Targets .NET 8, which runs natively on ATAS 7.x and forwards cleanly into ATAS X .NET 10 cross-platform runtime.
Uses
IndicatorCandlefor full access to volume and delta statistics.Price rounding respects
ShrinkPrice(price)to prevent exchange reject errors.Full order book depth snapshot extracted via
MarketDepthInfo.GetMarketDepthSnapshot().
Position Tracking:
In
ChartStrategy, the net open volume and direction are computed from strategy-specific execution fills (MyTrades).This ensures safe isolation: manual orders outside this strategy do not corrupt the algorithmic tracking of the strategy.
Dynamic Port Discovery:
If port 8787 is occupied, the C# bridge scans ports 8787 through 8807 automatically.
The selected port is stored in
%APPDATA%\ATAS\McpBridge.portand%APPDATA%\ATAS X\McpBridge.port.atas_client.pyauto-discovers this file or falls back to theATAS_MCP_PORTenvironment variable.
Troubleshooting
Issue | Likely Cause | Solution |
| .NET 8 SDK is missing or PATH is not refreshed. | Run |
| Strategy is not added to a chart or | Open ATAS, add |
Network Access Denied on port bind | Windows HTTP.sys reservation missing. | Run in an Administrator Command Prompt: |
AI Client cannot find | Incorrect path in client MCP configuration file. | Verify that the path in your client JSON points to the absolute path of |
Orders are rejected | Portfolio is not connected or demo connection inactive. | Verify in ATAS that your connector/broker status is green and select a valid portfolio in the strategy settings. |
Risk Disclaimer
This software connects directly to financial trading platforms and can place binding orders on financial markets. Trading futures, equities, forex, and cryptocurrencies involves substantial risk of loss and is not suitable for every investor.
Always test strategies, prompts, and tool calls thoroughly on simulated accounts (DEMO or Market Replay) before deploying capital.
This software is distributed strictly for educational and technical automation purposes, without warranty of any kind.
License
MIT License. See LICENSE for details.
Available Tools
12 toolsatas_bridge_logA
Recent diagnostic logs from the ATAS bridge running inside ATAS. Useful when troubleshooting strategy activation, tick processing, or order issues.
Inputs: no named parameters. Returns: object
atas_cancel_orderA
Cancel a working order by its ID (see atas_orders for working order IDs).
Inputs: order_id (required). Returns: object
atas_candlesA
Recent candle history for the chart the strategy is attached to (up to 2000 bars): open, high, low, close, volume, delta, and time, plus the current forming candle. Essential for context and technical analysis.
Inputs: no named parameters. Returns: object
atas_close_positionA
Flatten the current position using a market order. If volume and direction are omitted, the strategy automatically calculates the opposite direction and entire volume to close the position completely.
Inputs: volume, direction. Returns: object
atas_domA
Current market depth (DOM / order book): asks (lowest price first) and bids (highest price first), each level with price and volume. The 'levels' argument limits how many levels are returned per side.
Inputs: levels. Returns: object
atas_ordersB
All working (active) orders with ID, direction, type, price, trigger price, filled quantity, unfilled quantity, and state.
Inputs: no named parameters. Returns: object
atas_place_orderA
Place an order through ATAS. Parameters: direction ('buy' or 'sell'); order_type ('limit', 'stop', 'market', or 'stoplimit'); qty (number of contracts/lots); price (required for limit and stoplimit); trigger_price (required for stop and stoplimit); comment (optional order label). Prices are automatically snapped to instrument tick size.
Inputs: qty (required), direction (required), order_type (required), price, +2 more. Returns: object
atas_positionA
Current open position details (volume, average price, direction, realized and unrealized PnL) derived from strategy fills.
Inputs: no named parameters. Returns: object
atas_quoteA
Live quote snapshot: last traded price, best bid/ask with sizes, cumulative DOM bid/ask volume (order flow imbalance), spread, and tick size.
Inputs: no named parameters. Returns: object
atas_snapshotA
Everything at once: status, quote, DOM, candles, orders, position, and trades in a single call. Useful for full context on each turn.
Inputs: no named parameters. Returns: object
atas_statusA
Connection status of the ATAS bridge: symbol, portfolio, tick size, whether the strategy is activated, bridge port, and current state. Call this first to verify the bridge is reachable.
Inputs: no named parameters. Returns: object
atas_tradesB
Recent executed trades (fills) of the current session.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool addresses a single, well-defined aspect: market data (quote, DOM, candles), account state (position, orders, trades), actions (place, cancel, close), and diagnostics (log, status). The aggregate snapshot overlaps by design but is explicitly presented as a convenience for full context. No two tools appear to perform the same function.
All tools share the 'atas_' prefix and use a consistent convention: noun-style names for data retrieval (quote, dom, position) and imperative verb_noun names for mutations (place_order, cancel_order, close_position). This read/write distinction makes the toolset predictable and easy to navigate. Minor variation like 'bridge_log' as a compound noun does not create confusion.
Twelve tools is well within the ideal range for a trading bridge application. Each tool serves a distinct purpose and the set feels neither bloated nor sparse. The inclusion of an aggregate snapshot is justified as a convenience for agents needing full state in one call.
The toolset covers the essential lifecycle: read market data, inspect position/orders/trades, place and cancel orders, and close positions. It lacks a dedicated order modification operation, but agents can cancel and re-place orders as a workaround. Basic connection diagnostics and status are also included, making the surface practical for automated trading.
Maintenance
Related MCP Connectors
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
Unified financial infrastructure connecting AI agents directly to trade live/demo brokerage accounts, Web3 non-custodial wallets, real-time market data across equities, ETFs, crypto, forex, options, DeFi swaps, and prediction markets, institutional research feeds, and algorithmic strategy backtesters.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the MetaTrader 5 trading platform for market data analysis, placing trades, and managing trading positions. Provides comprehensive access to forex and financial market operations through the Model Context Protocol.1-
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to connect to MetaTrader 5 for trading, market data access, and account management through the Model Context Protocol.118 PyPI243MIT
- AlicenseNot gradedqualityAmaintenanceExposes a unified AI interface to MetaTrader 5 over the Model Context Protocol, enabling live quotes, historical data, technical indicators, order execution, position management, and headless backtests.109 PyPIMIT
- AlicenseAqualityCmaintenanceEnables AI agents to perform market analysis through typed access to deterministic market data, technical indicators, backtesting, and position sizing via the Model Context Protocol.52MIT