mcpField
T
trade-router-mcp

trade-router-mcp

Local
github.com/re-bruce-wayneFinance1Updated 27w ago

About trade-router-mcp

trade-router-mcp provides AI agents with a non-custodial interface for Solana swaps and order strategies. It keeps private-key signing on the agent's machine and verifies signed server messages.

Key features

  1. 01Build unsigned Solana swap transactions
  2. 02Submit signed swaps through Jito bundles
  3. 03Read wallet holdings and token prices
  4. 04Create limit, trailing-stop, DCA, and TWAP orders
  5. 05Verify server messages with Ed25519

Use cases

  1. 01Swap tokens while keeping signing local
  2. 02Monitor wallet holdings and token prices
  3. 03Set up automated limit or time-based orders

MCP support

The MCP server wraps Trade Router's API and exposes its trading capabilities as tools to compatible clients. The agent signs transactions locally; the server does not receive the private key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"re-bruce-wayne-trade-router": {
"command": "npx",
"args": [
"-y",
"@re-bruce-wayne/trade-router-mcp"
],
"env": {
"TRADEROUTER_PRIVATE_KEY": "<TRADEROUTER_PRIVATE_KEY>",
"TRADEROUTER_SERVER_PUBKEY": "<TRADEROUTER_SERVER_PUBKEY>",
"TRADEROUTER_BASE_URL": "<TRADEROUTER_BASE_URL>"
}
}
}
}
Run commandnpx -y @re-bruce-wayne/trade-router-mcp
Environment variables to set
TRADEROUTER_PRIVATE_KEYSecretSolana base58-encoded private key. Local signing only, never transmitted. See SECURITY.md.
TRADEROUTER_SERVER_PUBKEYSecretOptional override for the server public key used to verify order_filled ed25519 signatures.
TRADEROUTER_BASE_URLOptional API base URL override (default https://api.traderouter.ai).

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@re-bruce-wayne/trade-router-mcp1.0.6
pypitraderouter-mcp1.0.1

Tools

21

Saved tool list · updated 2w ago

This tool takes no parameters.

Details

From the project README

Trade Router — ClawHub skill

Non-custodial Solana trading API for AI agents. One interface for swaps, MEV-protected execution, wallet holdings, limit orders, trailing stops, DCA, TWAP, and combo orders. The private key stays with the agent that calls the API.

Security: non-custodial License: MIT

Is this safe?

Yes, and here's exactly why. The private key never crosses the network to api.traderouter.ai. POST /swap returns an unsigned transaction; the agent signs it locally; only the signed transaction goes to POST /protect (Jito MEV-protected bundle). Server responses are Ed25519-verified against a hard-coded trust anchor. See SECURITY.md for the full threat model, data-flow diagram, and permissions manifest.

Signing flow:

  1. Agent calls the skill's swap action → HTTPS request to api.traderouter.ai sends the wallet address (public key), token mint, amount
  2. API returns an unsigned transaction
  3. Agent signs the tx locally with its private key
  4. The signed transaction is submitted to /protect (Jito MEV-protected bundle)
  5. Server confirms and returns balance changes. The private key never leaves the agent's machine.

Two ways to consume this skill

A. Direct API integration (what SKILL.md documents)

Read SKILL.md for the full API spec — REST endpoints, WebSocket order protocol, request/response shapes, error handling, and reference agent example code. Pair it with any HTTP client and Solana signing library.

The example code in SKILL.md uses these conventions (feel free to pick your own — they're the agent's choice, not imposed by the API):

Example env varExample defaultPurpose in the reference agent
PRIVATE_KEY(required)Solana base58 private key held by the agent process
DRY_RUNtrueSafe-by-default gate — swap actions only submit when you set DRY_RUN=false
MAX_DAILY_LOSS_LAMPORTS2_000_000_000 (2 SOL)Activates the reference agent's KILL_SWITCH when exceeded

These are the reference agent's own conventions. The API itself doesn't require any of them.

B. Ready-made MCP server (@traderouter/trade-router-mcp)

For Claude Desktop, Cursor, Cline, and any MCP-compatible client, a published MCP server wraps the same API:

npx -y @traderouter/trade-router-mcp

Or wire it into your MCP client config:

{
  "mcpServers": {
    "traderouter": {
      "command": "npx",
      "args": ["-y", "@traderouter/trade-router-mcp"],
      "env": {
        "TRADEROUTER_PRIVATE_KEY": "your_base58_private_key"
      }
    }
  }
}

The MCP server's env conventions are different from the example code in SKILL.md — they're prefixed with TRADEROUTER_ for namespace hygiene in multi-MCP environments:

MCP env varRequiredPurpose
TRADEROUTER_PRIVATE_KEY✅Solana base58 private key (local use only)
SOLANA_RPC_URL❌Custom RPC (defaults to mainnet-beta)
TRADEROUTER_SERVER_PUBKEY❌Override the server Ed25519 trust anchor
TRADEROUTER_SERVER_PUBKEY_NEXT❌Accept an additional key during server rotation
TRADEROUTER_REQUIRE_SERVER_SIGNATURE❌Default true; fail-closed on order_filled verification
TRADEROUTER_REQUIRE_ORDER_CREATED_SIGNATURE❌Default true; fail-closed on order_created verification

The MCP server does not currently implement DRY_RUN or daily-loss caps — those live only in the reference agent example in SKILL.md. If you need them end-to-end, either use the reference agent pattern directly, or wrap the MCP tool calls with your own gate.

Full details, all 21 tools, and the LangChain adapter snippet are in the npm package README: https://www.npmjs.com/package/@traderouter/trade-router-mcp

Features

REST endpoints
EndpointPurpose
POST /swapBuild unsigned swap (multi-DEX: Raydium, PumpSwap, Orca, Meteora)
POST /protectSubmit signed tx via Jito bundle — MEV-protected, returns confirmed balance changes
POST /holdingsAccurate wallet scan — catches tokens standard RPC misses
GET /mcapMarket cap + price for any token
GET /flexTrade card PNG generation
GET /securityServer trust-anchor public key
WebSocket (wss://api.traderouter.ai/ws)

Persistent connection for server-side order monitoring:

  • Limit orders — trigger by market cap or price
  • Trailing stops — percentage or absolute
  • DCA / TWAP — time-weighted execution
  • Combo orders — limit+trailing, limit+TWAP, trailing+TWAP, limit+trailing+TWAP

Server polls market-cap ~every 5s. When an order triggers, you receive an unsigned tx → sign locally → submit.

Trust anchor

The baked-in server public key is EXX3nRzfDUvbjZSmxFzHDdiSYeGVP1EGr77iziFZ4Jd4. Every order_filled, order_created, and twap_execution message is Ed25519-verified against this key before being treated as authoritative. The server can rotate via TRADEROUTER_SERVER_PUBKEY_NEXT.

Fees

Flat 1% fee on swap volume, embedded in routing at /protect. No subscription, no API key, no monthly minimums. Read-only endpoints (/holdings, /mcap) are free.

Links

Security disclosure

Found a vulnerability? Email [email protected] or use GitHub Security Advisories on this repo. 48-hour acknowledgement. See SECURITY.md for the full policy.

License

MIT. See LICENSE.

Changelog

See CHANGELOG.md.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.