npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lmex-official/lmex-mcp-server

v1.0.2

Published

A Model Context Protocol (MCP) server for the LMEX exchange API — full spot and futures trading, market data, wallet management, and more.

Readme

LMEX MCP Server

A Model Context Protocol (MCP) server that exposes the full LMEX exchange API as AI-callable tools — spot trading, futures trading, market data, wallet management, and more.

Works with any MCP client: Claude Desktop, Cursor, Windsurf, and others.


Features

47 tools covering the entire LMEX REST API:

| Category | Tools | |-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | Spot — Market Data | Market summary, OHLCV, price, orderbook (grouped + L2), trades, server time | | Spot — Trading | Create order (LIMIT/MARKET/OCO/PEG/STOP/TRIGGER), amend order, cancel order, query order, open orders, trade history, fees, dead man's switch | | Spot — Algo | Create PEG (algo) order | | Futures — Market Data | Market summary, OHLCV, price, orderbook (grouped + L2), trades, funding history | | Futures — Trading | Create/amend/cancel/query order, algo order, open orders, trade history, fees, dead man's switch, bind TP/SL, close position | | Futures — Account | Positions, leverage (get/set), risk limit (get/set), position mode (get/set), margin, settlement currency | | Wallet | Futures wallet balance, wallet history, transfer between SPOT/CROSS/ISOLATED wallets |


Quick Start (npx — no install required)

Add to your MCP client config for LIVE trading:

{
  "mcpServers": {
    "lmex": {
      "command": "npx",
      "args": ["-y", "@lmex-official/lmex-mcp-server"],
      "env": {
        "LMEX_API_KEY": "your_api_key",
        "LMEX_API_SECRET": "your_api_secret",
        "LMEX_TESTNET": "false"
      }
    }
  }
}

Add to your MCP client config for TESTNET trading:

{
  "mcpServers": {
    "lmex": {
      "command": "npx",
      "args": ["-y", "@lmex-official/lmex-mcp-server"],
      "env": {
        "LMEX_API_KEY": "your_testnet_api_key",
        "LMEX_API_SECRET": "your_testnet_api_secret",
        "LMEX_TESTNET": "true"
      }
    }
  }
}

LMEX_TESTNET=false (default) points to production https://api.lmex.io.
Set LMEX_TESTNET=true to use the testnet at https://test-api.lmex.io.


Authentication

LMEX uses HMAC-SHA384 signatures. Create your API key at:

  • Testnet: https://test.lmex.io → Account → API
  • Production: https://lmex.io → Account → API

The signature is computed automatically: HMAC-SHA384(secret, path + nonce + body).

Required permissions

  • Public endpoints (market data) — no key needed
  • Spot tradingTrading permission
  • Futures tradingTrading permission
  • Read endpoints (history, fees, positions) — Read permission
  • Wallet transfersTransfer permission

Claude Desktop Config

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json or ~/.claude.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "lmex": {
      "command": "npx",
      "args": ["-y", "@lmex-official/lmex-mcp-server"],
      "env": {
        "LMEX_API_KEY": "your_api_key_here",
        "LMEX_API_SECRET": "your_api_secret_here",
        "LMEX_TESTNET": "false"
      }
    }
  }
}

Environment Variables

| Variable | Required | Default | Description | |-------------------|----------|---------|----------------------------------------| | LMEX_API_KEY | Yes | — | Your LMEX API key | | LMEX_API_SECRET | Yes | — | Your LMEX API secret | | LMEX_TESTNET | No | false | true = testnet, false = production |


Tool Reference

Spot — Market Data (public)

| Tool | Description | |----------------------------|------------------------------------------------------------------------------------------| | lmex_spot_market_summary | Market summary for all or one spot market (last price, bid/ask, 24hr stats) | | lmex_spot_ohlcv | OHLCV candlestick data (resolutions: 1, 5, 15, 30, 60, 240, 360, 1440, 10080, 43200 min) | | lmex_spot_price | Current index, last, and mark price | | lmex_spot_orderbook | Grouped L2 orderbook snapshot | | lmex_spot_orderbook_l2 | Raw L2 orderbook at a given depth | | lmex_spot_trades | Recent trade fills (max 30-day window) | | lmex_spot_server_time | Server time in ISO and epoch format |

Spot — Trading

| Tool | Description | |-------------------------------|-------------------------------------------------------------------| | lmex_spot_create_order | Create LIMIT, MARKET, OCO, PEG, STOP, or TRIGGER order | | lmex_spot_amend_order | Amend price, size, trigger price, or all fields | | lmex_spot_cancel_order | Cancel by orderID, clOrderID, or all orders for a symbol | | lmex_spot_query_order | Query a specific order by ID | | lmex_spot_create_algo_order | Create an algo (PEG) order that tracks the index price | | lmex_spot_cancel_all_after | Dead man's switch — cancel all after a TTL (timeout=0 to disable) | | lmex_spot_open_orders | List open unfilled orders | | lmex_spot_trade_history | Historical trade fills | | lmex_spot_fees | Maker/taker fee schedule |

