agent402-mcp 0.7.1 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +5 -4
  2. package/index.js +63 -1
  3. package/package.json +10 -4
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # agent402-mcp
2
2
 
3
- MCP server for [Agent402](https://agent402.tools) — 1,100+ pay-per-call web tools for AI agents, paid per call in USDC via the [x402 protocol](https://www.x402.org), or **with compute (proof-of-work)** when no wallet is configured. Built by [Mikey Petrillo](https://github.com/MikeyPetrillo).
3
+ MCP server for [Agent402](https://agent402.tools) — **1,199 pay-per-call web tools** and **39 curated multi-tool skill packs** for AI agents, paid per call in USDC via the [x402 protocol](https://www.x402.org), or **with compute (proof-of-work)** when no wallet is configured. Built by [Mikey Petrillo](https://github.com/MikeyPetrillo).
4
4
 
5
- Your agent gets browser rendering, screenshots, PDF text extraction, URL→markdown, live web search **+ web answers with citations**, live **financial/crypto/macro data** (Yahoo stock quotes, CoinGecko, FRED, ECB FX, World Bank, yield curve), **SEC EDGAR filings** (10-K/10-Q text, XBRL, insider, 13F, IPO calendar), DNS/TLS/WHOIS, wallet-keyed shared memory, and ~1,040 utility/conversion tools — with payment handled invisibly underneath the MCP calls. No signup, no API key.
5
+ Your agent gets browser rendering, screenshots, PDF text extraction, URL→markdown, live web search **+ web answers with citations**, live **financial/crypto/macro data** (Yahoo stock quotes, CoinGecko, FRED, ECB FX, World Bank, yield curve), **SEC EDGAR filings** (10-K/10-Q text, XBRL, insider, 13F, IPO calendar), **deterministic stats & forecasting** (Pearson correlation, OLS, Holt-Winters), **compression** (gzip/brotli), DNS/TLS/WHOIS + email-deliverability checks, wallet-keyed shared memory, and ~1,000 utility/conversion tools — plus 39 **skill packs** like `security-audit`, `trend-analysis`, `structured-scrape`, `decode-blob`, and `forecasting-bake-off` callable as MCP prompts. Payment handled invisibly underneath the MCP calls. No signup, no API key.
6
6
 
7
7
  ## Quick start
8
8
 
@@ -25,7 +25,7 @@ With a funded wallet (USDC on Base) — every tool available:
25
25
  }
26
26
  ```
27
27
 
28
- Without a wallet — the ~1000 pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet):
28
+ Without a wallet — the ~1,100 pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet):
29
29
 
30
30
  ```json
31
31
  {
@@ -41,9 +41,10 @@ Claude Code: `claude mcp add agent402 -- npx -y agent402-mcp`
41
41
 
42
42
  - On startup the server reads the live catalog from `https://agent402.tools/api/pricing` + `/openapi.json`.
43
43
  - The high-value tools (`extract`, `render`, `screenshot`, `pdf`, `meta`, `dns`, `http-check`, `tls-cert`, `whois`, the `memory-*` coordination tools, `hash`) are exposed as first-class MCP tools.
44
- - The other ~1000 tools are reachable via `search_tools` (find by description) + `call_tool` (call by slug) — keeping your context window small.
44
+ - The other ~1,185 tools are reachable via `search_tools` (find by description) + `call_tool` (call by slug) — keeping your context window small.
45
45
  - When a call hits HTTP 402: with `AGENT_KEY` set, the server signs an x402 USDC payment and retries; without a key it solves the tool's proof-of-work challenge (~0.2 s of CPU) on the eligible tools.
46
46
  - `payment_info` tells the model which mode it's in and what a wallet would unlock.
47
+ - `top_x402_sellers` returns the live x402 leaderboard — which sellers are settling the most USDC on Base in the last ~24h, derived from on-chain transfers. Free to call (no payment, no proof-of-work). Useful for agents discovering the wider x402 economy beyond this single service's catalog.
47
48
 
48
49
  ## Workflows (skill packs)
49
50
 
package/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
 
29
29
  const BASE = (process.env.AGENT402_URL || "https://agent402.tools").replace(/\/$/, "");
30
30
  const AGENT_KEY = process.env.AGENT_KEY || "";
31
- const VERSION = "0.6.0";
31
+ const VERSION = "0.8.0";
32
32
 
33
33
  // Spend controls — enforced BEFORE a payment is ever signed, so a confused or
34
34
  // runaway model cannot drain the wallet. Unset = unlimited (back-compat).
@@ -332,6 +332,22 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
332
332
  name: "payment_info",
333
333
  description: "How this MCP server is paying for Agent402 calls (USDC wallet vs proof-of-work), and what that unlocks.",
334
334
  inputSchema: { type: "object", properties: {} },
335
+ },
336
+ // Discovery primitive: who's earning USDC on x402 right now? Proxies the
337
+ // hosted /api/leaderboard (free, unpaywalled) and trims to the same compact
338
+ // shape as the hosted MCP connector so cross-surface agents see the same UX.
339
+ {
340
+ name: "top_x402_sellers",
341
+ description:
342
+ "List the x402 sellers earning the most USDC (or serving the most calls) on Base in the last ~24h, derived from on-chain USDC transfers. Useful for agents discovering the live x402 economy: who's getting paid, which networks, and where to point demand. Free to call (no payment, no proof-of-work). Defaults: top 10, sort by USDC, exclude this service's own wallet.",
343
+ inputSchema: {
344
+ type: "object",
345
+ properties: {
346
+ limit: { type: "number", description: "Max rows to return (default 10, max 50)" },
347
+ sort: { type: "string", enum: ["usd", "calls"], description: "Rank by USDC settled (default) or by call count" },
348
+ include: { type: "string", enum: ["external", "all"], description: "'external' (default) hides this service's own wallet; 'all' includes it" },
349
+ },
350
+ },
335
351
  }
336
352
  );
