Skip to main content
Glama
trade-router-mcp

trade-router-mcp

Official
by TradeRouter

@traderouter/trade-router-mcp

TradeRouter.ai 用の Model Context Protocol サーバーです。AIエージェント向けの非カストディアル型Solanaスワップ、指値、トレーリング、DCA、TWAP、およびコンボ注文エンジンを提供します。

Security: non-custodial License: MIT npm Awesome MCP Servers Glama MCP Server MCP Registry

安全性について

はい、安全です。その理由は以下の通りです。 秘密鍵は TRADEROUTER_PRIVATE_KEY から一度だけ読み込まれ、@solana/web3.js + tweetnacl を使用したローカル署名にのみ使用されます。送信、ログ記録、保存は一切行われません。署名済みのトランザクションのみがマシンから送信されます。サーバーメッセージは、ハードコードされた信頼アンカーに対してEd25519で検証されます。完全な脅威モデル、データフロー図、権限マニフェストについては SECURITY.md を参照してください。

署名フロー:

  1. エージェントが build_swap を呼び出す → MCPがウォレットのアドレス(公開鍵)を api.traderouter.ai に送信

  2. APIが署名なしのトランザクションを返す

  3. MCPが TRADEROUTER_PRIVATE_KEY を使用してローカルでトランザクションに署名する

  4. 署名済みトランザクションが /protect (Jito MEV保護バンドル)に送信される

  5. サーバーが確認し、残高の変更を返す。秘密鍵がネットワークを通過することはありません。

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

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Linux

~/.config/Claude/claude_desktop_config.json

環境変数

変数

必須

デフォルト

用途

TRADEROUTER_PRIVATE_KEY

✅

—

Solanaウォレット秘密鍵(base58)。ローカル使用のみ。

SOLANA_RPC_URL

❌

https://api.mainnet-beta.solana.com

読み取り用カスタムRPC

TRADEROUTER_SERVER_PUBKEY

❌

組み込みの信頼アンカー

サーバーのEd25519信頼アンカーを上書き

TRADEROUTER_SERVER_PUBKEY_NEXT

❌

(未設定)

プライマリに加えてこの鍵で署名されたメッセージを受け入れる(鍵のローテーション)

TRADEROUTER_REQUIRE_SERVER_SIGNATURE

❌

true

order_filled / twap_execution でサーバー署名を検証

TRADEROUTER_REQUIRE_ORDER_CREATED_SIGNATURE

❌

true

order_created でサーバー署名を検証

TRADEROUTER_DRY_RUN

❌

false

true の場合、すべての書き込みアクションツール(submit_signed_swap, auto_swap, place_*_order, cancel_order, extend_order)はAPIを呼び出さずに { dry_run: true, tool, args } を返します。読み取り専用ツールは通常通り実行されます。1.0.9で追加。

ツール

ツール

用途

get_wallet_address

設定されたウォレットの公開アドレスを取得

build_swap

署名なしのスワップトランザクションを構築

submit_signed_swap

手動で署名されたトランザクションを送信

auto_swap

構築・署名・送信を1回の呼び出しで実行

get_holdings

ウォレットのトークン保有状況を取得

get_mcap

トークンの時価総額と価格を取得

get_flex_card

ウォレットとトークンのトレードカードPNG URLを取得

place_limit_order

価格または時価総額による指値買い/売り

place_trailing_order

トレーリングストップ買い/売り

place_twap_order

TWAP(時間加重)買い/売り

place_limit_twap_order

指値トリガー → TWAP実行

place_trailing_twap_order

トレーリングトリガー → TWAP実行

place_limit_trailing_order

指値トリガー → トレーリング実行(トリガー時に単一スワップ)

place_limit_trailing_twap_order

指値トリガー → トレーリングトリガー → TWAP実行

list_orders

ウォレットのアクティブな注文を一覧表示

check_order

特定の注文のステータスを取得

cancel_order

アクティブな注文をキャンセル

extend_order

注文の有効期限を延長

connect_websocket

永続的なWebSocket経由でウォレットを登録

connection_status

現在のWebSocket接続状態

get_fill_log

約定済み注文のログ

RESTエンドポイント(内部動作)

エンドポイント

用途

POST /swap

署名なしスワップの構築(マルチDEX: Raydium, PumpSwap, Orca, Meteora)

POST /protect

Jitoバンドル経由で署名済みトランザクションを送信 — MEV保護

POST /holdings

ウォレットスキャン — 標準RPCで見逃されるトークンを捕捉

GET /mcap

時価総額 + 価格

GET /flex

トレードカードPNG生成

wss://api.traderouter.ai/ws

指値 / トレーリング / 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

フォーマット

用途

https://traderouter.ai/openapi.json

OpenAPI 3.1 (JSON)

標準APIコントラクト — あらゆる言語でSDKを生成

https://traderouter.ai/openapi.yaml

OpenAPI 3.1 (YAML)

同仕様、YAMLフォーマット(JSONから再生成)

https://traderouter.ai/llms.txt

text

LLMが読み取り可能なAPIガイド (llmstxt.org 準拠)

https://traderouter.ai/SKILL.md

markdown

Anthropic Agent Skillsフォーマット — 完全な実装ガイド

https://traderouter.ai/SECURITY.md

markdown

脅威モデル + データフロー図 + 権限マニフェスト (ここにある ./SECURITY.md を反映)

https://traderouter.ai/CHANGELOG.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 tools
auto_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

    B3.2/5.0

    Scored across 21 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers