@blockrun/mcp 0.6.3 → 0.6.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BlockRun AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,106 +1,127 @@
1
- # @blockrun/mcp
1
+ # BlockRun MCP
2
2
 
3
- **Give your AI agent superpowers — web search, deep research, prediction markets, crypto data, X/Twitter intelligence.**
3
+ [![npm](https://img.shields.io/npm/v/@blockrun/mcp)](https://www.npmjs.com/package/@blockrun/mcp)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+ [![MCP](https://img.shields.io/badge/MCP-compatible-blue)](https://modelcontextprotocol.io)
4
6
 
5
- [![npm version](https://img.shields.io/npm/v/@blockrun/mcp)](https://www.npmjs.com/package/@blockrun/mcp)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ **Real-time data for Claude — markets, research, X/Twitter, crypto. No API keys. Pay per call.**
7
8
 
8
- BlockRun MCP gives your AI agent access to live data it can't get on its own — real-time web search, neural research, prediction markets, crypto DEX prices, and X/Twitter intelligence. All paid via x402 micropayments in USDC. No API keys. No subscriptions. No accounts.
9
+ ```bash
10
+ claude mcp add blockrun npx @blockrun/mcp
11
+ ```
12
+
13
+ Wallet auto-created. Fund with $5 USDC. Ask Claude anything.
9
14
 
10
15
  ---
11
16
 
12
- ## Quick Start
17
+ ## What changes
13
18
 
14
- ### Option 1: Local (recommended — wallet auto-created, private key stays on your machine)
19
+ Before BlockRun, Claude can't answer:
15
20
 
16
- ```bash
17
- claude mcp add blockrun -- npx @blockrun/mcp
18
- ```
21
+ - *"What's the current Polymarket probability that Bitcoin hits $100k this year?"*
22
+ - *"Find me the top 5 papers on RAG published in the last 30 days"*
23
+ - *"What are people saying about @sama on X right now?"*
24
+ - *"What's the 24h volume on the PEPE/ETH pair on Uniswap?"*
19
25
 
20
- A wallet is automatically created on first use. Fund it with USDC on Base and every tool is immediately available.
26
+ 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.
21
27
 
22
- ### Option 2: Hosted (zero install)
28
+ ---
23
29
 
24
- ```bash
25
- claude mcp add blockrun --transport http https://mcp.blockrun.ai/mcp
26
- ```
30
+ ## Demo
31
+
32
+ > **User:** What's Polymarket saying about the Fed rate decision next month?
27
33
 
28
- No Node.js. No npm. Works from any MCP client. Pass your wallet key via `X-Wallet-Key` header, or run `blockrun_wallet` for setup instructions.
34
+ > **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.
35
+ >
36
+ > *(via `blockrun_markets` · cost: $0.001)*
29
37
 
30
38
  ---
31
39
 
32
- ## Tools
40
+ > **User:** Find recent papers on speculative decoding and summarize the key approaches
33
41
 
34
- | Tool | What it does | Cost |
35
- |------|-------------|------|
36
- | `blockrun_search` | Real-time web + news search | ~$0.01/search |
37
- | `blockrun_exa` | Neural research (Exa) — finds papers, competitors, similar products | $0.01/call |
38
- | `blockrun_twitter` | X/Twitter intelligence via Grok — search, trends, user analysis | per token |
39
- | `blockrun_markets` | Prediction markets — Polymarket, Kalshi | $0.001/call |
40
- | `blockrun_dex` | Real-time DEX prices and liquidity via DexScreener | FREE |
41
- | `blockrun_image` | Image generation and editing (DALL-E 3, Flux) | $0.02–0.08 |
42
- | `blockrun_chat` | Second opinion from another model (GPT, Gemini, DeepSeek, etc.) | per token |
43
- | `blockrun_wallet` | Wallet balance, agent budgets, spending reports | FREE |
44
- | `blockrun_models` | List all models with pricing | FREE |
42
+ > **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...
43
+ >
44
+ > *(via `blockrun_exa` · cost: $0.01)*
45
45
 
46
46
  ---
47
47
 
48
- ## Why BlockRun
48
+ ## Install
49
49
 
50
- Your AI agent already has an LLM. What it doesn't have: access to the live internet, research tools, market data, or a way to pay for services autonomously.
50
+ **Claude Code (recommended)**
51
+ ```bash
52
+ claude mcp add blockrun npx @blockrun/mcp
53
+ ```
51
54
 
52
- BlockRun fills this gap. Every tool call is a real micropayment authorized locally by a wallet the agent controls. No API keys to manage, no vendor accounts to create. Just a wallet and USDC.
55
+ **Claude Desktop**add to `claude_desktop_config.json`:
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "blockrun": {
60
+ "command": "npx",
61
+ "args": ["-y", "@blockrun/mcp"]
62
+ }
63
+ }
64
+ }
65
+ ```
53
66
 
54
- For multi-agent systems: parent agents can delegate spending limits to child agents by `agent_id`. When a child hits its limit, further calls are automatically blocked.
67
+ **Hosted (no install, always latest)**
68
+ ```bash
69
+ claude mcp add --transport http blockrun https://mcp.blockrun.ai/mcp
70
+ ```
55
71
 
56
72
  ---
57
73
 
58
- ## Funding Your Wallet
59
-
60
- ```
61
- # Check your wallet address
62
- blockrun_wallet action:"status"
63
- ```
74
+ ## Fund your wallet
64
75
 
65
- Send USDC on Base network to your wallet address. $5 gets you started — that's ~500 Exa searches or ~50,000 Gemini Flash calls.
76
+ Run `blockrun_wallet` to see your address. Send USDC on Base.
66
77
 
67
78
  | Method | Steps |
68
79
  |--------|-------|
69
- | Coinbase | Send → USDC → Select "Base" network → Paste address |
70
- | Bridge | [bridge.base.org](https://bridge.base.org) → Bridge USDC to Base |
80
+ | Coinbase | Send → USDC → Base network → paste address |
81
+ | Bridge from Ethereum | [bridge.base.org](https://bridge.base.org) |
82
+
83
+ $5 covers ~5,000 market queries, ~500 Exa searches, or ~250 image generations.
71
84
 
72
85
  ---
73
86
 
74
- ## How Payments Work
87
+ ## Tools
75
88
 
76
- Every request is paid via the [x402 protocol](https://x402.org) — an open standard for machine-to-machine micropayments. Payments settle in USDC on Base (or Solana). 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.
89
+ | Tool | Data source | Cost |
90
+ |------|-------------|------|
91
+ | `blockrun_markets` | Polymarket, Kalshi, dFlow, Binance Futures | $0.001/query |
92
+ | `blockrun_exa` | Neural web search (Exa) — research, competitors, papers, URL content | $0.01/query |
93
+ | `blockrun_search` | Web + news with citations | ~$0.01 |
94
+ | `blockrun_twitter` | X/Twitter — profiles, tweets, trends, Grok sentiment | per token |
95
+ | `blockrun_dex` | Live DEX prices via DexScreener | free |
96
+ | `blockrun_image` | DALL-E 3, Flux image generation + editing | $0.02–0.08 |
97
+ | `blockrun_chat` | GPT-4o, Gemini, DeepSeek, 30+ models | per token |
98
+ | `blockrun_wallet` | Balance, spending, agent budgets | free |
77
99
 
78
100
  ---
79
101
 
80
- ## Configuration
102
+ ## Why not just use the APIs directly?
81
103
 
82
- | Variable | Description |
83
- |----------|-------------|
84
- | `BLOCKRUN_WALLET_KEY` | Bring your own private key (hex for Base, bs58 for Solana). Optional — a wallet is auto-generated if not set. |
104
+ | | Direct APIs | BlockRun |
105
+ |---|---|---|
106
+ | Exa | Sign up, $20/mo minimum | $0.01/call, no subscription |
107
+ | Polymarket | Undocumented, rate-limited | $0.001/call, clean JSON |
108
+ | Twitter/X API | $100–$5000/month | $0.03/page, no approval |
109
+ | Multiple sources | 4 accounts, 4 API keys, 4 billing pages | 1 wallet |
85
110
 
86
- Wallet resolution order:
87
- 1. `BLOCKRUN_WALLET_KEY` environment variable
88
- 2. `BASE_CHAIN_WALLET_KEY` environment variable
89
- 3. `~/.blockrun/.session` (auto-created on first use)
111
+ One wallet. All sources. No dashboards.
90
112
 
91
113
  ---
92
114
 
93
- ## Links
115
+ ## Multi-agent budget delegation
94
116
 
95
- - **Website:** [blockrun.ai](https://blockrun.ai)
96
- - **npm:** [@blockrun/mcp](https://www.npmjs.com/package/@blockrun/mcp)
97
- - **Hosted MCP:** [mcp.blockrun.ai/mcp](https://mcp.blockrun.ai/mcp)
98
- - **GitHub:** [github.com/blockrunai/blockrun-mcp](https://github.com/blockrunai/blockrun-mcp)
99
- - **Telegram:** [t.me/+mroQv4-4hGgzOGUx](https://t.me/+mroQv4-4hGgzOGUx)
100
- - **X:** [@BlockRunAI](https://x.com/BlockRunAI)
117
+ 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.
101
118
 
102
119
  ---
103
120
 
104
- ## License
121
+ ## How it works
122
+
123
+ Pay-per-call via [x402](https://x402.org) micropayments in USDC on Base. Your wallet lives at `~/.blockrun/.session`. Private key never leaves your machine.
124
+
125
+ ---
105
126
 
106
- MIT
127
+ [blockrun.ai](https://blockrun.ai) · [npm](https://www.npmjs.com/package/@blockrun/mcp) · [@BlockRunAI](https://x.com/BlockRunAI)
package/dist/index.js CHANGED
@@ -132,7 +132,6 @@ import { z } from "zod";
132
132
 
133
133
  // src/utils/qr.ts
134
134
  import QRCode from "qrcode";
135
- import { Jimp } from "jimp";
136
135
  import open from "open";
137
136
  import * as fs2 from "fs";
138
137
  function getEip681Uri(address, amountUsdc = 1) {
@@ -141,28 +140,16 @@ function getEip681Uri(address, amountUsdc = 1) {
141
140
  }
142
141
  async function generateQrPng(address) {
143
142
  const eip681Uri = getEip681Uri(address);
144
- const qrBuffer = await QRCode.toBuffer(eip681Uri, {
143
+ if (!fs2.existsSync(WALLET_DIR)) {
144
+ fs2.mkdirSync(WALLET_DIR, { recursive: true, mode: 448 });
145
+ }
146
+ await QRCode.toFile(QR_FILE, eip681Uri, {
145
147
  type: "png",
146
148
  width: 400,
147
149
  margin: 2,
148
150
  errorCorrectionLevel: "H",
149
151
  color: { dark: "#000000", light: "#FFFFFF" }
150
152
  });
151
- const qrImage = await Jimp.read(qrBuffer);
152
- try {
153
- const logoUrl = "https://avatars.githubusercontent.com/u/108554348?s=200&v=4";
154
- const logo = await Jimp.read(logoUrl);
155
- const logoSize = Math.floor(qrImage.width * 0.2);
156
- logo.resize({ w: logoSize, h: logoSize });
157
- const x = Math.floor((qrImage.width - logoSize) / 2);
158
- const y = Math.floor((qrImage.height - logoSize) / 2);
159
- qrImage.composite(logo, x, y);
160
- } catch {
161
- }
162
- if (!fs2.existsSync(WALLET_DIR)) {
163
- fs2.mkdirSync(WALLET_DIR, { recursive: true, mode: 448 });
164
- }
165
- await qrImage.write(QR_FILE);
166
153
  return QR_FILE;
167
154
  }
168
155
  async function openQrInViewer(qrPath) {
@@ -870,8 +857,8 @@ Example paths:
870
857
  Pricing: $0.001/GET, $0.005/POST`,
871
858
  inputSchema: {
872
859
  path: z8.string().describe("Endpoint path, e.g. 'polymarket/events', 'kalshi/markets/KXBTC-25MAR14'"),
873
- params: z8.record(z8.string()).optional().describe("Query parameters for GET requests"),
874
- body: z8.record(z8.unknown()).optional().describe("JSON body for POST queries (triggers pmQuery)")
860
+ params: z8.record(z8.string(), z8.string()).optional().describe("Query parameters for GET requests"),
861
+ body: z8.any().optional().describe("JSON body for POST queries (triggers pmQuery)")
875
862
  }
876
863
  },
877
864
  async ({ path: path2, params, body }) => {
@@ -1026,12 +1013,12 @@ function initializeMcpServer(server) {
1026
1013
  async function main() {
1027
1014
  const server = new McpServer({
1028
1015
  name: "blockrun-mcp",
1029
- version: "0.6.2"
1016
+ version: "0.6.4"
1030
1017
  });
1031
1018
  initializeMcpServer(server);
1032
1019
  const transport = new StdioServerTransport();
1033
1020
  await server.connect(transport);
1034
- console.error("BlockRun MCP Server started (v0.6.2) \u2014 stdio transport");
1021
+ console.error("BlockRun MCP Server started (v0.6.4) \u2014 stdio transport");
1035
1022
  }
1036
1023
  main().catch((error) => {
1037
1024
  console.error("Fatal error:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/mcp",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "mcpName": "io.github.BlockRunAI/blockrun-mcp",
5
5
  "description": "BlockRun MCP Server - Give your AI agent web search, deep research, prediction markets, crypto data, X/Twitter intelligence. Paid via x402 micropayments.",
6
6
  "type": "module",
@@ -46,7 +46,6 @@
46
46
  "dependencies": {
47
47
  "@blockrun/llm": "^1.5.0",
48
48
  "@modelcontextprotocol/sdk": "^1.0.0",
49
- "jimp": "^1.6.0",
50
49
  "open": "^11.0.0",
51
50
  "qrcode": "^1.5.4",
52
51
  "viem": "^2.21.0",