AI Agent Integration
Two integration options are available. Use either one, or configure both.
| Option 1: Install skills | Option 2: Configure MCP | |
|---|---|---|
| Setup | Run one command | Edit the agent configuration file |
| Invocation path | The agent runs mexc commands in the terminal | The agent calls directly, without going through the terminal |
| Prerequisites | The agent can execute terminal commands | The agent supports MCP |
Option 1: Install Skills
mexc skills install # Install for Claude Code by default
mexc skills install --agent cursor # Install for a specific agent
mexc skills install --all-agents # Install for all detected agents
mexc skills update # Re-run after upgrading the CLI
This installs 25 capability reference documents. After installation, you can ask questions directly, such as "What is the current BTC contract funding rate?" or "What is my spot USDT balance?"
Each document includes a full capability table: command syntax, read/write behavior, whether a key is required, whether repeated execution is safe, and a description. It also includes practical workflows, such as how to confirm an order fill after placing a trade. For questions like "What can spot trading do?" or "Which command shows my positions?", the agent answers from local documents that you can verify.
The documents ship with the binary and match the installed version. After upgrading the CLI, run mexc skills update to sync them. If versions do not match, mexc doctor reports a warning.
Capability Coverage
Use the table below to confirm category coverage. For individual capabilities, query through the agent or mexc explore.
| Category | Module | Count | Description |
|---|---|---|---|
| Spot | marketv2 | 25 | Market data, including public real-time streams; 21 do not require a key |
| Spot | kline | 2 | Klines; do not require a key |
| Spot | market-search | 1 | Market search |
| Spot | trade | 12 | Place, modify, cancel, and query orders; includes take-profit/stop-loss, trigger, trailing, and OCO orders |
| Spot | asset | 32 | Overview, balances, deposit/withdrawal and transfer history, inter-account transfers, bills, PnL |
| Spot | convert | 8 | Flash convert |
| Spot | dca | 21 | DCA / auto-invest |
| Spot | fee | 9 | Fee rate center |
| Spot | grid | 16 | Grid trading |
| Spot | account | 1 | Real-time stream of this account's trades |
| Contract | market | 37 | Public market data; do not require a key |
| Contract | trade | 54 | Orders, plan orders, stop-loss, trailing, leverage, margin, positions |
| Contract | account | 26 | Assets, fund records, multi-asset mode, fees, risk, preferences |
| Financial | flexible | 18 | Flexible products and auto-pledge |
| Financial | fixed | 12 | Fixed-term products and orders |
| Financial | contract-hold | 10 | Contract-hold yield |
| Financial | common | 11 | Common product, asset, position, and order queries |
| Activity | reward | 4 | Reward center |
| Activity | online | 3 | Activity discovery |
| Activity | participate | 1 | Activity registration |
| Futures market | market | 3 | Public real-time streams; do not require a key |
| Futures market | account | 1 | Real-time stream of this account's trades |
If skills are not installed, you can still discover capabilities yourself: mexc explore browses everything, mexc contract market --help lists all capabilities in a module, and mexc schema outputs all capability IDs for scripting.
Option 2: Configure MCP
Configure by category, one entry per category:
{
"mcpServers": {
"mexc-spot": { "command": "mexc", "args": ["mcp", "spot", "--read-only"] }
}
}
Most agents provide a configuration command, so you do not need to edit the file manually. Common agent setup examples:
claude mcp add-json -s user mexc-spot '{"type":"stdio","command":"mexc","args":["mcp","spot","--read-only"]}'
codex mcp add mexc-spot -- mexc mcp spot --read-only
gemini mcp add -s user -t stdio mexc-spot mexc mcp spot --read-only
kiro-cli mcp add --name mexc-spot --command "mexc mcp spot --read-only" --scope global
code --add-mcp '{"name":"mexc-spot","type":"stdio","command":"mexc","args":["mcp","spot","--read-only"]}'
cursor --add-mcp '{"name":"mexc-spot","type":"stdio","command":"mexc","args":["mcp","spot","--read-only"]}'
Configure only what you need. Exposing all 307 capabilities to an agent lowers the chance it selects the right one and increases context usage.
args configuration | Coverage | Tool count |
|---|---|---|
["mcp", "spot", "--read-only"] | All spot | 123 |
["mcp", "contract", "--read-only"] | All contract | 117 |
["mcp", "financial-openapi", "--read-only"] | Financial | 51 |
["mcp", "activity", "--read-only"] | Activities and rewards | 8 |
["mcp", "spot", "marketv2", "--read-only"] | Spot market only | 22 |
For market and account queries only, the first entry is enough. File upload/download and real-time streams cannot be transported over MCP, so the tool count is lower than the capability count. All futures capabilities are real-time streams, so configuring MCP for them exposes no tools; use the terminal instead.
MCP Server Fails to Start
Replace mexc in the configuration with the full path to the binary. On Windows, a full path is required. On macOS and Linux, agents launched from a terminal usually do not need this; agents launched from the Dock or Launchpad may, especially Claude Desktop.
npm root -g # Append /@mexc-ai/cli-<platform>/bin/mexc to the output directory
<platform> values include win32-x64, darwin-arm64, linux-x64, and others. On Windows, the filename includes .exe, and backslashes must be escaped in JSON:
"command": "C:\\Users\\YourUsername\\AppData\\Roaming\\npm\\node_modules\\@mexc-ai\\cli-win32-x64\\bin\\mexc.exe"