MCP Server for AI Agents to use Moomoo OpenAPI (https://www.moomoo.com/OpenAPI)
SaferSkills independently audited moomoo-api-mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP (Model Context Protocol) server for the Moomoo trading platform. This server allows AI agents (like Claude Desktop or Gemini) to access market data, account information, and execute trades via the moomoo-api Python SDK.
Take your trading to the next level with AI!
This MCP server empowers developers to build custom trading skills and strategies. By integrating this tool, you can enable any compatible AI agent to interact directly with the Moomoo platform on your behalf. Whether you want an AI assistant that monitors the market, analyzes your portfolio, or automatically executes complex trading strategies, this server provides the seamless bridge between your custom AI logic and Moomoo's powerful trading infrastructure.
check_health: Check connectivity to Moomoo OpenD gateway and server health.get_accounts: List all trading accounts (REAL and SIMULATE).get_account_summary: Get a complete summary of assets and positions for an account.get_assets: Retrieve account assets (cash, market value, buying power).get_positions: Get current stock positions with P/L data.get_max_tradable: Calculate maximum tradable quantity for a specific stock.get_margin_ratio: Check margin ratios for specific stocks.get_cash_flow: Retrieve historical cash flow records.unlock_trade: Unlock trading access for REAL accounts.get_stock_quote: Get real-time stock quotes.get_historical_klines: Retrieve historical candlestick data (Day, Week, Min, etc.).get_market_snapshot: Get efficient market snapshots for multiple stocks.get_order_book: View real-time bid/ask order book depth.place_order: Place a new order (Market, Limit, Stop, etc.).modify_order: Modify price or quantity of an open order.cancel_order: Cancel an open order.get_orders: Get list of orders for the current day.get_deals: Get list of executed trades (deals) for the current day.get_history_orders: Search historical orders.get_history_deals: Search historical deals.You can run the server directly using uvx (part of the uv toolkit). Using --refresh ensures you are always running the latest version:
# Optional: Set these environment variables for REAL trading access.
# If omitted, the server will safely run in SIMULATE-only (paper trading) mode.
export MOOMOO_TRADE_PASSWORD="your_trading_password"
export MOOMOO_SECURITY_FIRM="FUTUSG" # e.g. FUTUSG, FUTUINC, etc.
uvx --refresh moomoo-api-mcpTo install it as a persistent tool available in your shell:
uv tool install moomoo-api-mcp
# Optional: Set these environment variables for REAL trading access.
# If omitted, the server will safely run in SIMULATE-only (paper trading) mode.
export MOOMOO_TRADE_PASSWORD="your_trading_password"
export MOOMOO_SECURITY_FIRM="FUTUSG" # e.g. FUTUSG, FUTUINC, etc.
# Then run:
moomoo-api-mcpNote: The moomoo-api Python SDK and other dependencies will be installed automatically. git clone https://github.com/Litash/moomoo-api-mcp.git
cd moomoo-api-mcp uv sync uv run moomoo-api-mcp#### Moomoo OpenD (Required)
The MCP server communicates with the Moomoo API via Moomoo OpenD, a local gateway application. You MUST install and run this first.
11111 (this is the default).127.0.0.1:11111 by default.To enable REAL account access, you must securely provide your credentials.
| Variable | Description | Example |
|---|---|---|
MOOMOO_TRADE_PASSWORD | Your trading password (plain text) | 123456 |
MOOMOO_SECURITY_FIRM | Your broker region (e.g., FUTUSG, FUTUINC) | FUTUSG |
Note: Without these, the server runs in SIMULATE-only mode (paper trading).
Add the server to your claude_desktop_config.json:
#### Option A: Using PyPI Package (Recommended)
{
"mcpServers": {
"moomoo": {
"command": "uvx",
"args": ["--refresh", "moomoo-api-mcp"],
"env": {
"MOOMOO_TRADE_PASSWORD": "your_trading_password",
"MOOMOO_SECURITY_FIRM": "FUTUSG"
}
}
}
}Note: The --refresh flag ensures you always have the latest version but may increase startup time due to version checking. You can remove it once you have the correct version installed.#### Option B: Local Development
{
"mcpServers": {
"moomoo": {
"command": "uv",
"args": [
"--directory",
"C:\\path\\to\\moomoo-api-mcp",
"run",
"moomoo-api-mcp"
],
"env": {
"MOOMOO_TRADE_PASSWORD": "your_trading_password",
"MOOMOO_SECURITY_FIRM": "FUTUSG"
}
}
}
}Security: Never commit your password to version control. The env block in the config file remains local.IMPORTANT: All account tools default to REAL trading accounts.
When using this MCP server, AI agents MUST:
"I'm about to access your REAL trading account. This will show your actual portfolio and balances."
unlock_trade (it handles env vars automatically, or pass password if needed).trd_env='REAL').trd_env='SIMULATE' parameter explicitly.User: "Show me my portfolio"
Agent Response:
"I'm accessing your REAL trading account to show your portfolio.
If you prefer to use a simulation account instead, please let me know."
[Proceeds to unlock_trade → get_account_summary]When using get_orders or get_history_orders, the status_filter_list parameter accepts an array of string values:
["SUBMITTED", "FILLED_ALL", "CANCELLED_ALL"]Valid status strings:
UNSUBMITTED, WAITING_SUBMIT, SUBMITTING, SUBMIT_FAILEDSUBMITTED, FILLED_PART, FILLED_ALLCANCELLING_PART, CANCELLING_ALL, CANCELLED_PART, CANCELLED_ALLREJECTED, DISABLED, DELETED, FAILED, NONENote: The server automatically converts these strings to the required SDK enum format. If no orders match the filter, an empty list is returned.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Unofficial Project: This software is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Moomoo Inc., Futu Holdings Ltd., or their affiliates.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.