@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.ai - API returns an unsigned transaction
- MCP signs the tx locally using
TRADEROUTER_PRIVATE_KEY - The 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)






