edgex-mcp
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., "@edgex-mcp show me my open positions"
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.
edgex-mcp
MCP (Model Context Protocol) server for EdgeX perpetual contract trading.
Provides 16 AI agent tools for market data, account management, and order execution. Works with Cursor, Claude Code, OpenClaw, and any MCP-compatible AI client. Use testnet by setting EDGEX_TESTNET=1 in the MCP env (like the CLI --testnet flag).
Setup
Add to your MCP configuration:
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"edgex": {
"command": "npx",
"args": ["-y", "@realnaka/edgex-mcp"],
"env": {
"EDGEX_ACCOUNT_ID": "your-account-id",
"EDGEX_STARK_PRIVATE_KEY": "0x..."
}
}
}
}Claude Code (~/.claude/settings.json):
{
"mcpServers": {
"edgex": {
"command": "npx",
"args": ["-y", "@realnaka/edgex-mcp"],
"env": {
"EDGEX_ACCOUNT_ID": "your-account-id",
"EDGEX_STARK_PRIVATE_KEY": "0x..."
}
}
}
}OpenClaw (~/.openclaw/openclaw.json):
Prerequisite: OpenClaw does not natively support MCP. Install MCP Porter first:
npx clawhub@latest install mcporterThen configure the MCP server below. MCP Porter acts as a bridge between OpenClaw and MCP servers.
{
"mcp": {
"servers": {
"edgex": {
"command": "npx",
"args": ["-y", "@realnaka/edgex-mcp"],
"env": {
"EDGEX_ACCOUNT_ID": "your-account-id",
"EDGEX_STARK_PRIVATE_KEY": "0x..."
}
}
}
}
}Market data tools work without credentials. Account and trading tools require EDGEX_ACCOUNT_ID and EDGEX_STARK_PRIVATE_KEY.
Related MCP server: coinex-mcp-server
Tools
Environment (no auth)
Tool | Description |
| Current baseUrl, isTestnet, environment ("testnet" | "mainnet"). Call this to confirm testnet vs mainnet before trading. |
Market Data (public, no auth)
Tool | Description |
| 24h ticker: price, volume, OI, funding rate. Omit symbol for multiple contracts. |
| Order book bids/asks |
| Candlestick data (1m to 1M intervals) |
| Current and predicted funding rate |
| Long/short ratio from multiple exchanges |
| Market-wide volume summary |
Account (requires auth)
Tool | Description |
| Account balances, equity, margin |
| Open positions with unrealized PnL |
| Active/pending orders |
| Status of a specific order |
| Max order size given current balance |
| Set leverage per contract (cross-margin) |
Trading (requires auth)
Tool | Description |
| Place limit/market orders with optional TP/SL |
| Cancel orders by ID |
| Cancel all orders (optionally by symbol) |
Supported Assets
290+ perpetual contracts:
Crypto: BTC, ETH, SOL, and more
US Equities: TSLA, AAPL, NVDA, GOOG, AMZN, META, and more
Flexible symbol input: BTC, btc, BTCUSD, or contract ID 10000001.
Environment Variables
Variable | Required | Description |
| For trading | EdgeX account ID |
| For trading | StarkEx private key |
| No | Set to |
| No | Override REST API URL |
| No | HTTP proxy URL (see below) |
Proxy Configuration
Node.js's built-in fetch does not automatically use system proxy settings ($https_proxy / $http_proxy). If you're behind a proxy (common in China, corporate networks, etc.), requests to the EdgeX API will fail silently.
The MCP server auto-detects proxy env vars at startup and configures fetch accordingly (requires Node.js >= 20 or undici installed). You just need to pass the proxy URL via MCP env config:
{
"mcpServers": {
"edgex": {
"command": "npx",
"args": ["-y", "@realnaka/edgex-mcp"],
"env": {
"HTTPS_PROXY": "http://127.0.0.1:7890",
"EDGEX_ACCOUNT_ID": "your-account-id",
"EDGEX_STARK_PRIVATE_KEY": "0x..."
}
}
}
}Why this is needed: npx spawns a new Node.js process that does not inherit your shell's proxy environment variables. You must explicitly pass HTTPS_PROXY (or HTTP_PROXY) in the MCP env block.
Verify proxy is active: Call edgex_get_environment — the response includes a proxy field showing the active proxy URL or "none".
Security
Private keys stay on your local machine (never sent to any third-party server)
The MCP server runs as a local process, communicating via stdin/stdout
Credentials are passed via environment variables, not stored in config files
Use sub-account keys and set withdrawal whitelist on your main account
Resources (for AI agents)
The server exposes three MCP Resources that AI agents can read for context:
Resource URI | Content |
| Margin, order types, stock contract rules, funding, liquidation |
| Safe order workflows, key field paths, data parsing rules |
| JSON response schemas for all tools |
AI clients (Cursor, Claude Code) will automatically discover these via resources/list and can read them before performing tasks.
EdgeX Tool Ecosystem
This project is part of the EdgeX developer ecosystem. Each project is independent — choose whichever fits your integration scenario:
Project | npm Package | For |
edgex-mcp (this) |
| AI agents via MCP protocol (Cursor, Claude Code, OpenClaw) |
| Humans, shell scripts, and AI agents via SKILL.md |
Key differences:
edgex-mcp — structured tool interface, type-safe arguments via MCP protocol, server instructions and resources for AI context. Best for deep AI integration.
edgex-cli — text-based CLI with
--jsonoutput, installable SKILL.md for AI agents. Best for shell scripting and human interaction.
Both connect to the same EdgeX exchange API. You can use them together or independently.
Full Guide
1. Installation & Configuration
Add the
edgexentry shown above to your MCP configuration (command+args+ optionalenv).Market data only: You can skip
EDGEX_ACCOUNT_IDandEDGEX_STARK_PRIVATE_KEY— all public market data tools work without credentials.Trading & account access: Set
EDGEX_ACCOUNT_IDandEDGEX_STARK_PRIVATE_KEYin the MCPenvblock (use the corresponding credentials for mainnet or testnet).
2. Testnet vs Mainnet
Mainnet (production): Leave
EDGEX_TESTNETunset or set to0. Connects tohttps://pro.edgex.exchangewith real funds.Testnet: Set
EDGEX_TESTNET=1in the MCPenv. Connects tohttps://testnet.edgex.exchangefor safe experimentation.
Always call edgex_get_environment first and verify that environment and baseUrl match your expectation before placing any orders.
3. Recommended Workflow
Confirm environment:
edgex_get_environment→ checkenvironment("mainnet" / "testnet").Check market data:
edgex_get_ticker,edgex_get_funding, etc. Omitsymbolfor a multi-contract overview, or passBTC,ETH,SOL, etc.Before placing orders: Call
edgex_get_balancesandedgex_get_max_sizeto verify balance and available size. Confirm direction, quantity, and price with the user before callingedgex_place_order.Order management: Use
edgex_get_ordersto list open orders. Useedgex_get_order_status(orderId)for a single order (if it returnsfound: false, fall back toget_orders). Cancel withedgex_cancel_orderoredgex_cancel_all_orders.
4. Troubleshooting: npx Fails to Start
In some environments, npx @realnaka/edgex-mcp may not launch correctly. Use the local build path instead:
"edgex": {
"command": "node",
"args": ["/absolute/path/to/edgex-mcp/dist/index.js"],
"env": { "EDGEX_ACCOUNT_ID": "...", "EDGEX_STARK_PRIVATE_KEY": "0x..." }
}Alternatively, install globally and run directly:
npm install -g @realnaka/edgex-mcp
# Then use "command": "edgex-mcp" in your MCP configKnown Limitations
Issue | Description | Workaround |
get_order_status | The backend | Use |
npx startup | Some npm versions may not install the | Use the |
US equity market orders | Market orders for US equity contracts are rejected outside trading hours. Only limit orders within the allowed price range are accepted. | Use limit orders for equity contracts. See |
Proxy not inherited |
| Pass |
OpenClaw MCP support | OpenClaw does not natively support MCP protocol. | Install MCP Porter first: |
License
MIT
Available Tools
17 toolsedgex_cancel_all_ordersA
Cancel all active orders, optionally filtered by symbol.
Inputs: symbol.
edgex_cancel_orderA
Cancel one or more orders by ID.
Inputs: orderIds (required).
edgex_get_auth_statusA
Check if authentication is configured. CALL THIS FIRST at the start of every session. Returns whether account credentials are set up and what tools are available.
Inputs: no named parameters.
edgex_get_balancesB
Get account balances, positions, and equity. Requires EDGEX_ACCOUNT_ID and EDGEX_STARK_PRIVATE_KEY.
Inputs: no named parameters.
edgex_get_depthA
Get order book depth (bids and asks) for a contract.
Inputs: symbol (required), level.
edgex_get_environmentA
Get current MCP environment: baseUrl, testnet/mainnet, and auth status.
Inputs: no named parameters.
edgex_get_fundingA
Get current and predicted funding rate. Positive = longs pay shorts. Omit symbol for first N contracts from cache.
Inputs: symbol.
edgex_get_klineC
Get candlestick/kline data for technical analysis.
Inputs: symbol (required), count, interval.
edgex_get_max_sizeA
Get maximum order size for a contract given current balance and leverage.
Inputs: symbol (required).
edgex_get_ordersC
Get active/pending orders.
Inputs: symbol.
edgex_get_order_statusB
Get status of a specific order by ID.
Inputs: orderId (required).
edgex_get_positionsA
Get open positions with unrealized PnL. Returns empty array if no positions.
Inputs: no named parameters.
edgex_get_ratioA
Get long/short ratio aggregated from multiple exchanges (Binance, OKX, Bybit, etc.).
Inputs: symbol.
edgex_get_summaryB
Get market-wide volume and trading summary.
Inputs: no named parameters.
edgex_get_tickerA
Get 24h ticker: price, volume, open interest, funding rate. Omit symbol to get all contracts (uses cached contract list, may return subset).
Inputs: symbol.
edgex_place_orderA
Place a limit or market order. For stock contracts during market closure, only limit orders are allowed. ALWAYS confirm with the user before calling this tool.
Inputs: side (required), size (required), type (required), symbol (required), +3 more.
edgex_set_leverageB
Set leverage for a contract. EdgeX uses cross-margin mode.
Inputs: symbol (required), leverage (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a distinct resource and action: market data (ticker, depth, kline), account (balances, positions), order management (get_active, get_status, cancel). Even similar tools like cancel_order vs cancel_all_orders are clearly differentiated by scope.
All tools follow the edgex_verb_noun pattern consistently: get_* for queries, set_leverage, place_order, cancel_order. The uniform prefix and verb usage make the tool set predictable and easy to navigate.
With 17 tools, the server is on the higher end of the ideal range, but each tool maps to a clear trading or data function. The count is justified by the breadth of exchange operations, though slightly heavy.
Core lifecycle coverage for trading is present: market data, account info, order placement/cancellation, leverage. Minor gaps exist such as no explicit historical order/trade retrieval, but the surface is otherwise complete for active trading workflows.
Maintenance
Related MCP Connectors
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
MCP server for Mudrex futures trading enabling AI agents to securely access data and risk tools.
MCP server for OpenMM — exposes market data, account, trading, and strategy tools to AI agents
MCP server exposing the Backtest360 engine API as tools for AI agents.
Related MCP Servers
AlicenseCqualityDmaintenanceAn MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.37178GPL 3.0
coinex-mcp-serverofficial
AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the CoinEx cryptocurrency exchange, enabling market data queries and authenticated trading operations via AI agents.Apache 2.0
okx-trade-mcpofficial
AlicenseNot gradedqualityBmaintenanceMCP server connecting AI assistants to OKX exchange, enabling trading, market data, account management, and more via 150+ tools across 11 modules.510MIT- AlicenseNot gradedqualityCmaintenanceA comprehensive MCP server for Aster DEX perpetual futures trading, enabling AI agents to access real-time market data, perform institutional-grade analysis, execute orders, and run automated trading strategies.1MIT