Package Exports
- @blockrun/mcp
- @blockrun/mcp/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@blockrun/mcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
BlockRun MCP
Real-time data โ and real trades โ for Claude. Markets, research, web search, crypto; read the odds and place the bet on Polymarket. No API keys. Pay per call.
claude mcp add blockrun -s user -- npx -y @blockrun/mcp@latestWallet auto-created. Fund with $5 USDC. Ask Claude anything.
๐ First of its kind โ the signal โ trade loop in Claude Code. Read live Polymarket odds and place USDC-settled bets, from one self-custody wallet, pay-per-call. Jump to Polymarket trading โ
Documentation
Full docs: https://blockrun.ai/docs
- MCP tools & setup: https://blockrun.ai/docs/mcp/blockrun-mcp
- All BlockRun SDKs & APIs: https://blockrun.ai/docs
What changes
Before BlockRun, Claude can't answer:
- "What's the current Polymarket probability that Bitcoin hits $100k this year?"
- "Find me the top 5 papers on RAG published in the last 30 days"
- "What are people saying about @sama on X right now?"
- "What's the 24h volume on the PEPE/ETH pair on Uniswap?"
- "Polymarket has the Fed holding at 73% โ put $2 on it." โ and now it can place the trade, not just read the odds.
After BlockRun, it can. Each query costs fractions of a cent, billed from a local USDC wallet. No subscriptions. No API dashboards. No key rotation.
Demo
User: What's Polymarket saying about the Fed rate decision next month?
Claude: According to Polymarket, the market currently puts a 73% probability on the Fed holding rates steady at the May meeting, with 24% on a 25bp cut and 3% on a hike. Volume over the last 24h: $2.1M. The "Hold" contract last traded at $0.73.
(via
blockrun_marketsยท cost: $0.001)
User: Find recent papers on speculative decoding and summarize the key approaches
Claude: I found 8 papers from the last 60 days via neural search. The dominant approaches are: (1) draft model selection โ smaller models predicting N tokens ahead for the larger model to verify in parallel...
(via
blockrun_exaยท cost: $0.01)
User: Polymarket has Hawley at ~13% to announce a 2026 presidential run โ put $1 on Yes.
Claude: Done โ bought 7.63 shares of Yes at $0.131 ($1.00, market FOK). Real on-chain order, settled in pUSD from your gasless Polymarket deposit wallet; I'm tracking the position now.
(signal via
blockrun_markets, trade viablockrun_polymarketโ one self-custody wallet, gasless ยท on-chain tx0x7ca8โฆ)
Showcase
Posters generated through blockrun_image with openai/gpt-image-2. Each is a single API call routed through BlockRun, paid in USDC on Base.
Latest โ GPT-5.5 now live on BlockRun
Gallery
![]() |
![]() |
![]() |
| Cornell Blockchain Conference 2026 โ packed booth recap | Cornell Blockchain Conference 2026 โ quiet variant | 100 Trillion Tokens โ milestone synthwave poster |
Prompts and a worked example for these are in skills/image-prompting/SKILL.md.
Prerequisites
- Node.js โฅ 20.19 (
node -v) - ~$5 USDC on Base or Solana (the server auto-creates a wallet on first run; see Fund your wallet)
- An MCP client: Claude Code, Claude Desktop, Cursor, Windsurf, or ChatGPT Desktop
Install
Claude Code (recommended)
claude mcp add blockrun -s user -- npx -y @blockrun/mcp@latestThe -s user flag installs globally (available in every project). The -- separator
ensures -y is passed to npx, not parsed by claude mcp add.
๐ก Homebrew / nvm users: if the server doesn't connect after install, Claude Code likely can't find
node/npxon its launcher PATH. Install with your shell PATH passed through โ works on CLI and desktop:claude mcp add blockrun -s user -e PATH="$PATH" -- npx -y @blockrun/mcp@latestSee Troubleshooting if it persists.
Tool profiles โ expose a trimmed tool set so the client loads fewer schemas into
context. Pass --profile <name> (or set BLOCKRUN_MCP_PROFILE); omit it for the full set.
| Profile | Tools |
|---|---|
full (default) |
everything |
media |
wallet models image video realface music speech |
trading |
wallet price dex markets surf defi rpc |
research |
wallet models chat search exa surf |
chat |
wallet models chat |
# e.g. a media-only install
claude mcp add blockrun-media -s user -- npx -y @blockrun/mcp@latest --profile media
# or a trading-only install
claude mcp add blockrun-trading -s user -- npx -y @blockrun/mcp@latest --profile tradingEquivalent via env: BLOCKRUN_MCP_PROFILE=trading. An unknown profile name falls back to full. modal and phone are available in the full profile only.
Claude Desktop โ add to claude_desktop_config.json:
{
"mcpServers": {
"blockrun": {
"command": "npx",
"args": ["-y", "@blockrun/mcp"]
}
}
}Cursor โ add to ~/.cursor/mcp.json (macOS / Linux) or %APPDATA%\Cursor\mcp.json (Windows):
{
"mcpServers": {
"blockrun": {
"command": "npx",
"args": ["-y", "@blockrun/mcp@latest"]
}
}
}Windsurf โ same JSON, in:
- macOS:
~/.codeium/windsurf/mcp_config.json - Linux:
~/.config/.codeium/windsurf/mcp_config.json - Windows:
%APPDATA%\Codeium\windsurf\mcp_config.json
Fund your wallet
Run blockrun_wallet to see your address. The server pays on Base by default. Send USDC on Base:
| Method | Steps |
|---|---|
| Coinbase | Send โ USDC โ Base network โ paste address |
| Bridge from Ethereum | bridge.base.org |
$5 covers ~5,000 market queries, ~500 Exa searches, ~250 image generations, or ~10 Seedance 1.5-pro clips (5s @ 720p+audio, ~$0.46 each).
Pay on Solana
Prefer to pay in USDC on Solana? It's two tool calls โ no env vars, no file editing, no restart:
blockrun_wallet action:"chain" chain:"solana" # provisions + activates the Solana wallet
blockrun_wallet action:"setup" # shows the Solana address + funding QRThen send USDC (SPL) on the Solana network โ from Coinbase (pick "Solana"), Phantom, Solflare, or Backpack. Switch back anytime with blockrun_wallet action:"chain" chain:"base". The server keeps both wallets; switching just changes which one pays.
Base-only โ these fall back to Base regardless of active chain:
- Tools:
blockrun_music,blockrun_speech,blockrun_video, paidblockrun_realface(enroll/portrait), paid stockblockrun_price. In Solana mode they return a "switch to Base" message instead of charging. (blockrun_imagepays on either chain.) blockrun_chat routing:"smart"(ClawRouter) and native Anthropic (claude-*) passthrough โ on Solana, passmodel:ormode:explicitly.
Advanced: chain selection can also be forced before startup via files/env (
~/.blockrun/.chain,SOLANA_WALLET_KEY) โ see Environment Variables. Theaction:"chain"command above is the recommended path.
Tools
| Tool | Data source | Cost |
|---|---|---|
blockrun_chat |
55+ LLMs (GPT, Claude, Gemini, DeepSeek, Kimi K2.6, GLM, NVIDIA free tier, ...) with mode tier routing |
per token |
blockrun_image |
Generation: openai/gpt-image-2 ($0.06โ0.12) โ flagship, reasoning + text; openai/gpt-image-1 ($0.02โ0.04); google/nano-banana ($0.05) / nano-banana-pro ($0.10โ0.15, 4K); xai/grok-imagine-image ($0.02) / -pro ($0.07); zai/cogview-4 ($0.015). Edit: openai/gpt-image-, google/nano-banana (img2img, inpaint, fusion). | $0.015โ0.15 |
blockrun_video |
Sora 2 + xAI Grok Imagine Video + ByteDance Seedance 1.5/2.0/2.0-fast (720p + audio defaults); RealFace asset โ real-person video | $0.05โ0.30/sec |
blockrun_realface |
Enroll a real person (phone liveness) or an AI character (Virtual Portrait, no liveness) as a ta_xxxx asset for Seedance 2.0 video |
free; $0.01 to enroll |
blockrun_music |
MiniMax music generation | per track |
blockrun_speech |
ElevenLabs text-to-speech (Flash/Turbo/Multilingual/v3, 8 voice aliases) + cinematic sound effects; free voice listing | $0.05โ0.10/1k chars; $0.0525/effect |
blockrun_price |
Pyth-backed realtime + OHLC โ crypto / FX / commodity (free), 12 stock markets (paid) | free or $0.001/call |
blockrun_markets |
Polymarket (markets, candles, trades, orderbooks, leaderboards, smart-wallet PnL/clusters, UMA oracle), Kalshi, Limitless, Opinion, Predict.Fun, dFlow, Binance Futures, cross-platform match + search | $0.001โ0.005/query |
blockrun_polymarket |
Trade on Polymarket (CLOB V2): place/cancel real bets, positions, redeem winnings โ signed locally by your wallet key, settled in pUSD from a gasless Polymarket deposit wallet. Confirm-gated, $25/order default cap. See Polymarket trading. | free tool; bets are your own funds |
blockrun_surf |
Surf (asksurf.ai) โ 84 endpoints: CEX market data, on-chain SQL (13 chains, 80+ ClickHouse tables), 100M+ labeled wallets, Polymarket + Kalshi side-by-side, social mindshare, news, search, Surf-1.5 chat with citations | $0.001โ0.02/call |
blockrun_exa |
Neural web search (Exa) โ research, competitors, papers, URL content | $0.01/query |
blockrun_search |
Grok Live Search โ web + X/Twitter + news with citations | $0.025 ร max_results (default 10) |
blockrun_dex |
Live DEX prices via DexScreener | free |
blockrun_rpc |
Raw JSON-RPC on 40+ chains (Ethereum, Base, Solana, Bitcoin, Sui, NEAR, ...) via Tatum gateway โ eth_call, balances, blocks, logs | $0.002/call |
blockrun_defi |
DefiLlama โ protocol TVL, chain TVL, yield pools (APY), token prices | $0.001โ0.005/call |
blockrun_modal |
Isolated code execution in a BlockRun-hosted Modal sandbox โ disposable container, optional GPU (T4 โ H100) | $0.01 create; $0.001/op |
blockrun_phone |
Outbound AI voice calls (Bland) + wallet-owned US/CA numbers (Twilio), carrier + fraud lookups | $0.54/call; $5/number |
blockrun_models |
Live catalogue of every LLM/image/video/music model + pricing | free |
blockrun_wallet |
Balance, spending, agent budgets, setup QR | free |
Tips for effective LLMs
For LLMs and agents invoking BlockRun MCP tools:
- CRITICAL: When any
blockrun_*tool returns a payment / balance / 402 error, callblockrun_walletfirst to check status, thenaction:"setup"to get funding instructions. Don't retry the failing tool blindly โ the wallet is empty. - CRITICAL:
blockrun_surf's 84-endpoint catalog lives inskills/surf/SKILL.md;blockrun_markets' full endpoint list is in its own tool description (with worked examples inskills/prediction-markets/SKILL.md). Browse those before guessing endpoint paths. - CRITICAL:
blockrun_chat routing:"smart"(ClawRouter) only works on Base wallets. On Solana, passmode:ormodel:to pick a model directly. - CRITICAL:
blockrun_musicandblockrun_videoare payment-on-completion async. Failures or client-side timeouts do NOT charge. Don't retry-loop them โ they may take 60โ180s. - CRITICAL: Before spawning child agents, allocate per-agent budget:
blockrun_wallet action:"delegate" agent_id:"X" agent_limit:1.00. Passagent_id:"X"to every downstreamblockrun_*call โ the child is auto-blocked when the budget hits zero. - CRITICAL:
blockrun_polymarketmoves REAL user funds (pUSD on Polygon), separate from the x402 API budget. Never callbuy/sell/redeemwithconfirm:trueunless the user explicitly approved that exact trade; withoutconfirmyou get a safe dry-run preview. Discover markets/token IDs withblockrun_marketsfirst. - Free tier first for drafts:
blockrun_chat mode:"free"(NVIDIA),blockrun_dex,blockrun_price(crypto / FX / commodity), andblockrun_modelsare all $0. Use them to scaffold before paying for premium models.
Key Use Cases
What kinds of questions can Claude (or any LLM agent) answer once BlockRun MCP is installed:
Price reads / market data
"What's BTC trading at? Compare with last week's average." โ
blockrun_price(free) orblockrun_surfpath:market/pricePrediction-market consensus
"What's Polymarket's odds for the next Fed rate decision?" โ
blockrun_marketspath:polymarket/events+ filterOn-chain forensics
"This wallet (0xabc...) โ what's it labeled as? What does it hold? When did it whale up?" โ
blockrun_surfpaths:wallet/labels/batch,wallet/detail,wallet/net-worthCited research with sources
"Find the 5 most-cited papers on speculative decoding from the last 90 days. Summarize the dominant approach." โ
blockrun_exaaction:searchthencontentsImage generation with on-image text
"Generate a poster announcing GPT-5.5 on BlockRun, retro-futuristic, with the headline 'NOW LIVE'." โ
blockrun_image+ theimage-promptingskill 5-section frameworkGive your agent a voice
"Use blockrun to speak this with the sarah voice." โ
blockrun_speechaction:speak(default),input+voiceโ hosted MP3 URL. Sound effects via action:sound_effectVoice phone-out
"Call +1-415-555-... and confirm the appointment on Friday at 3pm." โ
blockrun_phonepath:voice/call, body:{ to, task, from }(provisionfromfirst viaphone/numbers/buy), then pollvoice/call/{call_id}Multi-agent research with budget cap
"Spawn 3 research agents on competing L1 narratives. Cap each at $0.50." โ
blockrun_wallet delegate ร 3โ children callblockrun_chat+blockrun_exawith theiragent_idCross-chain SQL forensics
"Top 10 tokens by DEX volume on Base in the last 24h." โ
blockrun_surfpath:onchain/sql, body:{ sql: "SELECT..." }Prediction-market signal โ trade (the full loop, self-custody)
"What are Polymarket's odds the Fed holds in May? If it's under 30%, put $2 on Yes." โ
blockrun_marketsreads the signal โblockrun_polymarket action:"buy"places the trade. One wallet, gasless, confirm-gated โ the first signal-to-trade loop in Claude Code.
Why not just use the APIs directly?
| Direct APIs | BlockRun | |
|---|---|---|
| Exa | Sign up, $20/mo minimum | $0.01/call, no subscription |
| Polymarket | Undocumented, rate-limited | $0.001/call, clean JSON |
| Surf (asksurf.ai) | Account + monthly plan | $0.001/call, no Surf account, 84 endpoints |
| Multiple sources | 3 accounts, 3 API keys, 3 billing pages | 1 wallet |
One wallet. All sources. No dashboards.
Multi-agent budget delegation
Delegate a spending budget to a child agent with agent_id. The child is auto-blocked when the budget runs out โ useful for autonomous agents that shouldn't run up unbounded costs.
Troubleshooting
Insufficient balance/ HTTP 402 after retry โ Runblockrun_wallet action:"setup". Send USDC on Base (or Solana โ see Environment Variables).Smart routing (ClawRouter) is not available on Solanaโ Passmodel:ormode:explicitly toblockrun_chat, or switch back to Base withecho base > ~/.blockrun/.chain.blockrundoesn't connect / "MCP server failed" /spawn npx ENOENTโ Almost always a PATH issue: Claude Code can't findnode/npxon the PATH its MCP launcher uses. Common with Homebrew (/opt/homebrew/bin) or nvm, where node isn't on that PATH โ and it affects the CLI as well as the desktop app (the launcher doesn't always inherit your interactive shell PATH). Fix by passing your shell PATH at install:Then restart Claude Code (orclaude mcp remove blockrun -s user claude mcp add blockrun -s user -e PATH="$PATH" -- npx -y @blockrun/mcp@latest
/mcpto reconnect โ MCP tools load at session start). Or pin absolute paths:claude mcp add blockrun -s user -- /opt/homebrew/bin/npx -y @blockrun/mcp@latest(usewhich npxfor your path).claude mcp listdoesn't showblockrunโ Checknode -v(must be โฅ20.19). Clear the npx cache:rm -rf ~/.npm/_npx. Re-run the install command from above (see the PATH fix above if node/npx aren't found).fetch failed/ timeout when checking wallet balance โ Base RPC transient outage. The tool already falls through 3 public RPCs; retry after 30s. Persistent failures usually = local proxy / firewall blocking outbound RPC.ENOENT: ~/.blockrun/.sessionโ Expected on first run. The server auto-creates the wallet; check stderr for theWALLET_CREATEDline confirming the address.Video generation timed out(5-min cap) โ Upstream Seedance / xAI queue congestion. No charge (payment-on-completion). Retry, or pick a faster model (bytedance/seedance-1.5-pro).Music generation timed out(200s cap) โ Same pattern. No charge. Retry; if it persists, the upstream model is rate-limited โ try off-peak.
Polymarket trading
blockrun_polymarket lets an agent place real bets on Polymarket (CLOB V2, Polygon). It is non-custodial: every order and approval is EIP-712-signed locally by your BlockRun wallet key (~/.blockrun/.session) โ the same self-custody key that pays x402 API fees on Base also authorizes bets on Polygon. Neither BlockRun nor Polymarket's relayer can move funds; they only forward payloads you signed.
Architecture โ the official "deposit wallet" path (signature type POLY_1271): a small smart-contract vault on Polygon, CREATE2-derived from your key (only your key can authorize it), holds the betting funds in pUSD (Polymarket's 1:1 collateral wrapper; backing is migrating to native Circle USDC). Deployment, exchange approvals, and redemptions all run gasless through Polymarket's relayer โ you never need POL.
Full step-by-step setup + test guide: docs/polymarket-trading-setup.md.
Getting started:
- No Polymarket account, API keys, or gas token needed โ the MCP bootstraps the builder credentials for the gasless relayer from your own wallet on first setup, and the geoblock egress is handled by default (see Regions below).
blockrun_polymarket action:"setup"โ derives + deploys your deposit wallet and prints its address.- Fund it gaslessly from your Base USDC in one call:
action:"fund" amount_usd:5 confirm:true. BlockRun pays the Base gas and charges $0.01; non-custodial โ your USDC goes straight to the Polymarket bridge and wraps to pUSD in your vault. The credit is async (minutes) โ re-run setup to watch the balance. action:"setup" confirm:trueโ signs the one-time gasless approval batch (Polymarket's canonical set: pUSD spend for both exchanges, the NegRisk Adapter, and the Conditional Tokens contract, plus the CTF operator approvals โ the NegRisk Adapter grant is what lets multi-outcome "winner" markets settle). Setup reads approvals on-chain every run, so re-running it after an upgrade grants any newly-required approval.- Find a market with
blockrun_markets, thenaction:"buy"โ withoutconfirm:trueyou get a dry-run preview; with it, the order is signed and placed. - Cash out any time:
action:"sell"(before resolution) oraction:"redeem"(after you win) turns the position into pUSD, thenaction:"withdraw"bridges it back to native USDC on Base โ the same wallet that pays your AI fees.
Safety rails (server-side; an agent cannot bypass them): confirm:true required for every order/approval/redeem, POLYMARKET_MAX_BET_USD per-order cap (default $25), optional POLYMARKET_MAX_SESSION_USD session cap, and bets never draw from the x402 API budget.
Regions: Polymarket geoblocks order placement by IP (US/UK/EU + many regions). Handled by default โ the MCP routes CLOB traffic through BlockRun's hosted Tokyo egress, so trading works out of the box; setup reports your status. Override POLYMARKET_CLOB_HOST to go direct or run your own egress.
To route through a permitted egress you operate (e.g. a small always-on VM in an unrestricted region), two options:
HTTPS_PROXY=http://user:pass@host:port(simplest). Both Polymarket SDK HTTP clients (CLOB and the relayer) honor it natively, while@blockrun/llm's x402/LLM traffic usesfetchand stays direct โ so in practice only Polymarket traffic is routed, without touching your API-payment egress. Best when someone runs the demo from a restricted region on their own machine.POLYMARKET_CLOB_PROXY=http://user:pass@host:port(surgical). Routes only Polymarket traffic โ CLOB order placement, the L1-auth/derive calls, the geoblock check, and the relayer's deploy/approve/redeem POSTs (injected into the relayer's own axios instance). Use this if you want to leave every other env var untouched.
Run your egress proxy authenticated (not an open relay โ open proxies get abused within hours). Complying with Polymarket's terms for your jurisdiction is your responsibility.
EOA mode: POLYMARKET_SIG_TYPE=0 uses the key's own address (no deposit wallet, no relayer creds) for reads and credential derivation. Note: CLOB V2 rejects a plain EOA maker for order placement (maker address not allowed, please use the deposit wallet flow), so use the default deposit-wallet mode to actually place orders.
โ ๏ธ Back up ~/.blockrun/.session. It is the only key to both the payment wallet and the Polymarket deposit wallet.
Environment Variables
| Variable / File | Default | Effect |
|---|---|---|
~/.blockrun/.session |
auto-created on first run | EVM private key (0x...). File exists โ use Base. Also the Polymarket signer. |
~/.blockrun/.chain |
unset | Optional explicit chain preference: base or solana. |
~/.blockrun/.solana-session |
not created | Solana private key. File exists โ switch to Solana unless .chain says base. |
SOLANA_WALLET_KEY |
unset | Env-var override of .solana-session. Set โ use Solana. |
POLYMARKET_CLOB_HOST |
BlockRun Tokyo relay | Geoblock egress for order placement โ defaulted for you so trading works out of the box. Override to go direct (https://clob.polymarket.com) or point at your own egress. Relayer creds are auto-bootstrapped from your wallet โ no Polymarket API keys needed. |
POLYMARKET_MAX_BET_USD |
25 |
Hard per-order notional cap for blockrun_polymarket. |
POLYMARKET_MAX_SESSION_USD |
unset | Optional cumulative per-process betting cap. |
POLYMARKET_SIG_TYPE |
3 |
3 = deposit wallet (POLY_1271, gasless); 0 = plain EOA mode. |
POLYMARKET_CLOB_PROXY |
unset | HTTPS proxy for Polymarket CLOB traffic only (geoblocked-egress workaround you operate). |
POLYMARKET_BOUNDED_APPROVALS |
unset (unlimited) | Bound pUSD exchange allowances to this many dollars instead of unlimited. |
BLOCKRUN_BUILDER_CODE |
unset | Optional Polymarket builder attribution code carried on orders. |
~/.blockrun/.polymarket-creds, ~/.blockrun/.polymarket.json |
auto-created | CLOB L2 API creds + deposit-wallet state (0600). |
Chain selection priority (see src/utils/wallet.ts):
~/.blockrun/.chainor~/.blockrun/payment-chainset tobaseorsolanaโ explicit preference winsSOLANA_WALLET_KEYenv var present โ Solana~/.blockrun/.solana-sessionexists โ Solana- Otherwise โ Base (
~/.blockrun/.sessionauto-created)
Switching chains:
The recommended way is the tool itself โ it provisions both wallets, applies instantly (no restart), and shows the funding QR:
blockrun_wallet action:"chain" chain:"solana" # or chain:"base"
blockrun_wallet action:"setup" # funding instructions for the active chainAdvanced (force a chain before startup, e.g. in CI): echo solana > ~/.blockrun/.chain then set SOLANA_WALLET_KEY or create ~/.blockrun/.solana-session; echo base > ~/.blockrun/.chain reuses the existing .session (same Base wallet). These edit the same preference file that action:"chain" writes โ prefer the tool unless you need pre-startup control.
Some media and paid market-data tools still settle on Base only: blockrun_music, blockrun_speech, blockrun_video, paid blockrun_realface (enroll/portrait), and paid stock blockrun_price calls โ plus blockrun_chat routing:"smart" and native Anthropic (claude-*) passthrough. In Solana mode these return a "switch to Base" message instead of charging. blockrun_image (generate + edit) settles on whichever chain is active.
The server also runs a non-blocking npm registry check at startup and prints an Update available notice to stderr when a newer @blockrun/mcp version exists. Upgrade by re-running the install command โ no manual npm update needed.
How it works
Pay-per-call via x402 micropayments in USDC. Your wallet lives at ~/.blockrun/.session (Base) or ~/.blockrun/.solana-session (Solana). The private key never leaves your machine.
Contributing
PRs welcome. See CONTRIBUTING.md for setup, the tool-vs-skill design rule, and how to add a new partner API.
Issues: github.com/blockrunai/blockrun-mcp/issues
blockrun.ai ยท npm ยท @BlockRunAI


