About Moomoo API MCP
Moomoo API MCP is an MCP server published by Litash in the Finance category: mCP Server for AI Agents to use Moomoo OpenAPI (https://www.moomoo.com/OpenAPI). Conduid read 22 tools from its source: cancel_order, check_health, get_account_summary, get_accounts, get_assets, get_cash_flow and 16 more. It is published to PyPI as moomoo-api-mcp and runs with uvx.
The repository has 42 stars and 10 forks, is licensed Apache-2.0, and its last commit was on 3 May 2026. The latest release is v0.1.8 (12 Apr 2026). It follows v0.1.7 (20 Jan 2026), and the 5 most recent releases go back to v0.1.4 (17 Jan 2026). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include finance, tradingbot and trading.
Install
claude mcp add moomoo-api-mcp -- uvx --refresh moomoo-api-mcpuvx --refresh moomoo-api-mcpuvx moomoo-api-mcppip install moomoo-api-mcpgit clone https://github.com/Litash/moomoo-api-mcpTools (22)
cancel_orderCancel an existing order.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| order_id * | string | Order ID to cancel. Get from get_orders(). |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
check_healthCheck connectivity to Moomoo and MCP server health.get_account_summaryGet complete account summary including assets and positions in one call.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID. Must be obtained from get_accounts(). |
| trd_env | string | Trading environment. 'REAL' (default, requires unlock_trade first) or 'SIMULATE' (no unlock needed, for testing). |
get_accountsGet list of trading accounts.get_assetsGet account assets including cash, market value, buying power.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID. Must be obtained from get_accounts(). |
| currency | string | Filter by currency (e.g., 'HKD', 'USD'). Leave None for default. |
| refresh_cache | boolean | Whether to refresh the cache. |
| trd_env | string | Trading environment. 'REAL' (default, requires unlock_trade first) or 'SIMULATE' (no unlock needed, for testing). |
get_cash_flowGet account cash flow history.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID. Must be obtained from get_accounts(). |
| clearing_date | string | Filter by clearing date (YYYY-MM-DD format). |
| trd_env | string | Trading environment. 'REAL' (default, requires unlock_trade first) or 'SIMULATE' (no unlock needed, for testing). |
get_dealsGet list of today's deals (executed trades).| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| code | string | Filter by stock code (e.g., 'US.AAPL'). Empty string for all. |
| refresh_cache | boolean | Whether to refresh the cache. Default False. |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
get_historical_klinesGet historical candlestick (K-line) data for a stock.| Parameter | Type | Description |
|---|---|---|
| autype | string | Adjustment type for splits/dividends: - QFQ: Forward adjustment (default) - HFQ: Backward adjustment - NONE: No adjustment |
| code * | string | Stock code (e.g., 'US.AAPL'). |
| end | string | End date in YYYY-MM-DD format. Defaults to today. |
| ktype | string | K-line type. Options: - K_1M: 1 minute - K_3M: 3 minutes - K_5M: 5 minutes - K_15M: 15 minutes - K_30M: 30 minutes - K_60M: 60 minutes - K_DAY: Daily (default) - K_WEEK: Weekly - K_MON: Monthly - K_QUARTER: Quarterly - K_YEAR: Yearly |
| max_count | integer | Maximum number of candles to return (default 100, max 1000). |
| start | string | Start date in YYYY-MM-DD format. Defaults to 365 days before end. |
get_history_dealsGet historical deals (executed trades).| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| code | string | Filter by stock code (e.g., 'US.AAPL'). Empty string for all. |
| end | string | End date in 'YYYY-MM-DD' format. Empty for today. |
| start | string | Start date in 'YYYY-MM-DD' format. Empty for max range. |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
get_history_ordersGet historical orders.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| code | string | Filter by stock code (e.g., 'US.AAPL'). Empty string for all. |
| end | string | End date in 'YYYY-MM-DD' format. Empty for today. |
| start | string | Start date in 'YYYY-MM-DD' format. Empty for max range. |
| status_filter_list | array | Filter by order statuses (see get_orders for options). |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
get_margin_ratioGet margin ratio for stocks.| Parameter | Type | Description |
|---|---|---|
| code_list * | array | List of stock codes (e.g., ['US.AAPL', 'US.TSLA']). |
get_market_snapshotGet market snapshot for multiple stocks efficiently.| Parameter | Type | Description |
|---|---|---|
| codes * | array | List of stock codes (up to 400). E.g., ['US.AAPL', 'US.TSLA', 'HK.00700']. |
get_max_tradableGet maximum tradable quantity for a stock.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID. Must be obtained from get_accounts(). |
| adjust_limit | number | Adjust limit percentage. |
| code * | string | Stock code (e.g., 'US.AAPL'). |
| order_id | string | Optional order ID for modification scenarios. |
| order_type * | string | Order type (e.g., 'NORMAL', 'LIMIT', 'MARKET'). |
| price * | number | Target price for the order. |
| trd_env | string | Trading environment. 'REAL' (default, requires unlock_trade first) or 'SIMULATE' (no unlock needed, for testing). |
get_order_bookGet order book (market depth) showing bid/ask price levels.| Parameter | Type | Description |
|---|---|---|
| code * | string | Stock code (e.g., 'HK.00700', 'US.AAPL'). |
| num | integer | Number of price levels to return (default 10). |
get_ordersGet list of today's orders.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| code | string | Filter by stock code (e.g., 'US.AAPL'). Empty string for all. |
| refresh_cache | boolean | Whether to refresh the cache. Default False. |
| status_filter_list | array | Filter by order statuses. Options: - 'UNSUBMITTED', 'WAITING_SUBMIT', 'SUBMITTING', 'SUBMIT_FAILED' - 'SUBMITTED', 'FILLED_PART', 'FILLED_ALL' - 'CANCELLING_PART', 'CANCELLING_ALL', 'CANCELLED_PART', 'CANCELLED_ALL' - 'REJECTED', 'DISABLED', 'DELETED', 'FAILED', 'NONE' |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
get_positionsGet current positions.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID. Must be obtained from get_accounts(). |
| code | string | Filter by stock code (e.g., 'US.AAPL'). |
| market | string | Filter by market (e.g., 'US', 'HK', 'CN', 'SG', 'JP'). |
| pl_ratio_max | number | Maximum profit/loss ratio filter. |
| pl_ratio_min | number | Minimum profit/loss ratio filter. |
| refresh_cache | boolean | Whether to refresh cache. |
| trd_env | string | Trading environment. 'REAL' (default, requires unlock_trade first) or 'SIMULATE' (no unlock needed, for testing). |
get_stock_quoteGet real-time stock quotes for specified codes.| Parameter | Type | Description |
|---|---|---|
| codes * | array | List of stock codes (e.g., ['US.AAPL', 'HK.00700']). |
get_user_securityGet list of securities in a specific user-defined group (watchlist).| Parameter | Type | Description |
|---|---|---|
| group_name * | string | Name of the security group (e.g., 'Favorites', 'Tech'). |
get_user_security_groupGet list of user-defined security groups (watchlists).| Parameter | Type | Description |
|---|---|---|
| group_type | integer | Type of groups to return. Options: - 0: All groups (default) - 1: Custom groups only - 2: System groups only |
modify_orderModify an existing order.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). |
| adjust_limit | number | Adjust limit percentage (0-100). Default 0. |
| modify_order_op * | string | Modification operation: - 'NORMAL': Modify price/quantity. - 'CANCEL': Cancel the order. - 'DISABLE': Disable the order. - 'ENABLE': Enable a disabled order. - 'DELETE': Delete the order. |
| order_id * | string | Order ID to modify. Get from get_orders(). |
| price | number | New price (optional, for NORMAL operation). |
| qty | integer | New quantity (optional, for NORMAL operation). |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
place_orderPlace a new trading order.| Parameter | Type | Description |
|---|---|---|
| acc_id | string | Account ID from get_accounts(). Required if multiple accounts exist. |
| adjust_limit | number | Adjust limit percentage (0-100). Default 0. |
| aux_price | number | Trigger price for stop/if-touched order types (required for STOP, STOP_LIMIT, MARKET_IF_TOUCHED, LIMIT_IF_TOUCHED). |
| code * | string | Stock code (e.g., 'US.AAPL', 'HK.00700'). |
| order_type | string | Order type. Supported values: - 'NORMAL': Enhanced limit order (HK), limit order (US/A-share). - 'MARKET': Market order. - 'ABSOLUTE_LIMIT': Limit order (HK only, exact price match required). - 'AUCTION': Auction order (HK). - 'AUCTION_LIMIT': Auction limit order (HK). - 'SPECIAL_LIMIT': Special limit / Market IOC (HK, partial fill then cancel). - 'SPECIAL_LIMIT_ALL': Special limit all-or-none (HK, fill all or cancel). - 'STOP': Stop market order. - 'STOP_LIMIT': Stop limit order. - 'MARKET_IF_TOUCHED': Market if touched (take profit). - 'LIMIT_IF_TOUCHED': Limit if touched (take profit). - 'TRAILING_STOP': Trailing stop market order. - 'TRAILING_STOP_LIMIT': Trailing stop limit order. |
| price * | number | Order price. For market orders, this is used as price limit. |
| qty * | integer | Order quantity (number of shares). |
| remark | string | Optional order note/remark. |
| time_in_force | string | Time in force for the order. Default 'DAY'. - 'DAY': Order valid for current trading day only. - 'GTC': Good-Til-Cancelled, order remains active until filled or cancelled. |
| trail_spread | number | Optional trailing spread for trailing stop limit types. |
| trail_type | string | Trailing type for trailing stop orders (required for TRAILING_STOP, TRAILING_STOP_LIMIT). Values: 'RATIO' or 'AMOUNT'. |
| trail_value | number | Trailing value (ratio or amount) for trailing stop types. |
| trd_env | string | Trading environment - 'REAL' or 'SIMULATE'. Default REAL. |
| trd_side * | string | Trade side - 'BUY' or 'SELL'. |
unlock_tradeUnlock trade to access REAL account data.| Parameter | Type | Description |
|---|---|---|
| password | string | Plain text trade password (the password you set in Moomoo app). If not provided, will look for MOOMOO_TRADE_PASSWORD env var. |
| password_md5 | string | MD5 hash of trade password (alternative to password). If not provided, will look for MOOMOO_TRADE_PASSWORD_MD5 env var. Provide either password or password_md5, not both. |
Security checks
Static checks derived from the repository 11 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 1.1K words.
- ✓License declaredThe repository declares the Apache-2.0 license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- ✓No dynamic code executionScanned 12 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdiosrc/moomoo_mcp/server.py:120
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- No file writes or deletes
- Lockfile
- uv.lock
Pattern matches on the source text of 12 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 1.1K words, fetched a month ago. The original in the repository is authoritative.
Read full README