Open SourceLMEX MCP Server
MCP Server · TypeScript · MIT

The LMEX exchange, in natural language.

47 tools covering the full LMEX REST API — spot and futures market data, order placement, wallet management, and position control — usable from any MCP-compatible AI agent. Testnet mode included.

$npx @lmex-official/lmex-mcp-server
47
Tools
Testnet
Safe mode
MIT
License
What's inside

Full spot and futures coverage

Market data, order placement, position management, leverage and risk limits, settlement currency — every REST endpoint available as a typed MCP tool.

Testnet mode

Set LMEX_TESTNET=true to point at test.lmex.io. Test order flows, position management, and wallet transfers without touching real funds.

7 order types

LIMIT, MARKET, STOP, TRIGGER, OCO (One-Cancels-Other), PEG (algo index-tracking), and reduce-only futures orders. Full time-in-force support: GTC, IOC, FOK, HALFMIN through MONTH.

Dead man's switch

lmex_spot_cancel_all_after and lmex_futures_cancel_all_after cancel all open orders after a TTL. Set timeout to 0 to disable. Safety net for unattended agents.

TP/SL binding

lmex_futures_bind_tpsl attaches take-profit and stop-loss levels to an open position in a single call.

HMAC-SHA384 auth, automatic

All authenticated requests are signed automatically: HMAC-SHA384(secret, path + nonce + body). You supply the key and secret, the server handles the signature.

Quick install
Live trading
$npx @lmex-official/lmex-mcp-server
Testnet (set LMEX_TESTNET=true in env)
$npx @lmex-official/lmex-mcp-server

Requires Node.js 18+. Set LMEX_API_KEY, LMEX_API_SECRET, and LMEX_TESTNET in your MCP client config. Public market data endpoints require no key.

Tool coverage

Spot — Market Data

7 tools
  • lmex_spot_market_summary
  • lmex_spot_ohlcv
  • lmex_spot_orderbook_l2
  • lmex_spot_trades

Spot — Trading

9 tools
  • lmex_spot_create_order
  • lmex_spot_amend_order
  • lmex_spot_cancel_all_after
  • lmex_spot_trade_history

Futures — Trading

11 tools
  • lmex_futures_create_order
  • lmex_futures_bind_tpsl
  • lmex_futures_close_position
  • lmex_futures_cancel_all_after

Futures — Account

9 tools
  • lmex_futures_positions
  • lmex_futures_set_leverage
  • lmex_futures_set_position_mode
  • lmex_futures_set_settlement_currency

Futures — Market Data

7 tools
  • lmex_futures_market_summary
  • lmex_futures_funding_history
  • lmex_futures_orderbook
  • lmex_futures_price

Wallet

3 tools
  • lmex_futures_wallet
  • lmex_futures_wallet_history
  • lmex_futures_transfer (SPOT/CROSS/ISOLATED)
Risk notice

Use testnet first. Always.

This server can place real orders on a live exchange. Set LMEX_TESTNET=true in your MCP config to point at the testnet environment until you've verified your agent's behaviour.

Public market data endpoints (market summary, OHLCV, orderbook, trades) require no API key. Only trading and wallet endpoints need credentials — use minimum required permissions.

Frequently asked

What permissions does my API key need?

Public endpoints need no key. Spot/futures trading needs the Trading permission. History and fee endpoints need Read. Wallet transfers need Transfer. Request only what you need.

How do I switch between testnet and production?

Set LMEX_TESTNET=true in your MCP client config env block to use test.lmex.io. Set it to false (or omit it) for production at api.lmex.io. Create separate testnet API keys at test.lmex.io.

What is the rate limit?

Query endpoints: 15 req/s per API, 30 req/s per user. Order endpoints: 75 req/s per API and per user. The server surfaces 429 errors — add delays for bulk operations.

Build trading agents with confidence.

Full exchange coverage, testnet mode for safe iteration, and typed MCP tools so your agent knows exactly what parameters each endpoint expects.