# @orderly.network/trading-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/OrderlyNetwork/trading-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 2141  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/orderly-network-trading-mcp

## Description
MCP server for Orderly Network trading, backed by the orderly CLI

## Tools
Capabilities this server exposes over MCP:

- **wallet_create** — Generate a new EVM or SOL wallet and store its private key in the OS keychain. Only the address is returned; the private key is never printed and never leaves the CLI process. The wallet is not tradeable until wallet_register and wallet_add_key run. To use an existing wallet instead, ask the user to run `orderly-trading-mcp setup` in a terminal.
- **wallet_register** — Register the wallet with Orderly under a broker ID (for example "demo" on testnet). This creates the account record on the exchange and returns the account ID. Requires the wallet address from wallet_create. Ask the user for the broker ID; do not invent one.
- **wallet_add_key** — Create an Orderly API key for the wallet, store it in the OS keychain and return the public key plus the accountId used by every other tool. Only read and trading scope can be granted through the MCP; asset (withdrawal) scope must be added with the CLI directly. Requires the wallet address and, for a new account, the broker ID.
- **auth_list** — List stored API-key accounts: account ID, wallet address, network and public key. No secrets are returned. Use an accountId from this list as the `account` argument on other tools. Call this first when the account is unknown.
- **account_balance** — Show the account's token holdings (USDC balance, frozen amount, isolated margin). Use positions_list for account value, free collateral and margin ratios.
- **order_place** — Place a perpetual-futures order. ALWAYS call with dry_run=true first to preview the exact request, then repeat with dry_run=false to execute. symbol must be uppercase (e.g. PERP_ETH_USDC). type is LIMIT, MARKET, IOC, FOK or POST_ONLY and is required for BUY/SELL orders. price is required for LIMIT, IOC, FOK and POST_ONLY. Short form: side=BID (market buy) or ASK (market sell), with no type or price. For Orderly Predict rounds use predict_buy/predict_sell instead. Set client_order_id to make retries idempotent. Returns the order object, including order_id.
- **order_cancel** — Cancel one order by order_id. symbol is optional and auto-fetched when omitted. Call with dry_run=true to preview the DELETE request before executing.
- **order_cancel_all** — Cancel every open order, optionally limited to one symbol. This is destructive and has no dry-run; prefer order_cancel for a single order unless the user explicitly asks to cancel all.
- **order_list** — List orders, defaulting to open/incomplete orders. Filter by symbol, status, side, order_type or product_type. Set all=true to include completed orders. Use order_get via orderly_run for one specific order.
- **positions_list** — List open positions plus account value, free collateral and margin ratios. Use product_type=BINARY for Orderly Predict positions (positive quantity is UP, negative is DOWN). Position quantities can lag a moment after a fill; re-read before closing or sizing a new order.
- **positions_close** — Close a position with a reduce-only MARKET order. Omit quantity to close the full position; pass quantity for a partial close. Perpetual futures only — use predict_close for Orderly Predict. Preview with dry_run=true.
- **leverage_set** — Set leverage for a symbol. value is required. Preview a change with dry_run=true. Use leverage_get to read the current leverage without mutating.
- **market_price** — Get index price, mark price, 24h statistics, funding and open interest for one symbol (e.g. PERP_ETH_USDC). Read-only.
- **market_orderbook** — Get the order book for one symbol, including best bid/ask and depth. Use it to price limit orders. Read-only.
- **kline** — Get candlestick/kline data. type is one of 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w, 1mon; size defaults to 100 (max 1000). Read-only.
- **leverage_get** — Read the current leverage and margin mode for a symbol. Read-only; use leverage_set to change it.
- **orderly_commands** — Search the orderly CLI command surface available to this server. Use this before orderly_run whenever a dedicated tool does not cover the task. Returns command names, whether they mutate, usage, argument names/types/enums and help. Pass an exact command name (kebab-case or snake_case) for full detail, or a keyword to search. detail='full' includes long_about and complete argument help.
- **orderly_read** — Run an allowed read-only Orderly CLI command with structured arguments. Use this instead of orderly_run for reads when your client asks for confirmation on destructive tools. Mutating commands are rejected. Prefer a dedicated read tool when one exists; call orderly_commands first for exact argument names and enums.
- **orderly_run** — Run an allowed Orderly CLI command with structured arguments. Prefer a dedicated tool when one exists; use this for commands that do not have one. Call orderly_commands first to get exact argument names, enums and required flags. Examples: algo_order_place, order_edit, order_get, trades, funding_rates, symbols, predict_rounds. Mutating commands execute immediately unless they support dry_run and it is set to true — always preview first. Wallet import/export, key removal and auth administration are never available. Pass network to override the default.
- **orderly_status** — Report CLI discovery, the selected binary and version, the schema source, profile, network and account configuration. Call this when a trading tool reports that the orderly CLI is missing, too old, or misconfigured. When no CLI is installed, the other tools are listed from the bundled schema but cannot execute.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "trading-mcp": {
    "command": "npx",
    "args": ["-y","@orderly.network/trading-mcp"]
  }
}
```

## Documentation

## What @orderly.network/trading-mcp does

@orderly.network/trading-mcp exposes Orderly Network trading operations through MCP. Its dedicated tools cover wallet creation and registration, API-key setup, account balances, positions, orders, market data, leverage, and position closing. The server also exposes CLI discovery and execution tools for supported operations that do not have dedicated MCP tools.

A new wallet can be onboarded through three calls: create the wallet, register it with a broker ID, and issue a read/trading API key. Existing wallets are configured from a terminal with `orderly-trading-mcp setup`. Wallet addresses and public API keys can be returned, but private keys are kept in the operating system keychain.

## How it works

The MCP client communicates over stdio with the server. The server discovers the available command surface, validates structured arguments, and launches the bundled `orderly` CLI as a subprocess. The CLI then communicates with the Orderly API and accesses keychain-held credentials. The MCP process does not receive private keys or sign transactions.

The npm package includes a platform-specific CLI dependency, so a separate CLI installation is normally unnecessary. The `ORDERLY_BIN` setting can select an external compatible binary instead. If no usable binary is available, the server can still advertise its reviewed schemas, but calls return an installation or repair message unless bundled-schema behavior is disabled.

## Setup and configuration

Install the package globally and run the diagnostic command:

```sh
npm install -g @orderly.network/trading-mcp
orderly-trading-mcp doctor
```

The server requires Node.js 20 or newer. MCP clients can start it with `npx -y @orderly.network/trading-mcp`. Claude Code, Cursor, VS Code, and Codex configurations are documented using their respective MCP configuration files.

Useful configuration options include `ORDERLY_MCP_ACCOUNT` for selecting a default account, `ORDERLY_MCP_NETWORK` for a network override, `ORDERLY_MCP_PROFILE` for expanding the dedicated tool surface, and `ORDERLY_MCP_TIMEOUT_MS` for longer-running operations. `ORDERLY_MCP_READ_ONLY=1` disables mutations, while `ORDERLY_MCP_ALLOW_MAINNET=0` blocks mainnet mutations.

## Tools and capabilities

- Create, register, and add read/trading keys to wallets.
- List stored accounts without returning secrets.
- Read balances, positions, margin information, orders, prices, order books, candles, leverage, funding, and related CLI-supported data.
- Place, inspect, cancel, and close perpetual-futures positions.
- Change leverage and use dry-run previews where supported.
- Discover CLI commands with `orderly_commands`, then run permitted reads with `orderly_read` or other allowed operations with `orderly_run`.
- Select `core`, `predict`, `algo`, `all`, or `full` profiles for additional dedicated capabilities.

## Limitations and notes

`order_place` should be previewed with `dry_run=true` before execution. Cancel-all operations are destructive and do not provide a dry run. Predict positions and rounds use dedicated Predict commands, while algorithmic orders, batch orders, trades, funding, symbols, and other extended functions are accessed through the CLI tools or expanded profiles.

Credential import, export, removal, revocation, logout, and other credential-administration commands are blocked. Asset scope cannot be granted through MCP, so withdrawal access is not enabled by `wallet_add_key`. Mutations are allowlisted, serialized, and not automatically retried. Calls also use timeouts and bounded output sizes. The CLI is invoked with argument arrays rather than a shell, and interactive prompts fail instead of waiting for input.

_Full upstream README: https://allmcps.com/mcp/orderly-network-trading-mcp/readme_