Futures — Market Data (public)

| Tool | Description | |--------------------------------|-----------------------------------------------------------------| | lmex_futures_market_summary | Futures market summary including open interest and funding rate | | lmex_futures_ohlcv | OHLCV candlestick data | | lmex_futures_price | Current index, last, and mark price | | lmex_futures_orderbook | Grouped L2 orderbook | | lmex_futures_orderbook_l2 | Raw L2 orderbook | | lmex_futures_trades | Recent trade fills | | lmex_futures_funding_history | Historical funding rates |

Futures — Trading

| Tool | Description | |----------------------------------|---------------------------------------------------------------------| | lmex_futures_create_order | Create LIMIT, MARKET, OCO, PEG, STOP, TRIGGER, or reduce-only order | | lmex_futures_amend_order | Amend price, size, trigger price, or all fields | | lmex_futures_cancel_order | Cancel by orderID, clOrderID, or all orders | | lmex_futures_query_order | Query a specific order | | lmex_futures_create_algo_order | Create a PEG algo order | | lmex_futures_cancel_all_after | Dead man's switch | | lmex_futures_open_orders | List open orders | | lmex_futures_trade_history | Historical trade fills | | lmex_futures_fees | Maker/taker fee schedule | | lmex_futures_bind_tpsl | Bind take-profit and stop-loss to an open position | | lmex_futures_close_position | Close an open position at market or limit |

Futures — Account

| Tool | Description | |----------------------------------------|-----------------------------------------------------| | lmex_futures_positions | Open positions (all or per symbol) | | lmex_futures_get_leverage | Current leverage and margin mode | | lmex_futures_set_leverage | Set leverage (requires ONE_WAY mode for simple use) | | lmex_futures_get_risk_limit | Current risk limit level | | lmex_futures_set_risk_limit | Set risk limit | | lmex_futures_get_position_mode | ONE_WAY or HEDGE mode | | lmex_futures_set_position_mode | Switch between ONE_WAY and HEDGE | | lmex_futures_get_margin | Wallet margin summary for a symbol | | lmex_futures_set_settlement_currency | Change settlement currency for a position |

Wallet

| Tool | Description | |-------------------------------|----------------------------------------------------| | lmex_futures_wallet | Futures wallet balances (all or by currency) | | lmex_futures_wallet_history | Wallet transaction history | | lmex_futures_transfer | Transfer between SPOT, CROSS, and ISOLATED wallets |

Transfer examples

# Move USDT from futures cross wallet to spot:
walletSrcType: "CROSS"
walletDestType: "SPOT"
apiWallets: [{ currency: "USDT", balance: "500" }]

# Move BTC from spot back to futures:
walletSrcType: "SPOT"
walletDestType: "CROSS"
apiWallets: [{ currency: "BTC", balance: "0.01" }]

# Move USDT into isolated BTC-PERP margin:
walletSrcType: "CROSS"
walletDestType: "ISOLATED"
walletDest: "BTC-PERP"
apiWallets: [{ currency: "USDT", balance: "1000" }]

Order Types

Spot

| Type | txType | Description | |----------|-----------|----------------------------------------------------------| | LIMIT | LIMIT | Standard limit order | | MARKET | LIMIT | Market order (size = quote spend for BUY) | | LIMIT | STOP | Stop-loss limit (triggerPrice required) | | MARKET | STOP | Stop-loss market + optional trailValue for trailing stop | | MARKET | TRIGGER | Take-profit market | | OCO | LIMIT | One-Cancels-Other (stopPrice + triggerPrice required) | | PEG | — | Algo order tracking index by deviation % |

Time-in-Force

GTC · IOC · FOK · HALFMIN · FIVEMIN · HOUR · TWELVEHOUR · DAY · WEEK · MONTH


API Status Codes

| Code | Meaning | |------|----------------------------| | 2 | Order inserted | | 4 | Order fully transacted | | 5 | Order partially transacted | | 6 | Order cancelled | | 9 | Trigger order inserted | | 10 | Trigger order activated | | 123 | Order amended |


Development

git clone https://github.com/LMEXofficial/lmex-mcp-server
cd lmex-mcp-server
npm install

cp .env.example .env
# Fill in LMEX_API_KEY and LMEX_API_SECRET

npm run build     # compile TypeScript
npm run dev       # run from source with tsx
npm test          # unit tests
npx tsx test-live.ts  # live testnet end-to-end tests

Rate Limits

| Category | Per API | Per User | |----------|----------|----------| | Query | 15 req/s | 30 req/s | | Orders | 75 req/s | 75 req/s |


License

MIT — LMEX.io