@blockrun/mcp 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -273
- package/dist/chunk-NHJMKXNS.js +961 -0
- package/dist/http-server.d.ts +20 -0
- package/dist/http-server.js +59 -0
- package/dist/index.js +19 -557
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,350 +1,296 @@
|
|
|
1
1
|
# @blockrun/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The payment layer for AI agents.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@blockrun/mcp)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
2. Manage 5+ API keys and billing systems
|
|
9
|
-
3. Pay $20-100/month minimums per provider
|
|
10
|
-
4. Configure each provider separately
|
|
8
|
+
BlockRun MCP is a Model Context Protocol server that gives any AI agent (Claude, GPT, Cursor, etc.) access to 41 LLM models, real-time web search, prediction markets, crypto DEX data, whale tracking, image generation, and token swaps — all paid via x402 micropayments in USDC on Base. No API keys. No subscriptions. No accounts.
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
---
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## Why blockrun-mcp
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Claude Code has task systems, token budgets, and multi-agent coordination. What it does not have: per-agent wallets, spending enforcement across sessions, or a way for a parent agent to delegate a budget to a child agent and block it when that budget is exhausted.
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
- **One wallet** - Single USDC balance for all providers
|
|
20
|
-
- **Pay-per-use** - No minimums, $5 gets you started
|
|
21
|
-
- **One command** - Install and go
|
|
16
|
+
BlockRun fills this gap. Every tool call is a real micropayment — authorized locally by a wallet the agent controls. Parent agents can delegate spending limits to child agents by `agent_id`. Usage is auditable on-chain at any time.
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
claude mcp add blockrun npx @blockrun/mcp
|
|
25
|
-
```
|
|
18
|
+
This makes BlockRun the financial infrastructure layer for multi-agent systems, not just a model proxy.
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
---
|
|
28
21
|
|
|
29
22
|
## Quick Start
|
|
30
23
|
|
|
31
|
-
### 1
|
|
24
|
+
### Option 1: Hosted (zero install)
|
|
32
25
|
|
|
33
26
|
```bash
|
|
34
|
-
claude mcp add blockrun
|
|
27
|
+
claude mcp add blockrun --transport http https://mcp.blockrun.ai/mcp
|
|
35
28
|
```
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
No Node.js. No npm. Works from any agent, CI/CD pipeline, or cloud environment. Pass your wallet key per-request via `X-Wallet-Key` header.
|
|
38
31
|
|
|
39
|
-
### 2
|
|
32
|
+
### Option 2: Local (self-hosted, private key never leaves your machine)
|
|
40
33
|
|
|
34
|
+
```bash
|
|
35
|
+
claude mcp add blockrun npx @blockrun/mcp
|
|
41
36
|
```
|
|
42
|
-
You: blockrun setup
|
|
43
37
|
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
```bash
|
|
39
|
+
# Optional: bring your own wallet
|
|
40
|
+
claude mcp add blockrun npx @blockrun/mcp --env BLOCKRUN_WALLET_KEY=0x...
|
|
46
41
|
```
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Send USDC to your wallet address on **Base** network. Even $5 gets you hundreds of requests.
|
|
51
|
-
|
|
52
|
-
| Method | Steps |
|
|
53
|
-
|--------|-------|
|
|
54
|
-
| **From Coinbase** | Send → USDC → Select "Base" network → Paste your address |
|
|
55
|
-
| **Bridge** | [bridge.base.org](https://bridge.base.org) → Bridge USDC to Base |
|
|
56
|
-
| **Buy Direct** | [Coinbase Onramp](https://www.coinbase.com/onramp) → Buy USDC on Base |
|
|
57
|
-
|
|
58
|
-
### 4. Start Using
|
|
43
|
+
A wallet is automatically created on first use. Fund it with USDC on Base network and every tool is immediately available.
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
---
|
|
61
46
|
|
|
62
|
-
|
|
63
|
-
You: blockrun ask GPT-5 to explain quantum computing
|
|
47
|
+
## What Your Agent Gets
|
|
64
48
|
|
|
65
|
-
|
|
49
|
+
| Tool | What it does | Cost |
|
|
50
|
+
|------|-------------|------|
|
|
51
|
+
| `blockrun_chat` | 41 AI models (GPT-5, Claude, Gemini, NVIDIA free) | per token |
|
|
52
|
+
| `blockrun_wallet` | Wallet management + multi-agent budget orchestration | free |
|
|
53
|
+
| `blockrun_search` | Web + news search with AI-summarized results | ~$0.01/search |
|
|
54
|
+
| `blockrun_exa` | Neural web search (Exa) — understands meaning, not just keywords | $0.01/call |
|
|
55
|
+
| `blockrun_twitter` | Real-time X/Twitter search via Grok | per token |
|
|
56
|
+
| `blockrun_markets` | Prediction markets — Polymarket, Kalshi, dFlow, Binance Futures | $0.001/call |
|
|
57
|
+
| `blockrun_image` | Image generation and editing (DALL-E 3, Flux) | $0.02–0.08 |
|
|
58
|
+
| `blockrun_dex` | Real-time DEX prices and liquidity via DexScreener | FREE |
|
|
59
|
+
| `blockrun_whale` | On-chain whale tracking — large ETH transfers via Etherscan | FREE |
|
|
60
|
+
| `blockrun_analyze` | Token technical analysis combining multiple data sources with AI | per token |
|
|
61
|
+
| `blockrun_signal` | Trading signals — RSI + MACD + EMA strategy | FREE |
|
|
62
|
+
| `blockrun_swap` | Token swap quotes on Base via 0x aggregator | FREE |
|
|
63
|
+
| `blockrun_models` | List all 41 models with pricing and context windows | FREE |
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
```
|
|
65
|
+
---
|
|
69
66
|
|
|
70
|
-
##
|
|
67
|
+
## Multi-Agent Budget Orchestration
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
A parent agent can allocate spending limits to child agents. Child agents self-identify via `agent_id`. When a child agent hits its limit, further calls are automatically blocked without any coordination logic needed in your code.
|
|
73
70
|
|
|
74
|
-
```
|
|
75
|
-
|
|
71
|
+
```typescript
|
|
72
|
+
// Parent agent allocates budgets to child agents
|
|
73
|
+
mcp.call("blockrun_wallet", { action: "delegate", agent_id: "researcher", agent_limit: 2.00 })
|
|
74
|
+
mcp.call("blockrun_wallet", { action: "delegate", agent_id: "writer", agent_limit: 0.50 })
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
// Child agents self-identify — auto-blocked at limit
|
|
77
|
+
mcp.call("blockrun_chat", { message: "...", routing: "smart", agent_id: "researcher" })
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
// Audit spending across all agents
|
|
80
|
+
mcp.call("blockrun_wallet", { action: "report" })
|
|
81
|
+
// researcher: $1.84/$2.00 (23 calls), writer: $0.31/$0.50 (4 calls)
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
- `openai/gpt-5.2` - Most capable OpenAI model
|
|
84
|
-
- `anthropic/claude-opus-4` - Best for complex reasoning
|
|
85
|
-
- `anthropic/claude-sonnet-4` - Fast & capable (recommended)
|
|
86
|
-
- `google/gemini-2.5-pro` - Great for long context (1M tokens)
|
|
87
|
-
- `deepseek/deepseek-chat` - Very affordable
|
|
88
|
-
|
|
89
|
-
### Smart Model Selection
|
|
84
|
+
This pattern works across sessions. The spending record is tied to the wallet, not the process.
|
|
90
85
|
|
|
91
|
-
|
|
86
|
+
---
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
blockrun smart fast: what's 2+2
|
|
88
|
+
## Smart Routing (ClawRouter)
|
|
95
89
|
|
|
96
|
-
|
|
90
|
+
Agents do not need to pick models. Pass `routing: "smart"` and ClawRouter selects the optimal model for the task based on the routing profile.
|
|
97
91
|
|
|
98
|
-
|
|
92
|
+
```typescript
|
|
93
|
+
// Auto-selects optimal model — agents never need to pick
|
|
94
|
+
blockrun_chat({ message: "...", routing: "smart", routing_profile: "eco" })
|
|
95
|
+
// Returns: [nvidia/deepseek-v3.2 | SIMPLE | $0.0001 | 94% savings]
|
|
99
96
|
```
|
|
100
97
|
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
|
|
98
|
+
| Profile | Description |
|
|
99
|
+
|---------|-------------|
|
|
100
|
+
| `free` | Zero cost — NVIDIA-hosted models only |
|
|
101
|
+
| `eco` | Budget-optimized — best quality per dollar |
|
|
102
|
+
| `auto` | Balanced — default |
|
|
103
|
+
| `premium` | Highest quality available |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## All 41 Models
|
|
108
|
+
|
|
109
|
+
### OpenAI (13 models)
|
|
110
|
+
|
|
111
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
112
|
+
|----------|---------|-------------|--------------|
|
|
113
|
+
| `openai/gpt-5.2` | 128k | $21.00 | $84.00 |
|
|
114
|
+
| `openai/gpt-5` | 128k | $15.00 | $60.00 |
|
|
115
|
+
| `openai/gpt-5-mini` | 128k | $0.40 | $1.60 |
|
|
116
|
+
| `openai/gpt-4o` | 128k | $2.50 | $10.00 |
|
|
117
|
+
| `openai/gpt-4o-mini` | 128k | $0.15 | $0.60 |
|
|
118
|
+
| `openai/o3` | 200k | $10.00 | $40.00 |
|
|
119
|
+
| `openai/o3-mini` | 200k | $1.10 | $4.40 |
|
|
120
|
+
| `openai/o4-mini` | 200k | $1.10 | $4.40 |
|
|
121
|
+
| `openai/o1` | 200k | $15.00 | $60.00 |
|
|
122
|
+
| `openai/o1-mini` | 128k | $1.10 | $4.40 |
|
|
123
|
+
| `openai/o1-pro` | 200k | $150.00 | $600.00 |
|
|
124
|
+
| `openai/gpt-4.1` | 128k | $2.00 | $8.00 |
|
|
125
|
+
| `openai/gpt-4.1-mini` | 128k | $0.40 | $1.60 |
|
|
126
|
+
|
|
127
|
+
### Anthropic (4 models)
|
|
128
|
+
|
|
129
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
130
|
+
|----------|---------|-------------|--------------|
|
|
131
|
+
| `anthropic/claude-opus-4` | 200k | $15.00 | $75.00 |
|
|
132
|
+
| `anthropic/claude-sonnet-4` | 200k | $3.00 | $15.00 |
|
|
133
|
+
| `anthropic/claude-sonnet-3-7` | 200k | $3.00 | $15.00 |
|
|
134
|
+
| `anthropic/claude-haiku-3-5` | 200k | $0.25 | $1.25 |
|
|
135
|
+
|
|
136
|
+
### Google (7 models)
|
|
137
|
+
|
|
138
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
139
|
+
|----------|---------|-------------|--------------|
|
|
140
|
+
| `google/gemini-3-pro` | 1M | $2.50 | $15.00 |
|
|
141
|
+
| `google/gemini-2.5-pro` | 1M | $1.25 | $10.00 |
|
|
142
|
+
| `google/gemini-2.5-flash` | 1M | $0.15 | $0.60 |
|
|
143
|
+
| `google/gemini-2.0-flash` | 1M | $0.10 | $0.40 |
|
|
144
|
+
| `google/gemini-2.0-flash-lite` | 1M | $0.075 | $0.30 |
|
|
145
|
+
| `google/gemini-1.5-pro` | 2M | $1.25 | $5.00 |
|
|
146
|
+
| `google/gemini-1.5-flash` | 1M | $0.075 | $0.30 |
|
|
147
|
+
|
|
148
|
+
### DeepSeek (2 models)
|
|
149
|
+
|
|
150
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
151
|
+
|----------|---------|-------------|--------------|
|
|
152
|
+
| `deepseek/deepseek-chat` | 64k | $0.14 | $0.28 |
|
|
153
|
+
| `deepseek/deepseek-reasoner` | 64k | $0.55 | $2.19 |
|
|
154
|
+
|
|
155
|
+
### NVIDIA (12 models — FREE)
|
|
156
|
+
|
|
157
|
+
All NVIDIA-hosted models are free via the `routing_profile: "free"` option or by specifying directly.
|
|
158
|
+
|
|
159
|
+
| Model ID |
|
|
160
|
+
|----------|
|
|
161
|
+
| `nvidia/deepseek-v3.2` |
|
|
162
|
+
| `nvidia/llama-3.3-70b` |
|
|
163
|
+
| `nvidia/llama-3.1-405b` |
|
|
164
|
+
| `nvidia/mistral-nemo-12b` |
|
|
165
|
+
| `nvidia/phi-4-mini` |
|
|
166
|
+
| `nvidia/qwen2.5-72b` |
|
|
167
|
+
| `nvidia/nemotron-70b` |
|
|
168
|
+
| `nvidia/nemotron-253b` |
|
|
169
|
+
| `nvidia/llama-3.1-nemotron-nano-8b` |
|
|
170
|
+
| `nvidia/llama-3.1-nemotron-ultra-253b` |
|
|
171
|
+
| `nvidia/mistral-small-3.1` |
|
|
172
|
+
| `nvidia/qwen3-235b` |
|
|
173
|
+
|
|
174
|
+
### ZAI (2 models)
|
|
175
|
+
|
|
176
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
177
|
+
|----------|---------|-------------|--------------|
|
|
178
|
+
| `zai/grok-3` | 131k | $5.00 | $25.00 |
|
|
179
|
+
| `zai/grok-3-mini` | 131k | $3.00 | $15.00 |
|
|
180
|
+
|
|
181
|
+
### MiniMax (1 model)
|
|
182
|
+
|
|
183
|
+
| Model ID | Context | Input ($/M) | Output ($/M) |
|
|
184
|
+
|----------|---------|-------------|--------------|
|
|
185
|
+
| `minimax/minimax-m1` | 1M | $0.80 | $2.40 |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## How Payments Work
|
|
190
|
+
|
|
191
|
+
Every request is paid via the x402 protocol — an open payment standard for machine-to-machine micropayments. Payments settle in USDC on Base network. Your wallet is created automatically on first use and stored locally at `~/.blockrun/.session`. The private key is used only to sign payment authorizations locally — it is never transmitted to any server. You can verify all transactions on [Basescan](https://basescan.org).
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Funding Your Wallet
|
|
108
196
|
|
|
109
|
-
### Generate Images
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
blockrun generate an image of a cyberpunk cityscape
|
|
113
|
-
|
|
114
|
-
blockrun create a watercolor painting of mountains
|
|
115
197
|
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
198
|
+
# Get your wallet address
|
|
199
|
+
blockrun_wallet({ action: "balance" })
|
|
200
|
+
# Returns: 0x... (QR code available for mobile wallets)
|
|
119
201
|
```
|
|
120
|
-
blockrun list models
|
|
121
202
|
|
|
122
|
-
|
|
123
|
-
```
|
|
203
|
+
Send USDC on Base network to that address. $5 gets you started — approximately 50,000 Gemini Flash requests or 125 DALL-E 3 images. There is no minimum. You pay only for what you use.
|
|
124
204
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
blockrun twitter: what is @elonmusk posting about today
|
|
131
|
-
|
|
132
|
-
blockrun twitter: trending AI news
|
|
133
|
-
|
|
134
|
-
blockrun twitter: reactions to [recent event]
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Wallet & Balance
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
blockrun setup # First-time setup instructions
|
|
141
|
-
blockrun wallet # Check your wallet address
|
|
142
|
-
blockrun balance # Check on-chain USDC balance
|
|
143
|
-
```
|
|
205
|
+
| Method | Steps |
|
|
206
|
+
|--------|-------|
|
|
207
|
+
| Coinbase | Send → USDC → Select "Base" network → Paste address |
|
|
208
|
+
| Bridge | [bridge.base.org](https://bridge.base.org) → Bridge USDC to Base |
|
|
209
|
+
| Buy direct | [Coinbase Onramp](https://www.coinbase.com/onramp) → Buy USDC on Base |
|
|
144
210
|
|
|
145
|
-
|
|
211
|
+
---
|
|
146
212
|
|
|
147
|
-
|
|
213
|
+
## Architecture
|
|
148
214
|
|
|
149
215
|
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
216
|
+
Claude Code / Any MCP Client
|
|
217
|
+
|
|
|
218
|
+
| stdio (local) or HTTP (remote, coming soon)
|
|
219
|
+
|
|
|
220
|
+
blockrun-mcp server
|
|
221
|
+
|
|
|
222
|
+
| x402 micropayments (USDC on Base)
|
|
223
|
+
|
|
|
224
|
+
blockrun.ai gateway
|
|
225
|
+
|
|
|
226
|
+
+-- OpenAI
|
|
227
|
+
+-- Anthropic
|
|
228
|
+
+-- Google
|
|
229
|
+
+-- NVIDIA
|
|
230
|
+
+-- DeepSeek
|
|
231
|
+
+-- ZAI / MiniMax
|
|
232
|
+
+-- DexScreener / Etherscan / Polymarket / Kalshi / Exa / 0x
|
|
153
233
|
```
|
|
154
234
|
|
|
155
|
-
|
|
235
|
+
The MCP server runs locally (stdio transport). Each tool call that requires payment triggers a local wallet signature. The signed payment authorization is sent to the blockrun.ai gateway alongside the API request. No API keys pass through your machine.
|
|
156
236
|
|
|
157
|
-
|
|
237
|
+
---
|
|
158
238
|
|
|
159
|
-
|
|
160
|
-
|----------|--------|-------------|--------------|
|
|
161
|
-
| **OpenAI** | GPT-5.2, GPT-5-mini, GPT-4o, o3, o1 | $0.15 - $21/M | $0.60 - $84/M |
|
|
162
|
-
| **Anthropic** | Claude Opus 4, Sonnet 4, Haiku | $0.25 - $15/M | $1.25 - $75/M |
|
|
163
|
-
| **Google** | Gemini 3 Pro, 2.5 Pro/Flash | Free - $2.50/M | Free - $15/M |
|
|
164
|
-
| **DeepSeek** | V3.2, Reasoner | $0.14 - $0.55/M | $0.28 - $2.19/M |
|
|
165
|
-
| **xAI** | Grok 3, Grok 3 Mini | $3 - $5/M | $15 - $25/M |
|
|
166
|
-
|
|
167
|
-
*M = million tokens. Prices in USD.*
|
|
168
|
-
|
|
169
|
-
### Image Models
|
|
170
|
-
|
|
171
|
-
| Model | Price per Image |
|
|
172
|
-
|-------|-----------------|
|
|
173
|
-
| DALL-E 3 (Standard) | $0.04 |
|
|
174
|
-
| DALL-E 3 (HD) | $0.08 |
|
|
175
|
-
| Flux Schnell | $0.02 |
|
|
176
|
-
|
|
177
|
-
### Cost Examples
|
|
178
|
-
|
|
179
|
-
| Task | Model | Approx. Cost |
|
|
180
|
-
|------|-------|--------------|
|
|
181
|
-
| Quick question | Gemini Flash | $0.0001 |
|
|
182
|
-
| Code review | Claude Sonnet | $0.003 |
|
|
183
|
-
| Complex analysis | GPT-4o | $0.005 |
|
|
184
|
-
| Long document | Claude Opus | $0.02 |
|
|
185
|
-
| Image generation | DALL-E 3 | $0.04 |
|
|
186
|
-
|
|
187
|
-
**$5 gets you approximately:**
|
|
188
|
-
- 50,000 Gemini Flash requests, OR
|
|
189
|
-
- 1,600 Claude Sonnet requests, OR
|
|
190
|
-
- 1,000 GPT-4o requests, OR
|
|
191
|
-
- 125 DALL-E 3 images
|
|
192
|
-
|
|
193
|
-
## Wallet Management
|
|
194
|
-
|
|
195
|
-
### Auto-Generated Wallet
|
|
239
|
+
## Configuration
|
|
196
240
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```
|
|
241
|
+
| Variable | Description |
|
|
242
|
+
|----------|-------------|
|
|
243
|
+
| `BLOCKRUN_WALLET_KEY` | Bring your own private key (hex string, starts with 0x). Optional — a wallet is auto-generated if not set. |
|
|
201
244
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
- Persistent across sessions
|
|
245
|
+
Wallet resolution order:
|
|
246
|
+
1. `BLOCKRUN_WALLET_KEY` environment variable
|
|
247
|
+
2. `BASE_CHAIN_WALLET_KEY` environment variable
|
|
248
|
+
3. `~/.blockrun/.session` (auto-created on first use)
|
|
207
249
|
|
|
208
|
-
|
|
250
|
+
---
|
|
209
251
|
|
|
210
|
-
|
|
252
|
+
## Development
|
|
211
253
|
|
|
212
254
|
```bash
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Wallet Priority
|
|
221
|
-
|
|
222
|
-
1. Environment variable `BLOCKRUN_WALLET_KEY`
|
|
223
|
-
2. Environment variable `BASE_CHAIN_WALLET_KEY`
|
|
224
|
-
3. File at `~/.blockrun/.session`
|
|
225
|
-
4. Auto-generate new wallet (saved to file)
|
|
226
|
-
|
|
227
|
-
## How Payment Works
|
|
228
|
-
|
|
229
|
-
```
|
|
230
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
231
|
-
│ 1. You send a request (e.g., chat with GPT-5) │
|
|
232
|
-
│ ↓ │
|
|
233
|
-
│ 2. BlockRun calculates cost based on tokens │
|
|
234
|
-
│ ↓ │
|
|
235
|
-
│ 3. Your wallet signs a payment authorization LOCALLY │
|
|
236
|
-
│ (private key NEVER leaves your machine) │
|
|
237
|
-
│ ↓ │
|
|
238
|
-
│ 4. Payment settles on Base network via USDC │
|
|
239
|
-
│ ↓ │
|
|
240
|
-
│ 5. You receive your AI response │
|
|
241
|
-
└─────────────────────────────────────────────────────────────┘
|
|
255
|
+
git clone https://github.com/BlockRunAI/blockrun-mcp
|
|
256
|
+
cd blockrun-mcp
|
|
257
|
+
npm install
|
|
258
|
+
npm run build
|
|
259
|
+
npm run dev # tsx watch — auto-reloads on changes
|
|
242
260
|
```
|
|
243
261
|
|
|
244
|
-
|
|
245
|
-
- Private key is used ONLY for local signing
|
|
246
|
-
- Key is NEVER transmitted to any server
|
|
247
|
-
- Same security model as MetaMask transactions
|
|
248
|
-
- You can verify all transactions on [Basescan](https://basescan.org)
|
|
249
|
-
|
|
250
|
-
## Comparison with Alternatives
|
|
251
|
-
|
|
252
|
-
### vs claude-code-proxy
|
|
253
|
-
| | claude-code-proxy | BlockRun MCP |
|
|
254
|
-
|---|---|---|
|
|
255
|
-
| API Keys | Required (bring your own) | **Not needed** |
|
|
256
|
-
| Setup | Configure each provider | **One command** |
|
|
257
|
-
| Billing | Multiple subscriptions | **Unified wallet** |
|
|
258
|
-
|
|
259
|
-
### vs gemini-mcp
|
|
260
|
-
| | gemini-mcp | BlockRun MCP |
|
|
261
|
-
|---|---|---|
|
|
262
|
-
| Models | Gemini only | **30+ models, 6 providers** |
|
|
263
|
-
| API Key | Required | **Not needed** |
|
|
264
|
-
| Payment | Google billing | **Pay-per-use crypto** |
|
|
265
|
-
|
|
266
|
-
### vs Direct API Keys
|
|
267
|
-
| | Direct APIs | BlockRun MCP |
|
|
268
|
-
|---|---|---|
|
|
269
|
-
| Accounts | 5+ accounts needed | **One wallet** |
|
|
270
|
-
| Minimums | $20-100/mo per provider | **$0 minimum** |
|
|
271
|
-
| Management | Complex | **Simple** |
|
|
272
|
-
|
|
273
|
-
## Troubleshooting
|
|
274
|
-
|
|
275
|
-
### "Payment was rejected"
|
|
276
|
-
Your wallet needs funding. Say `blockrun setup` to get your address and funding instructions.
|
|
277
|
-
|
|
278
|
-
### "Wallet key required"
|
|
279
|
-
The MCP couldn't find or create a wallet. Check that `~/.blockrun/` directory is writable.
|
|
280
|
-
|
|
281
|
-
### Model not responding
|
|
282
|
-
Some models have rate limits. Try `blockrun smart cheap` or `blockrun smart fast` to use alternative models.
|
|
283
|
-
|
|
284
|
-
### Check wallet balance
|
|
285
|
-
Say `blockrun balance` to check your on-chain USDC balance, or visit: `https://basescan.org/address/YOUR_ADDRESS`
|
|
286
|
-
|
|
287
|
-
### Budget limit reached
|
|
288
|
-
If you've set a session budget and hit the limit, use `blockrun budget clear` to remove it or `blockrun budget set $X` to increase it.
|
|
289
|
-
|
|
290
|
-
## Configuration
|
|
291
|
-
|
|
292
|
-
### Claude Code Setup
|
|
262
|
+
To test the server manually:
|
|
293
263
|
|
|
294
264
|
```bash
|
|
295
|
-
|
|
296
|
-
claude mcp add blockrun npx @blockrun/mcp
|
|
297
|
-
|
|
298
|
-
# With explicit wallet
|
|
299
|
-
claude mcp add blockrun npx @blockrun/mcp --env BLOCKRUN_WALLET_KEY=0x...
|
|
300
|
-
|
|
301
|
-
# Project-specific
|
|
302
|
-
claude mcp add blockrun --scope project npx @blockrun/mcp
|
|
303
|
-
|
|
304
|
-
# User-wide (all projects)
|
|
305
|
-
claude mcp add blockrun --scope user npx @blockrun/mcp
|
|
265
|
+
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node dist/index.js
|
|
306
266
|
```
|
|
307
267
|
|
|
308
|
-
|
|
268
|
+
---
|
|
309
269
|
|
|
310
|
-
|
|
311
|
-
|----------|-------------|
|
|
312
|
-
| `BLOCKRUN_WALLET_KEY` | Your wallet private key (hex, starts with 0x) |
|
|
313
|
-
| `BASE_CHAIN_WALLET_KEY` | Alternative name for wallet key |
|
|
270
|
+
## Roadmap
|
|
314
271
|
|
|
315
|
-
|
|
272
|
+
- [x] 14 tools covering LLMs, search, crypto, markets, image generation
|
|
273
|
+
- [x] Multi-agent budget delegation via `agent_id`
|
|
274
|
+
- [x] ClawRouter intelligent model routing
|
|
275
|
+
- [x] Multi-turn conversation support
|
|
276
|
+
- [ ] HTTP/SSE transport (deploy to mcp.blockrun.ai — no local install needed)
|
|
277
|
+
- [ ] Per-tool LLM-optimized descriptions
|
|
278
|
+
- [ ] Official MCP registry listing
|
|
279
|
+
- [ ] Persistent cross-session spending records tied to wallet
|
|
316
280
|
|
|
317
|
-
|
|
318
|
-
# Clone
|
|
319
|
-
git clone https://github.com/blockrunai/blockrun-mcp
|
|
320
|
-
cd blockrun-mcp
|
|
321
|
-
|
|
322
|
-
# Install dependencies
|
|
323
|
-
npm install
|
|
324
|
-
|
|
325
|
-
# Development mode (auto-reload)
|
|
326
|
-
npm run dev
|
|
327
|
-
|
|
328
|
-
# Build for production
|
|
329
|
-
npm run build
|
|
330
|
-
|
|
331
|
-
# Test locally
|
|
332
|
-
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node dist/index.js
|
|
333
|
-
```
|
|
281
|
+
---
|
|
334
282
|
|
|
335
283
|
## Links
|
|
336
284
|
|
|
337
285
|
- **Website:** [blockrun.ai](https://blockrun.ai)
|
|
338
|
-
- **
|
|
286
|
+
- **npm:** [@blockrun/mcp](https://www.npmjs.com/package/@blockrun/mcp)
|
|
287
|
+
- **GitHub:** [github.com/blockrunai/blockrun-mcp](https://github.com/blockrunai/blockrun-mcp)
|
|
288
|
+
- **Issues:** [github.com/blockrunai/blockrun-mcp/issues](https://github.com/blockrunai/blockrun-mcp/issues)
|
|
339
289
|
- **Pricing:** [blockrun.ai/pricing](https://blockrun.ai/pricing)
|
|
340
|
-
- **
|
|
341
|
-
- **
|
|
342
|
-
|
|
343
|
-
## Support
|
|
290
|
+
- **Telegram:** [t.me/+mroQv4-4hGgzOGUx](https://t.me/+mroQv4-4hGgzOGUx)
|
|
291
|
+
- **X:** [@BlockRunAI](https://x.com/BlockRunAI)
|
|
344
292
|
|
|
345
|
-
|
|
346
|
-
- **Discord:** [Join our Discord](https://discord.gg/blockrun)
|
|
347
|
-
- **Email:** hello@blockrun.ai
|
|
293
|
+
---
|
|
348
294
|
|
|
349
295
|
## License
|
|
350
296
|
|