On-chain data intelligence for AI agents. Access token analytics, market trends, wallet profiling, and compliance screening across Solana, BSC, and Ethereum.
https://mcp.chainstream.io/mcp (streamable-http, 17 tools)npx @chainstream-io/cli@chainstream-io/sdkhttps://api.chainstream.ioAgent runtime decision tree — choose based on environment and operation type:
MCP tools registered? (Cursor/Claude Desktop/VS Code already configured ChainStream MCP)
→ YES → Use MCP tools for data queries ( tokens_search, wallets_profile, etc.)
→ NO → Use CLI for all operations ( npx @chainstream-io/cli ...)
Need DeFi operation? (swap, create token, sign transaction) → YES → Must use CLI (MCP has no wallet signing capability) → NO → Continue with MCP (or CLI if MCP unavailable)
MCP call failed? → Fall back to CLI as backup
Before anything else (CLI path), ensure user is authenticated:
npx @chainstream-io/cli config auth — check login statusnpx @chainstream-io/cli login (creates EVM + Solana wallet, auto-grants nano trial plan: 50K CU free, 30 days — no purchase needed)New users get a free trial on login (50K CU). For details on trial plans and upgrade options, see shared/authentication.md.
Then check subscription: npx @chainstream-io/cli plan status
active: true → proceed with data queriesGetting an API Key (required for all paths):
npx @chainstream-io/cli plan purchase --plan <PLAN> --json → x402 purchase (real USDC payment via EIP-3009 signature). Run wallet pricing --json first, present ALL plans, let user choosetempo request "https://api.chainstream.io/mpp/purchase?plan=<PLAN>" → MPP payment → API Key auto-returned (fetch /mpp/pricing first, let user choose plan)⚠️ Purchase flow (x402):
0. config auth — ensure user is logged in. If not: login first (auto-grants nano trial — may be sufficient, check plan status before proceeding to purchase)
plan status --json — check if subscription already exists (login auto-grants nano trial, so new users likely already have one)active: true and quota sufficient → no purchase needed, proceed with data querieswallet pricing --json — present ALL plans, let user choose. NEVER auto-select a plan.wallet balance --chain base --json (and/or --chain sol) — check where user has USDCconfig set --key walletChain --value sol (default is base)plan purchase --plan <USER_CHOSEN> --json — x402 purchase (real USDC payment). API Key auto-saved to config⚠️ Quota is CU, NOT call count: Plan quota is measured in Compute Units (CU), not API call count. Each API endpoint costs a different amount of CU per call (varies by endpoint complexity and response size). When presenting plans to the user, always use "CU" as the unit — NEVER say "calls" or "requests".
Channel matrix:
OperationMCP (when registered)CLISDKSearch tokenstokens_search``token search``client.token.searchAnalyze tokentokens_analyze``token info``client.token.getTokenPrice historytokens_price_history``token candles``client.token.getCandlesWallet profilewallets_profile``wallet profile``client.wallet.*Market trendingmarket_trending``market trending``client.ranking.*DEX quotedex_quote``dex route``client.dex.routeDEX swap_(no signing)dex swap``client.dex.swap + signCreate token(no signing)_dex create``client.dex.createToken
Add to your MCP client configuration (Cursor, Claude Desktop, VS Code):
json
{
"mcpServers": {
"chainstream": {
"url": "https://mcp.chainstream.io/mcp",
"headers": { "X-API-KEY": "<your-api-key>" }
}
}
}
bash
# Option A: Use API Key (recommended — works with all agent wallets)
npx @chainstream-io/cli config set --key apiKey --value <your-api-key>
# Option B: Create ChainStream Wallet (for DeFi + auto x402 payment)
npx @chainstream-io/cli login
# Option C: Import existing key (dev/testing)
npx @chainstream-io/cli wallet set-raw --chain base # EVM (Base) key
npx @chainstream-io/cli wallet set-raw --chain sol # Solana key
npm install @chainstream-io/sdk — see shared/authentication.md Path 2 for WalletSigner integration.
IntentCLI CommandMCP ToolReferenceSearch tokensnpx @chainstream-io/cli token search --keyword X --chain sol``tokens_searchtoken-research.mdToken detailnpx @chainstream-io/cli token info --chain sol --address ADDR``tokens_analyzetoken-research.mdSecurity checknpx @chainstream-io/cli token security --chain sol --address ADDR``tokens_analyzetoken-research.mdTop holdersnpx @chainstream-io/cli token holders --chain sol --address ADDR``tokens_analyzetoken-research.mdK-line / OHLCVnpx @chainstream-io/cli token candles --chain sol --address ADDR --resolution 1h``tokens_price_historytoken-research.mdLiquidity poolsnpx @chainstream-io/cli token pools --chain sol --address ADDR``tokens_discovertoken-research.md
IntentCLI CommandMCP ToolReferenceHot/trending tokensnpx @chainstream-io/cli market trending --chain sol --duration 1h``market_trendingmarket-discovery.mdNew token listingsnpx @chainstream-io/cli market new --chain sol``market_trendingmarket-discovery.mdRecent tradesnpx @chainstream-io/cli market trades --chain sol``trades_recentmarket-discovery.md
IntentCLI CommandMCP ToolReferenceWallet profile (PnL + holdings)npx @chainstream-io/cli wallet profile --chain sol --address ADDR``wallets_profilewallet-profiling.mdPnL detailsnpx @chainstream-io/cli wallet pnl --chain sol --address ADDR``wallets_profilewallet-profiling.mdToken balancesnpx @chainstream-io/cli wallet holdings --chain sol --address ADDR``wallets_profilewallet-profiling.mdTransfer historynpx @chainstream-io/cli wallet activity --chain sol --address ADDR``wallets_activitywallet-profiling.mdOwn wallet balance (base/sol)npx @chainstream-io/cli wallet balance --chain sol—Supports sol and base (note: base is a payment chain, not a data chain)
IntentCLI CommandMCP ToolReferenceCheck current subscriptionnpx @chainstream-io/cli plan status—x402-payment.mdCheck subscription (explicit)npx @chainstream-io/cli plan status --chain evm --address ADDR—x402-payment.mdView available plansnpx @chainstream-io/cli wallet pricing—x402-payment.mdPurchase plan (non-interactive)npx @chainstream-io/cli plan purchase --plan <NAME> --json—x402-payment.mdCheck subscription (API)curl "https://api.chainstream.io/x402/status?chain=evm&address=ADDR"—x402-payment.md
bash
npx @chainstream-io/cli login # Auth (one-time)
npx @chainstream-io/cli token search --keyword PUMP --chain sol # Search tokens
npx @chainstream-io/cli token info --chain sol --address <addr> --json # Token detail (single-line JSON for piping)
All commands from the Endpoint Selector tables above work after login. Append --json for machine-readable output.
Default limit: All list queries ( token search, token holders, token candles, market trending, market new, market trades, wallet holdings, wallet activity) default to 5 results. Pass --limit <n> to override (e.g. --limit 20).
text
npx @chainstream-io/cli token search → npx @chainstream-io/cli token info → npx @chainstream-io/cli token security
→ npx @chainstream-io/cli token holders → npx @chainstream-io/cli token candles
Before recommending any token, always run token security — ChainStream's risk model covers honeypot, rug pull, mint authority, freeze authority, and holder concentration.
MANDATORY - READ: Before executing this workflow, load references/market-discovery.md for the multi-factor signal weight table and output format.
text
npx @chainstream-io/cli market trending (top 50)
→ AI multi-factor analysis (smart money, volume, momentum, safety)
→ npx @chainstream-io/cli token security (top 5 candidates)
→ Present results to user
→ If user wants to trade → load chainstream-defi skill
Do NOT load wallet-profiling.md for this workflow.
MANDATORY - READ: Load references/wallet-profiling.md for PnL interpretation and behavior patterns.
text
npx @chainstream-io/cli wallet profile → npx @chainstream-io/cli wallet activity
→ npx @chainstream-io/cli token info (on top holdings)
→ Assess: win rate, concentration, holding behavior
token security before recommending a token — ChainStream's risk model covers honeypot, rug pull, and concentration signals that generic analysis missesformat: "detailed" to MCP tools unless user explicitly requests it — returns 4-10x more tokens than default concise, wastes context window/multi endpoints — API hard limit--limit on list queries — CLI defaults to 5 results to prevent context overflow. If the user needs more, pass --limit <n> explicitly (e.g. --limit 20)config auth → login (if needed) → plan status first. New users get a free nano trial on login; only run plan purchase if the trial is exhausted or absentErrorMeaningRecovery"Not authenticated" / 401 / 402Not logged in, no API Key, or no active subscriptionFollow the 401/402 sequence below429Rate limitWait 1s, exponential backoff5xxServer errorRetry once after 2s
On 401/402, follow this exact sequence:
npx @chainstream-io/cli config auth — if not logged in, run npx @chainstream-io/cli login (creates wallet + auto-grants nano trial with 50K CU free). After login, retry the failed command — it will likely succeed nownpx @chainstream-io/cli plan status — if active: true with remaining quota, the issue is likely a transient auth error; retryconfig set --key apiKey --value <key> and retry; if no, run npx @chainstream-io/cli wallet pricing, present ALL plans to the user, let them choose, then load shared/x402-payment.md for the purchase flow. NEVER auto-select a plan. NEVER try to pipe input to interactive CLI prompts.ReferenceContentWhen to Loadtoken-research.md25+ token endpoints, batch queries, security field meaningsToken analysis tasksmarket-discovery.mdRanking/trade endpoints, multi-factor discovery workflowHot token discoverywallet-profiling.md15+ wallet endpoints, PnL logic, behavior patternsWallet analysiswebsocket-streams.mdChannels, subscription format, heartbeatReal-time streaming