trade-router-mcp
Official@traderouter/trade-router-mcp
TradeRouter.ai 用の Model Context Protocol サーバーです。AIエージェント向けの非カストディアル型Solanaスワップ、指値、トレーリング、DCA、TWAP、およびコンボ注文エンジンを提供します。
安全性について
はい、安全です。その理由は以下の通りです。 秘密鍵は TRADEROUTER_PRIVATE_KEY から一度だけ読み込まれ、@solana/web3.js + tweetnacl を使用したローカル署名にのみ使用されます。送信、ログ記録、保存は一切行われません。署名済みのトランザクションのみがマシンから送信されます。サーバーメッセージは、ハードコードされた信頼アンカーに対してEd25519で検証されます。完全な脅威モデル、データフロー図、権限マニフェストについては SECURITY.md を参照してください。
署名フロー:
エージェントが
build_swapを呼び出す → MCPがウォレットのアドレス(公開鍵)を api.traderouter.ai に送信APIが署名なしのトランザクションを返す
MCPが
TRADEROUTER_PRIVATE_KEYを使用してローカルでトランザクションに署名する署名済みトランザクションが
/protect(Jito MEV保護バンドル)に送信されるサーバーが確認し、残高の変更を返す。秘密鍵がネットワークを通過することはありません。
Related MCP server: RefundYourSOL
要件
Node.js ≥ 18
base58形式のSolanaウォレット秘密鍵(メインの資産用ではなく、取引専用のウォレットを使用してください)
インストール
npx -y @traderouter/trade-router-mcpまたは、MCPクライアント(Claude Desktop、Cursor、Clineなど)に組み込みます:
{
"mcpServers": {
"traderouter": {
"command": "npx",
"args": ["-y", "@traderouter/trade-router-mcp"],
"env": {
"TRADEROUTER_PRIVATE_KEY": "your_base58_private_key"
}
}
}
}OS | Claude Desktop 設定パス |
macOS |
|
Windows |
|
Linux |
|
環境変数
変数 | 必須 | デフォルト | 用途 |
| ✅ | — | Solanaウォレット秘密鍵(base58)。ローカル使用のみ。 |
| ❌ |
| 読み取り用カスタムRPC |
| ❌ | 組み込みの信頼アンカー | サーバーのEd25519信頼アンカーを上書き |
| ❌ | (未設定) | プライマリに加えてこの鍵で署名されたメッセージを受け入れる(鍵のローテーション) |
| ❌ |
|
|
| ❌ |
|
|
| ❌ |
|
|
ツール
ツール | 用途 |
| 設定されたウォレットの公開アドレスを取得 |
| 署名なしのスワップトランザクションを構築 |
| 手動で署名されたトランザクションを送信 |
| 構築・署名・送信を1回の呼び出しで実行 |
| ウォレットのトークン保有状況を取得 |
| トークンの時価総額と価格を取得 |
| ウォレットとトークンのトレードカードPNG URLを取得 |
| 価格または時価総額による指値買い/売り |
| トレーリングストップ買い/売り |
| TWAP(時間加重)買い/売り |
| 指値トリガー → TWAP実行 |
| トレーリングトリガー → TWAP実行 |
| 指値トリガー → トレーリング実行(トリガー時に単一スワップ) |
| 指値トリガー → トレーリングトリガー → TWAP実行 |
| ウォレットのアクティブな注文を一覧表示 |
| 特定の注文のステータスを取得 |
| アクティブな注文をキャンセル |
| 注文の有効期限を延長 |
| 永続的なWebSocket経由でウォレットを登録 |
| 現在のWebSocket接続状態 |
| 約定済み注文のログ |
RESTエンドポイント(内部動作)
エンドポイント | 用途 |
| 署名なしスワップの構築(マルチDEX: Raydium, PumpSwap, Orca, Meteora) |
| Jitoバンドル経由で署名済みトランザクションを送信 — MEV保護 |
| ウォレットスキャン — 標準RPCで見逃されるトークンを捕捉 |
| 時価総額 + 価格 |
| トレードカードPNG生成 |
| 指値 / トレーリング / DCA / TWAP / コンボ注文用の永続的WebSocket |
信頼アンカー
組み込みのサーバー公開鍵は EXX3nRzfDUvbjZSmxFzHDdiSYeGVP1EGr77iziFZ4Jd4 です。サーバーからのすべての order_filled、order_created、twap_execution メッセージは、信頼できるものとして扱われる前にEd25519で検証されます。詳細およびローテーションメカニズム(TRADEROUTER_SERVER_PUBKEY_NEXT)については SECURITY.md を参照してください。
LangChainでの使用
MCPサーバーは、公式アダプターを介してLangChainで使用できます:
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()手数料
スワップボリュームに対して一律 1%の手数料 がかかり、/protect でのルーティングに組み込まれています。サブスクリプションやAPIキー、月額最低料金はありません。読み取り専用エンドポイント(/holdings, /mcap)は無料です。
機械可読仕様(traderouter.aiで公開中)
URL | フォーマット | 用途 |
OpenAPI 3.1 (JSON) | 標準APIコントラクト — あらゆる言語でSDKを生成 | |
OpenAPI 3.1 (YAML) | 同仕様、YAMLフォーマット(JSONから再生成) | |
text | LLMが読み取り可能なAPIガイド (llmstxt.org 準拠) | |
markdown | Anthropic Agent Skillsフォーマット — 完全な実装ガイド | |
markdown | 脅威モデル + データフロー図 + 権限マニフェスト (ここにある ./SECURITY.md を反映) | |
markdown | API / MCPサーバー / サイトバージョン間で統一された変更履歴 |
SDKのクイック生成:
# 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-pyセキュリティ開示
security@traderouter.ai までメールを送るか、このリポジトリのGitHub Security Advisoriesを使用してください。48時間以内に確認の連絡を差し上げます。SECURITY.md(または安定したURLへのリンクを希望する場合は ホスト版)を参照してください。
ライセンス
MIT。LICENSE を参照してください。
変更履歴
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