trading-mcp MCP Server
Orderly Network trading MCP server backed by the orderly CLI. Keys stay in the OS keychain.
trading-mcp scores 66 (Good), licensed MIT and written in TypeScript. It installs as a local process. It declares 16 tools. Filed under Finance. GitHub shows 0 stars. Package registries report about 599 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
66 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade B
70/100 for listing completeness. Lost points: 16 of 16 tools barely described, short summary, no docs link.
How quality is graded
Where the 66 comes from
22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 0 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 10 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "orderlynetwork-trading-mcp": { "command": "npx", "args": [ "-y", "@orderly.network/trading-mcp@0.2.5" ] } }}
Environment variables
This server does not declare environment variables.
Tools16Tool docs quality grade D
All capabilitiesaccount_balancetoolread
auth_listtoolread
leverage_gettoolread
leverage_settoolwrite
market_orderbooktoolread
market_pricetoolread
order_canceltoolwrite
order_cancel_alltoolwrite
order_listtoolread
order_placetoolwrite
orderly_statustoolmeta
positions_closetoolwrite
About
Orderly Trading MCP
MCP server that gives AI clients trading access to Orderly Network through the
orderly CLI.
The CLI binary ships inside this package as an npm platform dependency
(@orderly.network/cli-<os>-<cpu>), pinned to a known release. Installing the
MCP is enough: there is no separate CLI install and no version drift, because
the advertised tool schemas come from the same binary that executes them.
Private keys live in the OS keychain. The MCP process never sees them and never signs anything — it discovers the CLI's command surface, validates arguments, and runs the CLI as a subprocess.
MCP client ⇄ stdio ⇄ orderly-trading-mcp ⇄ execFile ⇄ bundled orderly CLI ⇄ Orderly API
↳ OS keychain
Requirements
- Node.js >= 20
- No separate
orderlyinstall. The pinned CLI (v2.2.4) is installed with the package and used before anything onPATH. - An account to trade with. A fresh wallet takes three tool calls
(
wallet_create→wallet_register→wallet_add_key). To import an existing wallet, runorderly-trading-mcp setupin a terminal.
ORDERLY_BIN overrides the bundled binary — useful when developing against a
CLI checkout, or on a platform with no bundled build. When set, it must be
v2.0.1+; if it is invalid there is no fallback.
If no usable binary is found (unsupported platform, or npm install --no-optional), the server still advertises the reviewed tool surface from the
bundled orderly schema snapshot (v2.2.4). The tools keep their real schemas so
MCP clients and registries can inspect them, but every call returns an
install/repair message until a binary is available. Set
ORDERLY_MCP_BUNDLED_SCHEMA=0 to restore the fail-closed one-tool mode.
Install
npm install -g @orderly.network/trading-mcp
orderly-trading-mcp doctor
doctor prints the selected binary and whether it is bundled, the effective
profile/network, and the accounts visible in the keychain.
Client configuration
The bundled CLI is resolved from this package's own node_modules, so the
minimal configuration needs no environment at all. If the keychain has multiple
accounts, set ORDERLY_MCP_ACCOUNT to the account ID you want as the default.
Set ORDERLY_BIN only when you want to pin an external CLI binary.
Claude Code / Cursor (.mcp.json or .cursor/mcp.json):
{
"mcpServers": {
"orderly-trading": {
"command": "npx",
"args": ["-y", "@orderly.network/trading-mcp"]
}
}
}
VS Code (.vscode/mcp.json):
{
"servers": {
"orderly-trading": {
"command": "npx",
"args": ["-y", "@orderly.network/trading-mcp"]
}
}
}
OpenCode (opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"orderly-trading": {
"command": ["npx", "-y", "@orderly.network/trading-mcp"],
"environment": {
"ORDERLY_MCP_TIMEOUT_MS": "180000"
},
"timeout": { "execution": 190000 }
}
}
}
}
Older OpenCode builds use the deprecated top-level mcp.<name> form; the
timeout there is a single integer. The mcp.servers form above is current.
Codex (.codex/config.toml):
[mcp_servers.orderly-trading]
command = "npx"
args = ["-y", "@orderly.network/trading-mcp"]
Tools
The default core profile registers 20 tools:
| Tool | Kind | Purpose |
|---|---|---|
auth_list | read | Stored accounts (public IDs only) |
wallet_create | write | Generate a wallet (step 1; key stays in the keychain) |
wallet_register | write | Register the account under a broker ID (step 2) |
wallet_add_key | write | Issue a read/trading API key (step 3) |
account_balance | read | Token holdings |
positions_list | read | Positions, account value, margin |
order_list | read | Working orders |
market_price | read | Mark/index/24h stats |
market_orderbook | read | Depth and best bid/ask |
kline | read | Candles |
order_place | write | Place a perpetual order |
order_cancel | write | Cancel one order |
order_cancel_all | write | Cancel all orders |
positions_close | write | Reduce-only market close |
leverage_get | read | Read current leverage |
leverage_set | write | Change leverage |
orderly_commands / orderly_read / orderly_run | meta | Full CLI coverage; orderly_read is read-only |
orderly_status | meta | CLI discovery, schema source and configuration diagnostics |
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 shared policy: secret-command blocklist, mutation
allowlist, read-command allowlist, read-only mode and mainnet gate. Profiles
control the dedicated tool surface only; by default the escape hatch still
reaches every allowed command. Set ORDERLY_MCP_STRICT_PROFILE=1 to restrict
orderly_run to the selected profile as well. Because it can mutate,
orderly_run is annotated non-read-only; reads routed through it may trigger an
extra client confirmation. Use orderly_read for reads: it runs the same policy,
rejects mutating commands and is annotated read-only.
Profiles add dedicated tools for domains:
ORDERLY_MCP_PROFILE | Tools |
|---|---|
core (default) | 20 |
predict | core + all six Predict tools, including predict_round (26) |
algo | core + algo_order_place, algo_order_cancel, algo_order_list (23) |
all | every reviewed read command + every allowed trading mutation (72) |
full | all + withdraw, faucet_usdc, faucet_account (75) |
Wallet onboarding is in every profile; onboarding is not optional for a fresh install.
Safety model
| Variable | Default | Effect |
|---|---|---|
ORDERLY_BIN | bundled | Override the bundled CLI. Must be v2.0.1+; if set and invalid, no fallback to another binary (the bundled schema is still listed) |
ORDERLY_MCP_BUNDLED_SCHEMA | on | Set 0 to hide trading tools when no compatible CLI is found |
ORDERLY_MCP_PROFILE | core | Tool surface (see above) |
ORDERLY_MCP_READ_ONLY | off | Set 1 to disable every mutation |
ORDERLY_MCP_NETWORK | CLI config | Default network override |
ORDERLY_MCP_ACCOUNT | auto | Default account ID when a call omits account |
ORDERLY_MCP_ALLOW_MAINNET | true | Set 0 to block mainnet mutations |
ORDERLY_MCP_ALLOW_UNKNOWN_READS | off | Set 1 to expose new, unreviewed read commands |
ORDERLY_MCP_STRICT_PROFILE | off | Set 1 so orderly_run only reaches the selected profile |
ORDERLY_MCP_TIMEOUT_MS | 30000 | Per-call timeout |
ORDERLY_MCP_MAX_OUTPUT | 65536 | Max characters returned per call |
ORDERLY_MCP_DEBUG | 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.
auth-export-key(prints a private key),wallet-importandauth-import(need the secret typed by the user) are blocked in every profile, includingorderly_run. Import in a terminal withorderly-trading-mcp setup.wallet-remove,wallet-logout,wallet-revoke-key,auth-logout,auth-cleanupandbroker-createadminister credentials and are blocked too. - Onboarding is allowed, but cannot escalate.
wallet-create,wallet-registerandwallet-add-keygenerate their keys inside the CLI process and return only addresses and public keys.wallet-add-keyscope is clamped toread,trading;assetscope (withdrawals) is rejected. - Fail-closed mutations. Only an explicit allowlist of trading commands can mutate. A new mutating CLI command stays invisible until it is reviewed.
- Fail-closed reads. Read commands are allowlisted too, so a new read command
cannot expose sensitive data without review.
ORDERLY_MCP_ALLOW_UNKNOWN_READS=1opts out. - 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 when it fits. Non-JSON output
(for example No keys stored...) is returned as text. If a response exceeds
ORDERLY_MCP_MAX_OUTPUT, the call fails with a clear error rather than returning
truncated, invalid JSON. Batch commands that return per-row success flags are
reported as errors when any row fails, with the failed count in the message.
Errors include the CLI stderr and a hint based on the error kind:
| Kind | What to do |
|---|---|
| Usage/validation | Call orderly_commands for the exact spec |
| API/trading rejection | Read the message; check symbol, price, quantity, margin and account state |
| Authentication | Check auth_list; a fresh install onboards with wallet_create → wallet_register → wallet_add_key |
| Transient | Retry after a delay |
| Multiple accounts | Pass account=<id> or set ORDERLY_MCP_ACCOUNT |
| Faucet limit | The testnet faucet is limited per account; use another funded account or wait |
| Settle PnL limit | One request every 10 minutes |
| Predict minimum / position | Increase shares to meet the round minimum, or read the binary position first |
The CLI exit codes are 2 usage, 3 auth, 4 trading rejection and 5
transient. Business limits and Predict position errors are also recognized from
their message, so they are not misreported as malformed arguments.
Predict positions below the round's $1 minimum notional cannot be closed and settle at expiry. Position reads can lag a moment after a fill.
Resources: orderly://schema, orderly://accounts, orderly://config,
orderly://guide.
Development
pnpm install
pnpm typecheck # tsc --noEmit
pnpm test # builds dist/ + unit and protocol tests
pnpm build
pnpm run doctor
pnpm check:pin # bundled schema, platform packages and pin agree
node dist/index.js tools # print the registered tool list
node scripts/update-bundled-schema.mjs --bin /path/to/orderly # refresh the bundled schema
Tests 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
changing ORDERLY_MCP_PROFILE / ORDERLY_BIN. Bumping the CLI pin is one
change in three places, enforced by pnpm check:pin (also part of
prepublishOnly): the version in src/cli/bundled-cli.ts, the
@orderly.network/cli-* versions in package.json, and the regenerated
src/cli/bundled-schema.ts.
Docker / Glama inspection
The repository includes a Dockerfile for stdio MCP harnesses such as Glama.
It installs the pinned CLI release (so public market-data calls return live
data), builds the server, and exposes it over SSE through mcp-proxy:
docker build -t orderly-trading-mcp .
docker run --rm -it orderly-trading-mcp
This is an inspection convenience, not a production trading deployment: the container has no keys, and authenticated or mutating calls fail until it is configured. The npm package remains stdio-only.
Two Dockerfiles, for two different inputs:
| File | Builds from | Use |
|---|---|---|
Dockerfile | this repository's source (COPY src) | local inspection; the same steps as Glama's source build |
Dockerfile.glama | the published npm package (ARG ORDERLY_TRADING_MCP_VERSION) | fallback when the pinned commit is not on the default branch, and a release smoke test |
Both install the pinned CLI release with the release installer rather than
relying on the npm platform package: the images copy only the manifest and
lockfile, and ORDERLY_BIN pins the binary explicitly.
For Glama, follow GLAMA.md. Glama generates its own image from the
admin form, so the repository Dockerfiles are for local inspection only. The
form must pin a release commit that contains the bundled schema;
mirror_github_branch keeps the GitHub master branch at the latest main
commit.
Releasing
Releases are published from GitLab CI. .gitlab-ci.yml includes the shared
orderly-fe/common-ci npm release template and gates the manual release jobs
on a verify job (typecheck, tests, build, pack).
- Merge to
mainin GitLab. - In the pipeline, run
npm_patch_stable(ornpm_patch_alpha/npm_minor_stable). The job bumpspackage.jsonandserver.json, commitsRelease X.Y.Z, tagsvX.Y.Z, pushes to GitLab, and publishes to npm. mirror_github_branchpushesmainto GitHubmaster, andmirror_github_tagpushes the release tag..github/workflows/publish-registry.yamlvalidatesserver.json, waits for the npm version, then publishes the MCP registry with GitHub OIDC.- Update Glama's pinned commit SHA and build steps (GLAMA.md).
Glama scans the GitHub
masterbranch, which the branch mirror keeps at the release commit.
Do not bump versions or create tags manually. The version lifecycle script
(scripts/sync-server-version.mjs) keeps server.json in sync during the
release bump. The old .github/workflows/release.yaml was removed so npm is
not published twice.
Required GitLab CI/CD variables: PUBLIC_NPM_REGISTRY, PUBLIC_NPM_TOKEN,
GIT_USERNAME, GIT_TOKEN, GITHUB_MIRROR_TOKEN. Optional:
INTERNAL_NPM_REGISTRY, INTERNAL_NPM_TOKEN, SLACK_WEBHOOK_URL.
GitLab is the canonical repository; GitHub receives the main branch and
release tags. The shared pipeline runs plain npm publish, so releases no
longer carry npm provenance attestations.
The MCP release is independent of CLI releases, but it pins one: the
@orderly.network/cli-* optional dependencies and the bundled schema move
together when package.json is bumped. CLI v2.2.4 is the current pin; an
external ORDERLY_BIN must be v2.0.1+.
A published Docker image is not provided. The Dockerfile is for inspection
harnesses; the npm package remains stdio-only, unlike the read-only MCP.
Not included (on purpose)
- Wallet import/export, key removal or rotation, and broker creation. Onboarding
a new wallet is available; handling existing key material is a terminal
(
orderly-trading-mcp setup) or CLI operation. - HTTP transport. Exposing a trading server over the network needs its own authentication and threat model; stdio only for now.
- Automatic CLI download. The binary is an npm platform dependency resolved at install time; it is never fetched at runtime.
Frequently asked questions
What is trading-mcp MCP Server?
Orderly Network trading MCP server backed by the orderly CLI. Keys stay in the OS keychain.
How do I install trading-mcp MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. trading-mcp MCP Server runs locally from the npm package @orderly.network/trading-mcp with the command npx -y @orderly.network/trading-mcp@0.2.5.
Is trading-mcp MCP Server free and open source?
Yes. trading-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does trading-mcp MCP Server support remote (HTTP) connections?
No remote endpoint is listed for trading-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does trading-mcp MCP Server provide?
trading-mcp MCP Server provides 16 tools, including account_balance, auth_list, leverage_get, and leverage_set. See the full tool list for descriptions and parameters.
How is trading-mcp MCP Server's trust score calculated?
trading-mcp MCP Server scores 66 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.