Skip to content
MCP server
Registry

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.

by orderlynetworkMITTypeScript0 stars
Trust score
66Good
Trust score 66 of 100, Good

Good trust

66 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 66 comes from

22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

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.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "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 capabilities

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 orderly install. The pinned CLI (v2.2.4) is installed with the package and used before anything on PATH.
  • An account to trade with. A fresh wallet takes three tool calls (wallet_create → wallet_register → wallet_add_key). To import an existing wallet, run orderly-trading-mcp setup in 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:

ToolKindPurpose
auth_listreadStored accounts (public IDs only)
wallet_createwriteGenerate a wallet (step 1; key stays in the keychain)
wallet_registerwriteRegister the account under a broker ID (step 2)
wallet_add_keywriteIssue a read/trading API key (step 3)
account_balancereadToken holdings
positions_listreadPositions, account value, margin
order_listreadWorking orders
market_pricereadMark/index/24h stats
market_orderbookreadDepth and best bid/ask
klinereadCandles
order_placewritePlace a perpetual order
order_cancelwriteCancel one order
order_cancel_allwriteCancel all orders
positions_closewriteReduce-only market close
leverage_getreadRead current leverage
leverage_setwriteChange leverage
orderly_commands / orderly_read / orderly_runmetaFull CLI coverage; orderly_read is read-only
orderly_statusmetaCLI 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_PROFILETools
core (default)20
predictcore + all six Predict tools, including predict_round (26)
algocore + algo_order_place, algo_order_cancel, algo_order_list (23)
allevery reviewed read command + every allowed trading mutation (72)
fullall + withdraw, faucet_usdc, faucet_account (75)

Wallet onboarding is in every profile; onboarding is not optional for a fresh install.

Safety model

VariableDefaultEffect
ORDERLY_BINbundledOverride 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_SCHEMAonSet 0 to hide trading tools when no compatible CLI is found
ORDERLY_MCP_PROFILEcoreTool surface (see above)
ORDERLY_MCP_READ_ONLYoffSet 1 to disable every mutation
ORDERLY_MCP_NETWORKCLI configDefault network override
ORDERLY_MCP_ACCOUNTautoDefault account ID when a call omits account
ORDERLY_MCP_ALLOW_MAINNETtrueSet 0 to block mainnet mutations
ORDERLY_MCP_ALLOW_UNKNOWN_READSoffSet 1 to expose new, unreviewed read commands
ORDERLY_MCP_STRICT_PROFILEoffSet 1 so orderly_run only reaches the selected profile
ORDERLY_MCP_TIMEOUT_MS30000Per-call timeout
ORDERLY_MCP_MAX_OUTPUT65536Max characters returned per call
ORDERLY_MCP_DEBUGoffLog 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-import and auth-import (need the secret typed by the user) are blocked in every profile, including orderly_run. Import in a terminal with orderly-trading-mcp setup. wallet-remove, wallet-logout, wallet-revoke-key, auth-logout, auth-cleanup and broker-create administer credentials and are blocked too.
  • Onboarding is allowed, but cannot escalate. wallet-create, wallet-register and wallet-add-key generate their keys inside the CLI process and return only addresses and public keys. wallet-add-key scope is clamped to read,trading; asset scope (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=1 opts 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-run expose a dry_run argument; 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:

KindWhat to do
Usage/validationCall orderly_commands for the exact spec
API/trading rejectionRead the message; check symbol, price, quantity, margin and account state
AuthenticationCheck auth_list; a fresh install onboards with wallet_create → wallet_register → wallet_add_key
TransientRetry after a delay
Multiple accountsPass account=<id> or set ORDERLY_MCP_ACCOUNT
Faucet limitThe testnet faucet is limited per account; use another funded account or wait
Settle PnL limitOne request every 10 minutes
Predict minimum / positionIncrease 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:

FileBuilds fromUse
Dockerfilethis repository's source (COPY src)local inspection; the same steps as Glama's source build
Dockerfile.glamathe 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).

  1. Merge to main in GitLab.
  2. In the pipeline, run npm_patch_stable (or npm_patch_alpha / npm_minor_stable). The job bumps package.json and server.json, commits Release X.Y.Z, tags vX.Y.Z, pushes to GitLab, and publishes to npm.
  3. mirror_github_branch pushes main to GitHub master, and mirror_github_tag pushes the release tag. .github/workflows/publish-registry.yaml validates server.json, waits for the npm version, then publishes the MCP registry with GitHub OIDC.
  4. Update Glama's pinned commit SHA and build steps (GLAMA.md). Glama scans the GitHub master branch, 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

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server