337
353
  return { tools };
@@ -387,6 +403,52 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
387
403
  note: AGENT_KEY
388
404
  ? "Every tool is available; each call is paid in USDC via x402 from the configured wallet, within the spend controls above."
389
405
  : `No AGENT_KEY configured: ${computePayable} pure-CPU tools are free via proof-of-work; the ${catalog.size - computePayable} network/browser/memory tools need a funded wallet (set AGENT_KEY).`,
406
+ ecosystem: "Call top_x402_sellers to see which x402 sellers (any wallet, not just this host) are settling the most USDC on Base in the last 24h — discovers the live economy beyond this catalog.",
407
+ }, null, 2),
408
+ }],
409
+ };
410
+ }
411
+ if (name === "top_x402_sellers") {
412
+ const limit = Math.min(Math.max(parseInt(args.limit, 10) || 10, 1), 50);
413
+ const sort = args.sort === "calls" ? "calls" : "usd";
414
+ const include = args.include === "all" ? "all" : "external";
415
+ // /api/leaderboard is free + unpaywalled, so this stays free regardless
416
+ // of payment mode. Honor its query params verbatim so the surface is a
417
+ // thin pass-through — single source of truth for ranking + filtering.
418
+ const url = new URL(`${BASE}/api/leaderboard`);
419
+ url.searchParams.set("top", String(limit));
420
+ url.searchParams.set("sort", sort);
421
+ url.searchParams.set("include", include);
422
+ const res = await fetch(url);
423
+ if (!res.ok) {
424
+ return { content: [{ type: "text", text: `Failed to fetch leaderboard from ${BASE}: HTTP ${res.status}` }], isError: true };
425
+ }
426
+ const snap = await res.json();
427
+ // Trim to the same compact row shape the hosted MCP connector returns —
428
+ // cross-surface agents see one mental model. Full row (origins,
429
+ // endpoints, scan metadata) stays accessible at /api/leaderboard.
430
+ const rows = (snap.leaderboard || []).map((r) => ({
431
+ rank: r.rank,
432
+ name: r.name,
433
+ network: r.network,
434
+ wallet: r.wallet,
435
+ homepage: r.homepage || null,
436
+ callsSettled: r.callsSettled || 0,
437
+ totalUsd: Math.round((r.totalUsd || 0) * 10000) / 10000,
438
+ uniqueBuyers: r.uniqueBuyers || 0,
439
+ }));
440
+ return {
441
+ content: [{
442
+ type: "text",
443
+ text: JSON.stringify({
444
+ window: snap.windowLabel || snap.windowServed || "24h",
445
+ asOf: snap.asOf,
446
+ sort: snap.sortServed || sort,
447
+ include: snap.include || include,
448
+ totalSellers: snap.totalSellers ?? (snap.leaderboard || []).length,
449
+ results: rows,
450
+ ...(snap.warming || snap.scanSkipped ? { note: "Cache is warming — results may be partial. Retry in ~60s." } : {}),
451
+ source: `${BASE}/api/leaderboard`,
390
452
  }, null, 2),
391
453
  }],
392
454
  };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "agent402-mcp",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "mcpName": "io.github.MikeyPetrillo/agent402",
5
- "author": "Mikey Petrillo (https://github.com/MikeyPetrillo)",
5
+ "author": "Mikey Petrillo <mike@agent402.tools> (https://github.com/MikeyPetrillo)",
6
6
  "homepage": "https://agent402.tools",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/MikeyPetrillo/Agent402.git"
10
10
  },
11
- "description": "Open-source MCP server exposing Agent402's 1,100+ self-hostable tools for AI agents — browser, web search & answers, PDFs, images, live financial/crypto/macro data, SEC EDGAR filings, payments. Free via proof-of-work, or pay per call in USDC via the x402 protocol.",
11
+ "description": "Open-source MCP server exposing Agent402's 1,199 self-hostable tools + 39 multi-tool skill packs (security-audit, trend-analysis, structured-scrape, decode-blob, forecasting-bake-off) for AI agents — browser, web search & answers, PDFs, OCR, images, live financial/crypto/macro data, SEC EDGAR filings, deterministic stats & forecasting, compression, payments. Free via proof-of-work, or pay per call in USDC via the x402 protocol.",
12
12
  "type": "module",
13
13
  "bin": {
14
14
  "agent402-mcp": "index.js"
@@ -22,9 +22,11 @@
22
22
  },
23
23
  "keywords": [
24
24
  "mcp",
25
+ "mcp-server",
25
26
  "model-context-protocol",
26
27
  "x402",
27
28
  "ai-agents",
29
+ "agent-tools",
28
30
  "llm-tools",
29
31
  "ai-tools",
30
32
  "claude",
@@ -34,7 +36,11 @@
34
36
  "payments",
35
37
  "usdc",
36
38
  "http-402",
37
- "tools"
39
+ "tools",
40
+ "skill-packs",
41
+ "mcp-prompts",
42
+ "workflows",
43
+ "proof-of-work"
38
44
  ],
39
45
  "license": "MIT",
40
46
  "dependencies": {