rgo-trading-api
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., "@rgo-trading-apilist my pending orders"
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.
RGO Trading API — Python client, CLI & MCP server
A Python toolkit for the RGO Client API and Dealer API (a trading order/position system). It ships three layers so you can use it however you like:
Layer | Entry point | Use it for |
Library |
| Import in your own Python code |
CLI |
| Explicit commands ( |
MCP server |
| Ask an AI assistant in plain English (Claude CLI, etc.) |
⚠️ This places REAL trades. Order placement/update/deletion is gated behind a config flag (
RGO_ALLOW_TRADING) and is off by default. Reads are always safe. See Safety.
Features
Dealer reads: executed deals, pending orders, all positions.
Order writes on both the Client and Dealer APIs: place, update, delete (opt-in).
Realtime deals via WebSocket (
DealerApi.ws_stream).Natural-language access through the Model Context Protocol (MCP): ask "show my open positions" and let your AI client call the right tool.
Typed, validated requests (Pydantic v2), a single shared HTTP layer, and a test suite that mocks all network calls (no real trades in CI).
See docs/API.md for the full endpoint reference and
docs/MCP.md for AI-assistant setup.
Related MCP server: alpaca-mcp-server
Requirements
Python 3.10+
An RGO account with API access (credentials + your broker's endpoints)
Install
git clone https://github.com/bhdhiman/rgo-trading-api.git
cd rgo-trading-api
python -m venv .venv
# Windows:
.venv\Scripts\python -m pip install -r requirements.txt
# macOS/Linux:
# .venv/bin/python -m pip install -r requirements.txtConfigure
cp .env.example .env # then edit .env with your real values.env is gitignored — your credentials never get committed.
Variable | Meaning |
| Your license id |
| Dealer login (for the read JWT) |
| Header credentials for order writes |
| Client API base URL, e.g. |
| Dealer read base URL (e.g. port 9016) |
| Dealer write base URL (may use a different port, e.g. 6016) |
| Realtime WebSocket URL |
|
|
Usage — CLI
# Reads (safe)
python cli.py positions
python cli.py deals
python cli.py orders
# Writes (need RGO_ALLOW_TRADING=true AND --yes)
python cli.py place --api dealer --user <ACCOUNT> --type BuyLimit \
--side BID --price 1 --volume 1 --current 94000 --symbol GOLDOCT --yes
python cli.py delete --api dealer --position <POSITION_ID> --yesUsage — library
from rgo_api import DealerApi, load_settings
with DealerApi(load_settings()) as api:
positions = api.get_positions()
deals = api.get_deals()
pending = api.get_pending_orders()Usage — AI assistant (MCP)
Register the server with your MCP-capable client (e.g. the Claude CLI), then ask in plain English:
"show my open positions"
"list today's deals"
"what orders are pending?"
Full setup (registration + generic MCP client) is in docs/MCP.md.
Safety
This software can place real financial orders. Guardrails:
Credentials live only in
.env(gitignored). Nothing is hardcoded.Trading is opt-in. Place/update/delete refuse to run unless
RGO_ALLOW_TRADING=true; the CLI additionally requires--yes.Inputs are validated (side, order type, positive price/volume) before any request is sent.
You are responsible for any orders you place. No warranty — see
LICENSE.
Tests
python -m pytest --cov=rgo_apiAll HTTP is mocked with respx; tests never contact a live server or place
trades.
Project structure
rgo_api/ # client library
config.py # settings from .env
models.py # request models + response-envelope parsing
_http.py # shared httpx transport
dealer_api.py # dealer reads + writes + websocket
client_api.py # client order writes
cli.py # Typer command-line interface
mcp_server.py # FastMCP server (AI-assistant tools)
docs/ # API + MCP documentation
tests/ # pytest suite (network mocked)License
This server cannot be deployed
Maintenance
Related MCP Connectors
Trade 16 crypto exchanges + MetaTrader 5 from your AI assistant via one MCP connection.
Connect your AI to a funded trading account. Read & trade a simulated funded challenge.
Provide AI assistants with real-time access to official SEC EDGAR filings and financial data. Enab…
Trade across 22+ exchanges and brokers from any MCP-capable AI agent, no install required.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI models with secure access to Interactive Brokers trading data and functionality, enabling account management, market data retrieval, and trading operations through natural language interactions.18MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading operations for stocks, options, crypto, and portfolio management via Alpaca's Trading API through AI assistants.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to trade on MetaTrader 5 using natural language, supporting account management, order placement, and real-time market data.1MIT

NexusTrader MCPofficial
FlicenseNot gradedqualityCmaintenanceExposes NexusTrader's account, positions, market data, and trading capabilities to AI assistants via natural language.1-