loading…
Search for a command to run...
loading…
Exposes Musashi market intelligence as MCP tools for clients like Claude and ChatGPT, enabling text analysis, arbitrage detection, market movers, wallet activit
Exposes Musashi market intelligence as MCP tools for clients like Claude and ChatGPT, enabling text analysis, arbitrage detection, market movers, wallet activity, and smart money tracking.
musashi-mcp exposes Musashi market intelligence as MCP tools for clients such as Claude and ChatGPT.
It connects to musashi-api and makes these capabilities available over MCP:
analyze_textget_arbitrageget_moversground_probabilityget_feedget_feed_statsget_feed_accountsget_wallet_activityget_wallet_positionsget_market_wallet_flowget_smart_money_marketsget_market_briefexplain_market_moveget_healthWallet and market context tool status:
get_wallet_activity, get_wallet_positions, get_market_wallet_flow, and get_smart_money_markets are backed by musashi-api endpoints.get_market_brief and explain_market_move compose existing musashi-api primitives without direct market-source calls.Production MCP endpoint:
https://musashi-production.up.railway.app/mcp
OAuth discovery endpoint:
https://musashi-production.up.railway.app/.well-known/oauth-authorization-server
OAuth dynamic client registration endpoint:
https://musashi-production.up.railway.app/oauth/register
To authorize access, the server expects a valid mcp_sk_... key from MCP_API_KEYS or MUSASHI_MCP_API_KEY.
If your Claude account supports custom MCP connectors:
https://musashi-production.up.railway.app/mcp
OAuth if prompted.mcp_sk_... key.If ChatGPT Apps or Developer Mode is enabled for your account:
Settings -> Apps.MCP Server URL to:https://musashi-production.up.railway.app/mcp
OAuth.mcp_sk_... key.If the connection succeeds, ChatGPT should be able to discover and call Musashi tools from chat.
Once the app is connected, these are good smoke tests:
Use the Musashi app to get health status.Use the Musashi app to get feed statistics.Use the Musashi app to list tracked feed accounts.Use the Musashi app to show market movers with a minimum change of 0.03.Use the Musashi app to analyze this text: Bitcoin will be above 150k by the end of 2026.Use the Musashi app to show wallet activity for 0x...Use the Musashi app to show open positions for 0x...Use the Musashi app to explain wallet flow for this market: ...Use the Musashi app to find smart money markets in crypto.Use the Musashi app to get a market brief for BTC 100k.Use the Musashi app to explain why this market moved: BTC 100k.>=18pnpmmusashi-api instanceInstall dependencies:
pnpm install
pnpm build: compile the server to dist/pnpm dev: run stdio transport locallypnpm dev:http: run the streamable HTTP transport locallypnpm test: build the server and run local smoke testspnpm start: run the compiled stdio server from dist/pnpm start:http: run the compiled HTTP server from dist/pnpm watch: run TypeScript in watch modepnpm clean: remove dist/MUSASHI_API_BASE_URL: Musashi API base URLPORT: HTTP port when running with --transport=httpMUSASHI_MCP_PUBLIC_BASE_URL: optional public MCP server base URL for OAuth metadataMUSASHI_MCP_API_KEY: optional single valid MCP API keyMCP_API_KEYS: optional comma-separated list of valid MCP API keysMCP_OAUTH_TOKEN_SECRET: required in production — secret for signing OAuth access tokens; without it, a random secret is generated at startup and all tokens are invalidated on every server restartUPSTASH_REDIS_REST_URL: required in production — Upstash Redis REST URL for shared OAuth stateUPSTASH_REDIS_REST_TOKEN: required in production — Upstash Redis REST tokenMCP_RATE_LIMIT_PER_MINUTE: message rate limit per authenticated principal (default: 60)MCP_RATE_LIMIT_PER_HOUR: hourly backstop per authenticated principal (default: 1000)Production requirements (HTTP transport, Railway or NODE_ENV=production):
UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN, and MCP_OAUTH_TOKEN_SECRET must all be set or the server exits with code 1 at startup. Without shared KV, registered OAuth clients and auth codes are process-local and lost on every restart, breaking GPT/Claude reconnects.
Token lifecycle:
Example local values:
MUSASHI_API_BASE_URL=http://127.0.0.1:3000
PORT=3030
MUSASHI_MCP_PUBLIC_BASE_URL=https://your-mcp-server.example.com
MUSASHI_MCP_API_KEY=mcp_sk_your_key_here
For local wallet tools, MUSASHI_API_BASE_URL must point at a musashi-api server that has /api/wallet/activity and /api/wallet/positions available.
MUSASHI_API_BASE_URL=http://127.0.0.1:3000 pnpm dev
Use this when your MCP client launches the server process directly.
MUSASHI_API_BASE_URL=http://127.0.0.1:3000 PORT=3030 pnpm dev:http
Useful local endpoints:
GET /healthGET /.well-known/oauth-authorization-serverGET /oauth/authorizePOST /oauth/authorizePOST /oauth/tokenPOST /mcpGET /mcpDELETE /mcpBuild:
pnpm build
Smoke tests:
pnpm test
Manual health check:
curl http://127.0.0.1:3030/health
Manual OAuth discovery check:
curl http://127.0.0.1:3030/.well-known/oauth-authorization-server
Manual OAuth verification:
BASE=http://127.0.0.1:3030
# 1. Register a public client
CLIENT_JSON=$(curl -s -X POST "${BASE}/oauth/register" \
-H 'Content-Type: application/json' \
-d '{"redirect_uris":["http://127.0.0.1/callback"]}')
CLIENT_ID=$(node -e "console.log(JSON.parse(process.argv[1]).client_id)" -- "${CLIENT_JSON}")
# 2. Generate a PKCE S256 verifier and challenge
VERIFIER=$(node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))")
CHALLENGE=$(node -e \
"const c=require('crypto');process.stdout.write(c.createHash('sha256').update(process.argv[1]).digest('base64url'))" \
-- "${VERIFIER}")
# 3. Open the authorization URL in a browser and submit a valid mcp_sk_... key
# code_challenge_method is S256 by default and may be omitted
echo "${BASE}/oauth/authorize?client_id=${CLIENT_ID}&redirect_uri=http://127.0.0.1/callback&state=test-state&code_challenge=${CHALLENGE}"
# 4. After submitting the key, the browser redirects to:
# http://127.0.0.1/callback?code=AUTH_CODE&state=test-state
# Copy the code value from the URL, then run:
read -rp "Paste auth code: " AUTH_CODE
curl -s -X POST "${BASE}/oauth/token" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d "grant_type=authorization_code&code=${AUTH_CODE}&client_id=${CLIENT_ID}&redirect_uri=http://127.0.0.1/callback&code_verifier=${VERIFIER}"
S256 is supported. All clients are public (token_endpoint_auth_method: none) and must provide code_challenge; omitting it returns a 400 invalid_request. code_challenge_method may be omitted (defaults to S256) or set to S256 explicitly; any other value is rejected. client_secret_post is not supported.UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN). Without it, registered OAuth clients and auth codes are per-process and lost on every restart. The in-memory store is for local development only.MCP_OAUTH_TOKEN_SECRET to a stable value in production. Without it, all OAuth tokens are invalidated on every server restart.pnpm test is a smoke suite, not a full MCP interoperability suite.musashi-api.Выполни в терминале:
claude mcp add musashi-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.