Orderly Trading MCP
OfficialClick 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., "@Orderly Trading MCPshow my open positions and unrealized PnL"
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.
Orderly Trading MCP
MCP server that gives AI clients trading access to Orderly Network through the
locally installed orderly CLI.
Private keys live in the OS keychain. The MCP process never sees them and never signs anything — it only discovers the CLI's command surface, validates arguments, and runs the CLI as a subprocess.
MCP client ⇄ stdio ⇄ orderly-trading-mcp ⇄ execFile ⇄ orderly CLI ⇄ Orderly API
↳ OS keychainRequirements
Node.js >= 20
orderlyCLI v2.0.1+ (v2.1.0+ recommended; it adds richer command metadata toorderly schema)A wallet/API key already set up in the CLI (
orderly auth-listshows them)
Related MCP server: hyperliquid-mcp
Install
# CLI (installs to ~/.local/bin)
curl -fsSL https://orderly.network/cli.sh | sh
# MCP server
npm install -g @orderly.network/trading-mcp
orderly-trading-mcp doctordoctor prints every CLI candidate it found, the selected binary, the effective
profile/network, and the accounts visible in the keychain.
Client configuration
The reliable form sets ORDERLY_BIN explicitly. GUI clients often launch with a
minimal PATH, so ~/.local/bin may not be visible even though your terminal
finds orderly.
Claude Code / Cursor (.mcp.json or .cursor/mcp.json):
{
"mcpServers": {
"orderly-trading": {
"command": "npx",
"args": ["-y", "@orderly.network/trading-mcp"],
"env": {
"ORDERLY_BIN": "/Users/you/.local/bin/orderly"
}
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"orderly-trading": {
"command": "npx",
"args": ["-y", "@orderly.network/trading-mcp"],
"env": { "ORDERLY_BIN": "/Users/you/.local/bin/orderly" }
}
}
}OpenCode (opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"orderly-trading": {
"type": "local",
"command": ["npx", "-y", "@orderly.network/trading-mcp"],
"environment": { "ORDERLY_BIN": "/Users/you/.local/bin/orderly" },
"enabled": true
}
}
}Codex (.codex/config.toml):
[mcp_servers.orderly-trading]
command = "npx"
args = ["-y", "@orderly.network/trading-mcp"]
env = { ORDERLY_BIN = "/Users/you/.local/bin/orderly" }Tools
The default core profile registers 14 tools:
Tool | Kind | Purpose |
| read | Stored accounts (public IDs only) |
| read | Token holdings |
| read | Positions, account value, margin |
| read | Working orders |
| read | Mark/index/24h stats |
| read | Depth and best bid/ask |
| read | Candles |
| write | Place a perpetual order |
| write | Cancel one order |
| write | Cancel all orders |
| write | Reduce-only market close |
| write | Read or set leverage |
| meta | Full CLI coverage |
Everything else — algo/TP-SL orders, batch orders, Predict, trades, funding, history, symbols, fee tiers — is reached through the escape hatch:
orderly_commands({ query: "algo" })
orderly_run({
command: "algo-order-place",
args: {
symbol: "PERP_ETH_USDC", side: "SELL", algo_type: "TP_SL",
quantity: 0.01, tp_trigger_price: 2500, account: "0x..."
}
})orderly_run applies the same policy as the dedicated tools: secret-command
blocklist, mutation allowlist, read-only mode and mainnet gate. Because it can
mutate, it is annotated non-read-only; reads routed through it may trigger an
extra client confirmation. Prefer the dedicated read tools for listings.
Profiles add dedicated tools for domains:
| Tools |
| 14 |
| core + |
| core + |
| every read command + every allowed trading mutation (~66) |
|
|
Safety model
Variable | Default | Effect |
| auto | Explicit CLI path; if set and invalid, no fallback |
|
| Tool surface (see above) |
| off | Set |
| CLI config | Default network override |
|
| Set |
|
| Per-call timeout |
|
| Max characters returned per call |
| off | Log argv/timing to stderr |
faucet_account --wait can take up to 120 seconds; raise
ORDERLY_MCP_TIMEOUT_MS (for example to 180000) before using it.
Design rules:
Keys never enter the MCP.
wallet-*,auth-import,auth-logout,auth-cleanup,broker-createandauth-export-keyare blocked in every profile, includingorderly_run.auth-export-keyis read-only in the CLI manifest but prints a private key, so it is denied explicitly.Fail-closed mutations. Only an explicit allowlist of trading commands can mutate. A new mutating CLI command stays invisible until it is reviewed.
No shell. The CLI is spawned with an argv array, so hex account IDs and other values cannot inject shell syntax.
No hangs. stdin is closed, so interactive CLI prompts fail fast; every call has a timeout.
Mutations are serialized, so parallel tool calls cannot double-submit.
Preview first. Mutating tools that support
--dry-runexpose adry_runargument; descriptions instruct the model to preview before executing.No automatic retries for mutations.
Output and errors
The CLI's compact JSON is passed through unchanged. Non-JSON output (for example
No keys stored...) is returned as text. Errors include the CLI stderr and the
exit-code meaning:
Code | Meaning |
2 | Usage/validation — call |
3 | Authentication — check |
4 | Trading rejection — check balance, leverage, symbol, price |
5 | Transient — retry after a delay |
Resources: orderly://schema, orderly://accounts, orderly://config,
orderly://guide.
Development
npm install
npm run typecheck # tsc --noEmit
npm test # builds dist/ + 33 unit/protocol tests
npm run build
npm run doctor
node dist/index.js tools # print the registered tool listTests use a hermetic fake CLI (test/fixtures/fake-orderly.mjs), so they do not
need network, keychain or the real binary.
The CLI schema is loaded once at server startup. Restart the MCP server after
upgrading the CLI or changing ORDERLY_MCP_PROFILE / ORDERLY_BIN.
Releasing
Bump
versioninpackage.jsonand every version inserver.json, then commit. The registry workflow rejects mismatched versions.Tag and push:
git tag v0.2.0 git push origin v0.2.0.github/workflows/release.yamlruns typecheck, tests and build, then publishes to npm with provenance (NPM_TOKENsecret required)..github/workflows/publish-registry.yamlwaits for the npm version to appear, then publishesserver.jsonto the MCP registry with GitHub OIDC.
There is no Docker image: this server is stdio-only, unlike the read-only MCP.
Not included (on purpose)
Key, wallet, auth and broker management tools.
HTTP transport. Exposing a trading server over the network needs its own authentication and threat model; stdio only for now.
Automatic CLI download. Install it explicitly; the installer verifies the release checksum.
Available Tools
1 toolorderly_statusOrderly CLI statusARead-onlyIdempotent
Report why the Orderly CLI is unavailable and how to fix it. The trading tools are disabled until a compatible orderly CLI (v2.0.1+) is found.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavior: a hard version gate (v2.0.1+) and the causal fact that trading tools are disabled until that gate is satisfied, which the agent could not infer from the annotations. Return shape is not described, but that is the remaining gap rather than a contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with no filler: the purpose is front-loaded, then the blocking condition and version requirement. Every clause contributes information an agent needs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only, closed-world status tool with full annotation coverage, the description covers what it does, why it matters, and the version threshold. It does not describe the shape of the diagnosis output (no output schema exists), which is a minor omission for a tool whose whole value is the report content.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is no parameter semantics for the description to carry and the baseline of 4 applies. Nothing in the description misleads about inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('Report') and target ('why the Orderly CLI is unavailable') plus the remediation angle, so an agent knows this is a diagnostic/status tool rather than a trading action. It is slightly indirect because the tool is titled 'status' but described as a diagnostic report, though the two readings converge.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied rather than stated: 'The trading tools are disabled until a compatible orderly CLI (v2.0.1+) is found' tells the agent this is the tool to reach for when trading tools are blocked, and gives the version threshold to check. There is no explicit 'call this when X fails' instruction or exclusion, and no siblings exist to disambiguate against.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
orderly_status
TDQS
Scored across 1 tool
With only a single tool exposed, there is no possibility of overlap or misselection. An agent cannot confuse orderly_status with anything else because nothing else exists.
The lone tool uses a clear, predictable snake_case server-prefixed convention (orderly_status). No mixed styles or verb inconsistencies can arise from a single-name surface.
A server named 'Orderly Trading MCP' exposes exactly one diagnostic tool and zero trading operations. This is an extreme mismatch between the stated purpose and the actual surface, effectively a stub rather than a functional toolset.
There are no trading capabilities at all—no order placement, cancellation, position queries, or market data. The only tool reports that the CLI is unavailable, leaving every conceivable trading workflow as a dead end.
Maintenance
Related MCP Connectors
Trade Papertrade BTC and ETH perps from Claude, ChatGPT, Codex, Cursor and any MCP client.
Perpetual futures trading for AI agents on the user's own exchange accounts, behind one risk gate.
Non-custodial DeFi tools for AI agents on Solana: swaps, perps, lending, staking, equities.
Trading tools for AI agents: token risk checks, swap quotes, unsigned swaps, holdings on 5 chains.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to perform native trading on True Markets by providing tools for price lookups, balance management, and secure trade execution with quote caching. It replaces fragile CLI-based workflows with structured JSON responses and persistent authentication for more reliable financial operations.8MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to securely trade on Hyperliquid perpetual exchange, including order placement, position management, market data retrieval, and vault operations via natural language.34 PyPI24MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact with Hyperliquid perpetual futures exchange for market analysis, account management, and risk-managed trading.51MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language trading of Hyperliquid perpetual futures, including portfolio checks, market data, order placement with confirmation, and position management.MIT