trade-router-mcp
OfficialThe trade-router-mcp server provides a non-custodial Solana trading engine for AI agents, enabling wallet management, market data, direct swaps, advanced conditional orders, and order management via TradeRouter.ai.
Wallet & Account
get_wallet_address— Retrieve the configured wallet's public Solana addressget_holdings— Scan and list all SPL token holdings for a wallet
Swapping
build_swap— Build an unsigned swap transaction across multiple DEXes (Raydium, PumpSwap, Orca, Meteora)submit_signed_swap— Submit a pre-signed transaction via MEV-protected Jito bundleauto_swap— One-shot build + sign + submit swap in a single call
Advanced Order Types
place_limit_order— Market-cap-based limit buy or sellplace_trailing_order— Trailing stop or trailing buyplace_twap_order— Time-weighted average price buy or sellplace_limit_twap_order— Limit trigger → TWAP executionplace_trailing_twap_order— Trailing trigger → TWAP executionplace_limit_trailing_order— Limit trigger → trailing stopplace_limit_trailing_twap_order— Limit → trailing → TWAP combo
Order Management
list_orders— List all active orderscheck_order— Get status of a specific order by IDcancel_order— Cancel an active orderextend_order— Extend an order's expiry timeget_fill_log— Retrieve a log of filled order events
Market Data & Visualization
get_mcap— Fetch market cap and price data for one or more tokensget_flex_card— Get a trade card PNG URL for a wallet + token pair
WebSocket & Connectivity
connect_websocket— Establish a persistent WebSocket connection (required before placing orders)connection_status— Check current WebSocket connection state
Allows integration with LangChain by providing MCP tools that can be used with LangChain's MultiServerMCPClient for building AI agent workflows.
Provides tools to interact with the Solana blockchain for swapping tokens, placing limit/trailing/TWAP/combo orders, checking holdings, and managing orders.
@traderouter/trade-router-mcp
A Model Context Protocol server for TradeRouter.ai — non-custodial Solana swap, limit, trailing, DCA, TWAP, and combo-order engine for AI agents.
Is this safe?
Yes, and here's exactly why. The private key is read once from TRADEROUTER_PRIVATE_KEY, used for local signing with @solana/web3.js + tweetnacl, and never transmitted, logged, or persisted. Only signed transactions leave your machine. Server messages 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:
Agent calls
build_swap→ MCP sends wallet address (public key) to api.traderouter.aiAPI returns an unsigned transaction
MCP signs the tx locally using
TRADEROUTER_PRIVATE_KEYThe signed transaction is submitted to
/protect(Jito MEV-protected bundle)Server confirms and returns balance changes. The private key never crosses the network.
Requirements
Node.js ≥ 18
A Solana wallet private key in base58 format (use a dedicated trading wallet, not your main holdings)
Install
npx -y @traderouter/trade-router-mcpOr wire it into an MCP client (Claude Desktop, Cursor, Cline, etc.):
{
"mcpServers": {
"traderouter": {
"command": "npx",
"args": ["-y", "@traderouter/trade-router-mcp"],
"env": {
"TRADEROUTER_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}OS | Claude Desktop config path |
macOS |
|
Windows |
|
Linux |
|
Environment variables
Variable | Required | Default | Purpose |
| ✅ | — | Solana wallet private key (base58). Local use only. |
| ❌ |
| Custom RPC for reads |
| ❌ | baked-in trust anchor | Override the server's Ed25519 trust anchor |
| ❌ | (unset) | Accept messages signed by this key in addition to the primary (key rotation) |
| ❌ |
| Verify server signatures on |
| ❌ |
| Verify server signatures on |
| ❌ |
| When |
Tools
Tool | Purpose |
| Get the configured wallet's public address |
| Build an unsigned swap transaction |
| Submit a manually signed transaction |
| Build + sign + submit in one call |
| Get token holdings for a wallet |
| Market cap and price for a token |
| Trade card PNG URL for wallet + token |
| Limit buy/sell by price or market cap |
| Trailing stop buy/sell |
| TWAP (time-weighted) buy/sell |
| Limit trigger → TWAP execution |
| Trailing trigger → TWAP execution |
| Limit trigger → trailing execution (single swap on trigger) |
| Limit trigger → trailing trigger → TWAP execution |
| List active orders for a wallet |
| Get status of a specific order |
| Cancel an active order |
| Extend an order's expiry |
| Register a wallet over the persistent WebSocket |
| Current WebSocket connection state |
| Log of filled orders |
REST endpoints (under the hood)
Endpoint | Purpose |
| Build unsigned swap (multi-DEX: Raydium, PumpSwap, Orca, Meteora) |
| Submit signed tx via Jito bundle — MEV-protected |
| Wallet scan — catches tokens standard RPC misses |
| Market cap + price |
| Trade card PNG generation |
| Persistent WebSocket for limits / trailing / DCA / TWAP / combo orders |
Trust anchor
The baked-in server public key is EXX3nRzfDUvbjZSmxFzHDdiSYeGVP1EGr77iziFZ4Jd4. Every order_filled, order_created, and twap_execution message from the server is verified with Ed25519 before being treated as authoritative. See SECURITY.md for details and the rotation mechanism (TRADEROUTER_SERVER_PUBKEY_NEXT).
Use with LangChain
Any MCP server works in LangChain via the official adapter:
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"traderouter": {
"command": "npx",
"args": ["-y", "@traderouter/trade-router-mcp"],
"transport": "stdio",
"env": {"TRADEROUTER_PRIVATE_KEY": "<base58>"},
},
})
tools = await client.get_tools()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.
Machine-readable specs (live on traderouter.ai)
URL | Format | Purpose |
OpenAPI 3.1 (JSON) | Canonical API contract — generate SDKs in any language | |
OpenAPI 3.1 (YAML) | Same spec, YAML format (regenerated from the JSON) | |
text | LLM-readable API guide (per llmstxt.org) | |
markdown | Anthropic Agent Skills format — full implementation guide | |
markdown | Threat model + data-flow diagram + permissions manifest (mirrors ./SECURITY.md here) | |
markdown | Unified changelog across the API / MCP server / Site version tracks |
Quick SDK generation:
# TypeScript
openapi-generator-cli generate -i https://traderouter.ai/openapi.yaml -g typescript-axios -o ./sdk-ts
# Python
openapi-generator-cli generate -i https://traderouter.ai/openapi.yaml -g python -o ./sdk-pySecurity disclosure
Email security@traderouter.ai or use GitHub Security Advisories on this repo. 48-hour acknowledgement. See SECURITY.md (or the hosted version if you'd rather link to a stable URL).
License
MIT. See LICENSE.
Changelog
See CHANGELOG.md.
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TradeRouter/trade-router-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server