trade-router-mcp
Official@traderouter/trade-router-mcp
Ein Model Context Protocol-Server für TradeRouter.ai – eine nicht-verwahrte Solana-Engine für Swaps, Limits, Trailing, DCA, TWAP und Kombi-Orders für KI-Agenten.
Ist das sicher?
Ja, und hier ist der genaue Grund. Der private Schlüssel wird einmal von TRADEROUTER_PRIVATE_KEY gelesen, für lokales Signieren mit @solana/web3.js + tweetnacl verwendet und niemals übertragen, protokolliert oder gespeichert. Nur signierte Transaktionen verlassen Ihren Rechner. Server-Nachrichten werden mittels Ed25519 gegen einen fest kodierten Vertrauensanker verifiziert. Siehe SECURITY.md für das vollständige Bedrohungsmodell, das Datenflussdiagramm und das Berechtigungsmanifest.
Signier-Ablauf:
Der Agent ruft
build_swapauf → MCP sendet die Wallet-Adresse (Public Key) an api.traderouter.aiDie API gibt eine unsignierte Transaktion zurück
MCP signiert die Transaktion lokal unter Verwendung von
TRADEROUTER_PRIVATE_KEYDie signierte Transaktion wird an
/protectübermittelt (Jito MEV-geschütztes Bundle)Der Server bestätigt und gibt die Saldoänderungen zurück. Der private Schlüssel verlässt niemals das Netzwerk.
Related MCP server: RefundYourSOL
Anforderungen
Node.js ≥ 18
Ein privater Schlüssel für eine Solana-Wallet im Base58-Format (verwenden Sie eine dedizierte Trading-Wallet, nicht Ihre Hauptbestände)
Installation
npx -y @traderouter/trade-router-mcpOder binden Sie es in einen MCP-Client ein (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 Konfigurationspfad |
macOS |
|
Windows |
|
Linux |
|
Umgebungsvariablen
Variable | Erforderlich | Standard | Zweck |
| ✅ | — | Privater Schlüssel der Solana-Wallet (base58). Nur lokale Verwendung. |
| ❌ |
| Benutzerdefinierte RPC für Lesezugriffe |
| ❌ | fest kodierter Vertrauensanker | Überschreiben des Ed25519-Vertrauensankers des Servers |
| ❌ | (nicht gesetzt) | Akzeptiere Nachrichten, die zusätzlich zum primären Schlüssel mit diesem Schlüssel signiert wurden (Key-Rotation) |
| ❌ |
| Verifiziere Server-Signaturen bei |
| ❌ |
| Verifiziere Server-Signaturen bei |
| ❌ |
| Wenn |
Tools
Tool | Zweck |
| Abrufen der konfigurierten öffentlichen Wallet-Adresse |
| Erstellen einer unsignierten Swap-Transaktion |
| Übermitteln einer manuell signierten Transaktion |
| Erstellen + Signieren + Übermitteln in einem Aufruf |
| Abrufen der Token-Bestände einer Wallet |
| Marktkapitalisierung und Preis für einen Token |
| Trade-Card PNG-URL für Wallet + Token |
| Limit-Kauf/-Verkauf nach Preis oder Marktkapitalisierung |
| Trailing-Stop-Kauf/-Verkauf |
| TWAP (zeitgewichteter) Kauf/-Verkauf |
| Limit-Trigger → TWAP-Ausführung |
| Trailing-Trigger → TWAP-Ausführung |
| Limit-Trigger → Trailing-Ausführung (einzelner Swap bei Trigger) |
| Limit-Trigger → Trailing-Trigger → TWAP-Ausführung |
| Auflisten aktiver Orders für eine Wallet |
| Status einer spezifischen Order abrufen |
| Stornieren einer aktiven Order |
| Verlängern der Ablaufzeit einer Order |
| Registrieren einer Wallet über das persistente WebSocket |
| Aktueller WebSocket-Verbindungsstatus |
| Protokoll ausgeführter Orders |
REST-Endpunkte (unter der Haube)
Endpunkt | Zweck |
| Erstellen eines unsignierten Swaps (Multi-DEX: Raydium, PumpSwap, Orca, Meteora) |
| Übermitteln einer signierten Transaktion via Jito-Bundle — MEV-geschützt |
| Wallet-Scan — erkennt Token, die Standard-RPCs übersehen |
| Marktkapitalisierung + Preis |
| Trade-Card PNG-Generierung |
| Persistentes WebSocket für Limits / Trailing / DCA / TWAP / Kombi-Orders |
Vertrauensanker
Der fest kodierte öffentliche Server-Schlüssel lautet EXX3nRzfDUvbjZSmxFzHDdiSYeGVP1EGr77iziFZ4Jd4. Jede order_filled-, order_created- und twap_execution-Nachricht vom Server wird mittels Ed25519 verifiziert, bevor sie als autoritativ behandelt wird. Siehe SECURITY.md für Details und den Rotationsmechanismus (TRADEROUTER_SERVER_PUBKEY_NEXT).
Verwendung mit LangChain
Jeder MCP-Server funktioniert in LangChain über den offiziellen 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()Gebühren
Eine pauschale Gebühr von 1 % auf das Swap-Volumen, eingebettet in das Routing unter /protect. Kein Abonnement, kein API-Schlüssel, keine monatlichen Mindestgebühren. Nur-Lese-Endpunkte (/holdings, /mcap) sind kostenlos.
Maschinenlesbare Spezifikationen (live auf traderouter.ai)
URL | Format | Zweck |
OpenAPI 3.1 (JSON) | Kanonischer API-Vertrag — SDKs in jeder Sprache generieren | |
OpenAPI 3.1 (YAML) | Gleiche Spezifikation, YAML-Format (aus dem JSON neu generiert) | |
Text | LLM-lesbarer API-Leitfaden (gemäß llmstxt.org) | |
Markdown | Anthropic Agent Skills Format — vollständiger Implementierungsleitfaden | |
Markdown | Bedrohungsmodell + Datenflussdiagramm + Berechtigungsmanifest (spiegelt ./SECURITY.md hier wider) | |
Markdown | Vereinheitlichtes Changelog über API / MCP-Server / Site-Version-Tracks |
Schnelle SDK-Generierung:
# 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-pySicherheits-Offenlegung
Senden Sie eine E-Mail an security@traderouter.ai oder nutzen Sie GitHub Security Advisories in diesem Repository. Bestätigung innerhalb von 48 Stunden. Siehe SECURITY.md (oder die gehostete Version, falls Sie lieber auf eine stabile URL verlinken möchten).
Lizenz
MIT. Siehe LICENSE.
Changelog
Siehe CHANGELOG.md.
Available Tools
21 toolsauto_swapB
Build + sign + submit in one step. Requires TRADEROUTER_PRIVATE_KEY.
Inputs: wallet_address (required), token_address (required), action (required), amount, +2 more.
build_swapA
Build an unsigned Solana swap tx via REST. Returns base58 swap_tx. Pass to submit_signed_swap or use auto_swap.
Inputs: wallet_address (required), token_address (required), action (required), amount, +2 more.
cancel_orderC
Cancel an active limit or trailing order.
Inputs: wallet_address (required), order_id (required).
check_orderB
Check the status of a specific order by order_id.
Inputs: wallet_address (required), order_id (required).
connection_statusC
Return live WS connection state for a wallet.
Inputs: wallet_address (required).
connect_websocketA
Connect WS for a wallet and wait until registered (up to 25s). Call before placing orders.
Inputs: wallet_address (required).
extend_orderC
Extend an order's expiry. expiry_hours is the new total (1–336).
Inputs: wallet_address (required), order_id (required), expiry_hours (required).
get_fill_logC
Return all order_filled events received since process start (capped at 200).
Inputs: wallet_address (required).
get_flex_cardC
Get the URL for a flex trade card PNG for a wallet and token. GET /flex. Returns the URL to display the image.
Inputs: wallet_address (required), token_address (required).
get_holdingsA
Scan SPL token holdings for a Solana wallet. Slow — up to 100s.
Inputs: wallet_address (required).
get_mcapA
Get market cap (and price/pool) data for one or more token addresses. GET /mcap.
Inputs: tokens (required).
get_wallet_addressA
Derive the Solana wallet address from TRADEROUTER_PRIVATE_KEY. Call first at session start — also starts WebSocket connection.
Inputs: no named parameters.
list_ordersC
List all active limit/trailing orders for a wallet.
Inputs: wallet_address (required).
place_limit_orderC
Place a market-cap-based limit order over WS. action: sell|buy. target: bps vs current mcap at placement.
Inputs: wallet_address (required), token_address (required), action (required), target (required), +4 more.
place_limit_trailing_orderC
Place a limit-then-trailing order. Wait for limit, then trailing phase; when trail triggers, single swap. action: limit_trailing_sell|limit_trailing_buy.
Inputs: wallet_address (required), token_address (required), action (required), target (required), +5 more.
place_limit_trailing_twap_orderB
Place a limit-then-trailing-then-TWAP order. Limit → trail → on trail trigger, execute via TWAP. action: limit_trailing_twap_sell|limit_trailing_twap_buy.
Inputs: wallet_address (required), token_address (required), action (required), target (required), +7 more.
place_limit_twap_orderB
Place a limit-then-TWAP order. Wait for limit target (bps), then execute via TWAP. action: limit_twap_sell|limit_twap_buy.
Inputs: wallet_address (required), token_address (required), action (required), target (required), +6 more.
place_trailing_orderC
Place a trailing stop or trailing buy over WS. action: trailing_sell|trailing_buy. trail: bps distance.
Inputs: wallet_address (required), token_address (required), action (required), trail (required), +4 more.
place_trailing_twap_orderB
Place a trailing-then-TWAP order. When trail triggers, execute via TWAP. action: trailing_twap_sell|trailing_twap_buy.
Inputs: wallet_address (required), token_address (required), action (required), trail (required), +6 more.
place_twap_orderC
Place a TWAP (time-weighted) buy or sell order. Splits total amount into frequency slices over duration seconds. action: twap_buy|twap_sell.
Inputs: wallet_address (required), token_address (required), action (required), frequency (required), +4 more.
submit_signed_swapB
Submit a base64-encoded signed Solana transaction via MEV-protected lane.
Inputs: signed_tx_base64 (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools target distinct actions (swap, order types, connection, data). However, the variety of order placement tools (limit, trailing, TWAP, and composite types) could cause minor confusion, though their descriptions differentiate them.
Tools follow a consistent verb_noun pattern in snake_case (e.g., cancel_order, get_holdings). Minor inconsistencies like 'connection_status' vs 'connect_websocket' and 'auto_swap' using an adverb instead of a verb are present but not disruptive.
21 tools is slightly high but justified by the server's breadth (swap, multiple order types, connection, data). Each tool serves a specific purpose, though some consolidation could reduce the count.
Covers core trading lifecycle: swaps, order placement/cancellation/check, connection setup, and data queries. Missing: historical trade log beyond in-memory events and token price discovery (only market cap), but these are minor gaps for the intended use.
Maintenance
Related MCP Connectors
Non-custodial DeFi tools for AI agents on Solana: swaps, perps, lending, staking, equities.
Safe Solana swaps for AI agents with risk checks, unsigned transactions, x402, and 3-bp fees.
Native Solana staking for AI agents. 26 MCP tools, one-shot signing, webhooks.
Non-custodial DEX aggregator for autonomous AI agents: best-price swaps on 8 chains, no API key.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI agents to interact with cryptocurrency ecosystems through wallet management, trading operations (swaps, DCA, limit orders), staking, and multi-chain support starting with Solana.37GPL 3.0
- AlicenseAqualityDmaintenanceSolana wallet cleanup, token trading on 12+ DEXes, and market data. Scan wallets for reclaimable SOL, close empty token accounts, burn dust tokens, buy/sell with Jito MEV protection. 7 tools for AI agents.411 npmMIT
- AlicenseAqualityBmaintenanceDeFi execution and agent-to-agent economy tools for AI agents — swaps, yield, transfers, policy enforcement, trust scoring, A2A jobs, and P\&L across Ethereum, Base, Arbitrum, and Polygon.311Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI agents to read chain data, execute transactions, swap tokens, and manage wallets on Solana through 38 tools across 7 modules. Supports write operations with a private key and includes built-in prompts for common workflows.381MIT