agent402-mcp 0.13.5 → 0.13.7

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # agent402-mcp
2
2
 
3
- MCP server for [Agent402](https://agent402.tools), the applied layer of [Agentic Finance](https://agent402.tools/agentic-finance) - a catalog of **500+: 400+ pay-per-call web tools + 80+ curated multi-tool skill packs** for AI agents (every one tested, priced, and settled on-chain; every one earns its place), paid per call in USDC via the [x402 protocol](https://www.x402.org), **with compute (proof-of-work)** when no wallet is configured, or **by card** through a prepaid credits key. (The hosted API is dual-stack: it also accepts [MPP](https://agent402.tools/what-is-mpp) clients on the same 402, settling on Base/Celo or natively on Tempo; this package pays via x402 or credits.) Built by [Havok Holdings LLC](https://github.com/MikeyPetrillo/Agent402).
3
+ MCP server for [Agent402](https://agent402.tools), the applied layer of [Agentic Finance](https://agent402.tools/agentic-finance) - a catalog of **500+ pay-per-call web tools and curated multi-tool skill packs** for AI agents, paid per call in USDC via the [x402 protocol](https://www.x402.org), **with compute (proof-of-work)** when no wallet is configured, or through a prepaid credits key already issued. (The hosted API is dual-stack: it also accepts [MPP](https://agent402.tools/what-is-mpp) clients on the same 402, settling on Base/Celo or natively on Tempo; this package pays via x402 or credits.) Built by [Havok Holdings LLC](https://github.com/MikeyPetrillo/Agent402).
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** (US equity quotes and daily bars from Databento, 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 200+ deterministic pure-CPU utilities - plus 100+ **skill packs** like `security-audit`, `trend-analysis`, `structured-scrape`, `decode-blob`, and `forecasting-bake-off` callable as MCP prompts, and the **report products** (deep research, company dossier, 13F fund report, domain audit, token risk, FDA recall, insider flow, market brief) as ordinary catalog slugs. 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** (US equity quotes and daily bars from Databento, 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 the pure-CPU utilities - plus **skill packs** like `security-audit`, `trend-analysis`, `structured-scrape`, `decode-blob`, and `forecasting-bake-off` callable as MCP prompts, and the **report products** (deep research, company dossier, 13F fund report, domain audit, token risk, FDA recall, insider flow, market brief) as ordinary catalog slugs. Payment handled invisibly underneath the MCP calls. No signup, no API key.
6
6
 
7
7
  ## Quick start
8
8
 
@@ -10,10 +10,10 @@ Your agent gets browser rendering, screenshots, PDF text extraction, URL→markd
10
10
  MCP server - e.g. claude.ai → Settings → Connectors → Add custom connector. The
11
11
  pure-CPU tools run free there (rate-limited), and the paid tools are payable
12
12
  right on the connector over [MPP](https://agent402.tools/what-is-mpp): a paid
13
- call answers with a tool result carrying the challenges in `_meta["org.paymentauth/payment-required"]` (`-32043` if a presented credential was refused), and an MCP client
13
+ call answers JSON-RPC error `-32042` carrying the challenges (`-32043` if a presented credential was refused), and an MCP client
14
14
  wrapped with `mppx`'s `McpClient.wrap()` (USDC on Base/Celo, or native Tempo)
15
15
  pays and retries on its own, receipt in `_meta`. For no rate limit, or to pay
16
- over x402 or by card instead, run this package locally:
16
+ over x402 or with a credits key already issued, run this package locally:
17
17
 
18
18
  With a funded wallet (USDC on any EVM rail the server offers - Base, Polygon, Arbitrum, Monad, Celo, Avalanche, Sei, Optimism - or USDG on Robinhood Chain, or USDC on Solana via `SOLANA_AGENT_KEY`; the service also settles on Stellar and Algorand, which this package does not sign) - every tool available:
19
19
 
@@ -29,7 +29,7 @@ With a funded wallet (USDC on any EVM rail the server offers - Base, Polygon, Ar
29
29
  }
30
30
  ```
31
31
 
32
- With prepaid card credits (no wallet) - buy a pack at https://agent402.tools/credits, claim the `a402_...` key once, and every tool is available:
32
+ With a prepaid credits key already issued (new credits are not on sale) - every tool except the wallet-scoped ones (memory, usage) is available:
33
33
 
34
34
  ```json
35
35
  {
@@ -43,7 +43,7 @@ With prepaid card credits (no wallet) - buy a pack at https://agent402.tools/cre
43
43
  }
44
44
  ```
45
45
 
46
- Without a wallet or credits key - the 150+ pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet or a credits key):
46
+ Without a wallet or credits key - the pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet or a credits key):
47
47
 
48
48
  ```json
49
49
  {
@@ -61,9 +61,9 @@ Every variable the server reads (all optional):
61
61
 
62
62
  | env | default | meaning |
63
63
  | --- | --- | --- |
64
- | `AGENT_KEY` | _(unset)_ | Hex private key of an EVM wallet funded with USDC on Base (or Polygon/Arbitrum/Monad), or USDG on Robinhood Chain. |
64
+ | `AGENT_KEY` | _(unset)_ | Hex private key of an EVM wallet funded with USDC on Base (or another EVM chain the server offers), or USDG on Robinhood Chain. |
65
65
  | `SOLANA_AGENT_KEY` | _(unset)_ | Base58 secret key (or JSON byte array) of a Solana wallet funded with USDC on Solana. |
66
- | `AGENT402_CREDITS_KEY` | _(unset)_ | A prepaid card-credits key (`a402_...`) from https://agent402.tools/credits. Sent as `Authorization: Bearer` on every catalog call; the server debits the list price only on a successful (200) call and answers `X-Credits-Balance`. Used only when no wallet key is set (a wallet key wins); in credits mode every call - pure-CPU tools included - is debited from the key. |
66
+ | `AGENT402_CREDITS_KEY` | _(unset)_ | A prepaid credits key (`a402_...`) already issued (new credits are not on sale). Sent as `Authorization: Bearer` on every catalog call; the server debits the list price only on a successful (200) call and answers `X-Credits-Balance`. Used only when no wallet key is set (a wallet key wins); in credits mode every call - pure-CPU tools included - is debited from the key. |
67
67
  | `AGENT402_URL` | `https://agent402.tools` | Target service (point at your own deployment). |
68
68
  | `AGENT402_TOOLS` | curated set | Comma-separated slugs to expose as first-class tools. |
69
69
  | `AGENT402_MAX_PER_CALL` | unlimited | Refuse any single call priced above this many USD (e.g. `0.01`). Applies to the wallet and the credits path. |
@@ -76,7 +76,7 @@ caps, what's been spent, and what remains. With no wallet key and no credits key
76
76
  the server runs in proof-of-work mode (pure-CPU tools stay free). Use dedicated
77
77
  low-value wallets for `AGENT_KEY` / `SOLANA_AGENT_KEY`, funded only with what
78
78
  you intend to spend. Most tools cost $0.001–$0.02. The routing tiers top out
79
- at $3.30 (`route-execute-pro`); multi-tool skill packs run $0.003 to $0.119; and the
79
+ at $3.30 (`route-execute-pro`); multi-tool skill packs run $0.003 to $0.101; and the
80
80
  report products run $0.60 to $2.00 per report (domain-audit $0.60 up to the ticker pack at $2.00),
81
81
  so set `AGENT402_MAX_PER_CALL` if you want a hard per-call ceiling.
82
82
 
@@ -84,8 +84,9 @@ so set `AGENT402_MAX_PER_CALL` if you want a hard per-call ceiling.
84
84
 
85
85
  - On startup the server reads the live catalog from `https://agent402.tools/api/pricing` + `/openapi.json`.
86
86
  - **Flagship tools** are exposed as first-class MCP tools under dotted names - `web.search`, `web.answer`, `web.news`, `browser.render`, `market.quote`, `audio.transcribe`, `memory.read`, `memory.write` - search/answer is the front door. Override the set with `AGENT402_TOOLS` (slugs; a non-flagship slug is listed as its snake_case name).
87
- - The rest of the 500+ endpoint catalog is reachable via the meta tools `catalog.search` / `catalog.find` + `catalog.call` - keeping your context window small. The same dotted names are listed on the hosted connector; the older snake names (`search_tools`, `find_tool`, `call_tool`, `get_payment_info`, `describe_server`, `list_top_sellers`, and the flagship `search_web` …) remain accepted as CallTool aliases, so existing configs keep working.
88
- - When a call hits HTTP 402: with a wallet key set (`AGENT_KEY` for the EVM chains - Base/Polygon/Arbitrum/Monad plus Robinhood Chain, `SOLANA_AGENT_KEY` for Solana), the server signs an x402 payment on a chain the seller accepts and retries; with only a credits key it sends `Authorization: Bearer a402_…` and the server debits the balance on success; with neither it solves the tool's proof-of-work challenge (~0.2 s of CPU) on the eligible tools. (The service settles USDC on Base, Solana, Polygon, Arbitrum, Monad, Celo, Avalanche, Sei, Optimism, Stellar and Algorand, plus USDG on Robinhood Chain - 12 chains total - for callers using a raw x402 client rather than this package.)
87
+ - **Decide** (`decide.plan`, `decide.execute`, `decide.feedback`): describe a job and get a call-ready plan over the catalog and outside x402 sellers (tools in order, fallbacks, validated params, chained steps), then run it yourself or through Agent402. Listed when the server offers Decide; see https://agent402.tools/decide.
88
+ - The rest of the 500+ tool catalog is reachable via the meta tools `catalog.search` / `catalog.find` + `catalog.call` - keeping your context window small. The same dotted names are listed on the hosted connector; the older snake names (`search_tools`, `find_tool`, `call_tool`, `get_payment_info`, `describe_server`, `list_top_sellers`, and the flagship `search_web` …) remain accepted as CallTool aliases, so existing configs keep working.
89
+ - When a call hits HTTP 402: with a wallet key set (`AGENT_KEY` for the EVM chains, Robinhood Chain included; `SOLANA_AGENT_KEY` for Solana), the server signs an x402 payment on a chain the seller accepts and retries; with only a credits key it sends `Authorization: Bearer a402_…` and the server debits the balance on success; with neither it solves the tool's proof-of-work challenge (~0.2 s of CPU) on the eligible tools. (The service settles USDC on Base, Solana, Polygon, Arbitrum, Monad, Celo, Avalanche, Sei, Optimism, Stellar and Algorand, plus USDG on Robinhood Chain - 12 chains total - for callers using a raw x402 client rather than this package.)
89
90
  - `payment.info` tells the model which mode it's in and what a wallet or a credits key would unlock.
90
91
  - `server.describe` returns orientation (flagship-first tools, install one-liners, free vs paid, discovery URLs). Call it first.
91
92
  - `sellers.list` returns the live leaderboards - `wire: "x402"` (default) ranks x402 sellers settling the most USDC (primarily on Base) in the last ~24h from on-chain transfers; `wire: "mpp"` ranks live-verified MPP sellers by inbound USDC.e transfers on Tempo. Free to call (no payment, no proof-of-work). Useful for agents discovering the wider x402 / MPP economy beyond this single service's catalog.
package/index.js CHANGED
@@ -17,8 +17,8 @@
17
17
  // SOLANA_AGENT_KEY base58 (or JSON byte-array) secret key of a funded Solana wallet (USDC on Solana) — optional
18
18
  // AGENT402_TOOLS comma-separated slugs to expose first-class (overrides default)
19
19
  // AGENT402_MAX_PER_CALL refuse any single call priced above this many USD (e.g. 0.01)
20
- // AGENT402_CREDITS_KEY a prepaid card-credits key (a402_...) from https://agent402.tools/credits -
21
- // pays every tool by card with no wallet; debited per successful call
20
+ // AGENT402_CREDITS_KEY a prepaid credits key (a402_...) already issued (new credits are not on
21
+ // sale); pays per successful call with no wallet
22
22
  // AGENT402_BUDGET hard cap on total USDC spent this session (e.g. 1.00)
23
23
  // AGENT402_NETWORKS restrict + order the chains to pay on (e.g. "robinhood" for USDG on
24
24
  // Robinhood Chain, "base,solana", or a raw CAIP-2 like eip155:4663) — optional
@@ -53,7 +53,7 @@ const AGENT_KEY = process.env.AGENT_KEY || "";
53
53
  // settle on whichever chain the seller offers (EVM accepts are tried first).
54
54
  const SOLANA_AGENT_KEY = process.env.SOLANA_AGENT_KEY || "";
55
55
  const HAS_WALLET = Boolean(AGENT_KEY || SOLANA_AGENT_KEY);
56
- // Prepaid card credits (no wallet): a key bought at https://agent402.tools/credits.
56
+ // Prepaid card credits (no wallet): a key issued at https://agent402.tools/credits.
57
57
  // Sent as Authorization: Bearer on every catalog call; the server debits the
58
58
  // list price only on a successful (200) call and returns X-Credits-Balance.
59
59
  const CREDITS_KEY = (process.env.AGENT402_CREDITS_KEY || "").trim();
@@ -75,6 +75,8 @@ const DEFAULT_CURATED = [
75
75
  // Search/answer is the front door; long tail stays behind catalog.search/catalog.call.
76
76
  "search", "answer", "search-news", "render",
77
77
  "stock-quote", "transcribe", "memory-read", "memory-write",
78
+ // Present only on hosts running the decide service; skipped elsewhere.
79
+ "decide", "decide-execute",
78
80
  ];
79
81
 
80
82
  // stdout is the MCP protocol channel — all logging goes to stderr.
@@ -196,7 +198,7 @@ function walletRequiredText(tool) {
196
198
  `To enable it: set AGENT_KEY on this MCP server to the hex private key of an EVM wallet funded with USDC`,
197
199
  `on Base (or Polygon/Arbitrum), and/or SOLANA_AGENT_KEY to the base58 secret key of a Solana wallet funded`,
198
200
  `with USDC on Solana. Payment is per call via the x402 protocol — no signup or API key.`,
199
- `No wallet? Buy prepaid card credits at ${BASE}/credits and set AGENT402_CREDITS_KEY to the a402_ key - every tool then pays by card, debited per successful call.`,
201
+ `Already hold a prepaid credits key? Set AGENT402_CREDITS_KEY to the a402_ key and it pays per successful call (new credits are not on sale).`,
200
202
  `Pricing and details: ${BASE}/tools/${tool.slug}`,
201
203
  ].join(" ");
202
204
  }
@@ -714,7 +716,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
714
716
  payableWithCompute: computePayable,
715
717
  walletOnly: catalog.size - computePayable,
716
718
  workflows: skillPacks.length,
717
- credits: HAS_CREDITS ? { configured: true, how: "prepaid card credits (Authorization: Bearer a402_...) - every tool pays by card, debited only on a successful call", balance: `${BASE}/api/credits/balance`, topup: `${BASE}/credits` } : { configured: false, buy: `${BASE}/credits` },
719
+ credits: HAS_CREDITS ? { configured: true, how: "prepaid card credits (Authorization: Bearer a402_...) - every wallet-only tool except the wallet-identity-bound ones (memory, usage, receipts, attest, feedback) pays from the balance, debited only on a successful call", balance: `${BASE}/api/credits/balance`, topup: `${BASE}/credits` } : { configured: false, buy: `${BASE}/credits` },
718
720
  spendControls: (HAS_WALLET || HAS_CREDITS)
719
721
  ? {
720
722
  maxPerCallUsd: MAX_PER_CALL === Infinity ? "unlimited" : MAX_PER_CALL,
@@ -727,7 +729,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
727
729
  ? "Every tool is available; each call is paid in USDC via x402 from the configured wallet(s) - EVM chains via AGENT_KEY, Solana via SOLANA_AGENT_KEY - within the spend controls above."
728
730
  : HAS_CREDITS
729
731
  ? "Every tool is available; each call is paid from the prepaid card credits key (AGENT402_CREDITS_KEY), debited only on a successful call, within the spend controls above."
730
- : `No wallet or credits key configured: ${computePayable} pure-CPU tools are free via proof-of-work; the ${catalog.size - computePayable} network/browser/memory tools need a funded wallet (AGENT_KEY / SOLANA_AGENT_KEY) or a prepaid credits key (AGENT402_CREDITS_KEY, buy at ${BASE}/credits).`,
732
+ : `No wallet or credits key configured: ${computePayable} pure-CPU tools are free via proof-of-work; the ${catalog.size - computePayable} network/browser/memory tools need a funded wallet (AGENT_KEY / SOLANA_AGENT_KEY) or a prepaid credits key already issued (AGENT402_CREDITS_KEY).`,
731
733
  install: {
732
734
  claudeCodeHosted: `claude mcp add --transport http agent402 ${BASE}/mcp`,
733
735
  claudeCodeNpm: "claude mcp add agent402 -s user -- npx -y agent402-mcp@latest",
package/output-schemas.js CHANGED
@@ -39,6 +39,8 @@ export const FLAGSHIP_MCP_NAMES = {
39
39
  transcribe: "audio.transcribe",
40
40
  "memory-read": "memory.read",
41
41
  "memory-write": "memory.write",
42
+ decide: "decide.plan",
43
+ "decide-execute": "decide.execute",
42
44
  };
43
45
 
44
46
  /** Meta tools listed alongside flagships — dotted canonical names. */
@@ -91,11 +93,11 @@ export function resolveListedName(name) {
91
93
 
92
94
  /** Open-world / egress tools — honest annotations for directory clients. */
93
95
  export const FLAGSHIP_OPEN_WORLD = new Set([
94
- "search", "answer", "search-news", "render", "stock-quote", "transcribe",
96
+ "search", "answer", "search-news", "render", "stock-quote", "transcribe", "decide",
95
97
  ]);
96
98
 
97
99
  /** Tools that mutate durable state (not read-only). */
98
- export const FLAGSHIP_WRITERS = new Set(["memory-write"]);
100
+ export const FLAGSHIP_WRITERS = new Set(["memory-write", "decide-execute"]);
99
101
 
100
102
  /** initialize.serverInfo description (MCP Implementation.description). */
101
103
  export const MCP_SERVER_DESCRIPTION =
@@ -503,7 +505,7 @@ export function mcpInstallHints(baseUrl) {
503
505
  * server.describe. Keep tool names listed-only (dotted Smithery form) (self-consistency) and lead
504
506
  * with search/answer as the front door.
505
507
  */
506
- export function mcpInitializeInstructions(baseUrl) {
508
+ export function mcpInitializeInstructions(baseUrl, { decide = false } = {}) {
507
509
  const install = mcpInstallHints(baseUrl);
508
510
  const hosted = install.hostedUrl;
509
511
  return [
@@ -511,12 +513,15 @@ export function mcpInitializeInstructions(baseUrl) {
511
513
  "Front door: call web.search or web.answer for live web search and cited answers.",
512
514
  "Also listed: web.news, browser.render, market.quote, audio.transcribe, memory.read, memory.write.",
513
515
  "Long catalog (500+ tools): call catalog.find with your task, or catalog.search then catalog.call.",
516
+ // Only where the decide tools are listed: an instruction must never name a
517
+ // tool the connector does not advertise.
518
+ ...(decide ? ["A job that needs several tools: call decide.plan with the task for a call-ready plan (tools, order, fallbacks, inputs), then decide.execute to run it; the plan fee comes back as credit toward the run."] : []),
514
519
  "Orientation: call server.describe. Payment rails / wallet setup: call payment.info.",
515
520
  "Missing a tool: call demand.request. Ecosystem sellers: call sellers.list.",
516
521
  `Install (hosted, zero wallet): ${install.claudeCodeHosted}`,
517
- `Install (npm + wallet or prepaid card credits for paid flagships): ${install.claudeCodeNpm}`,
522
+ `Install (npm + wallet for paid flagships): ${install.claudeCodeNpm}`,
518
523
  `Cursor mcp.json: { "mcpServers": { "agent402": { "url": "${hosted}" } } }`,
519
- `Why pay here (usage priced under a quoted ceiling, a failed call is not charged and the receipt proves it, keyed retries never pay twice, one key for tools + models + reports, card credits with no wallet, proof at /status and /revenue): ${baseUrl}/why`,
524
+ `Why pay here (usage priced under a quoted ceiling, a failed call is not charged and the receipt proves it, keyed retries never pay twice, one key for tools + models + reports, no wallet needed for the proof-of-work tools or a report by card, proof at /status and /revenue): ${baseUrl}/why`,
520
525
  `Docs: ${baseUrl}/llms.txt · ${baseUrl}/api/find?q=… · status ${baseUrl}/status`,
521
526
  ].join("\n");
522
527
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent402-mcp",
3
- "version": "0.13.5",
3
+ "version": "0.13.7",
4
4
  "mcpName": "io.github.MikeyPetrillo/agent402",
5
5
  "author": "Havok Holdings LLC <mike@agent402.tools> (https://agent402.tools)",
6
6
  "homepage": "https://agent402.tools",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/MikeyPetrillo/Agent402.git",
10
10
  "directory": "mcp"
11
11
  },
12
- "description": "Agent402 MCP server: 500+ pay-per-call tools + skill packs for AI agents over x402 (USDC on 12 chains) or MPP on the same 402, or free via proof-of-work - the applied layer of Agentic Finance. Catalog: browser, web search + cited answers, PDFs, OCR, images, LLM inference, image generation, code execution, STT, embeddings, live financial/crypto/macro data, SEC EDGAR filings, deterministic stats & forecasting, compression, payments. Open source, self-hostable.",
12
+ "description": "Agent402 MCP server: 500+ pay-per-call tools + skill packs for AI agents over x402 (USDC or USDG on 12 chains) or MPP on the same 402, or free via proof-of-work - the applied layer of Agentic Finance. Catalog: browser, web search + cited answers, PDFs, OCR, images, LLM inference, image generation, code execution, STT, embeddings, live financial/crypto/macro data, SEC EDGAR filings, deterministic stats & forecasting, compression, payments. Open source, self-hostable.",
13
13
  "type": "module",
14
14
  "bin": {
15
15
  "agent402-mcp": "index.js"
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "license": "MIT",
71
71
  "dependencies": {
72
- "@modelcontextprotocol/sdk": "^1.30.1",
72
+ "@modelcontextprotocol/sdk": "^1.31.0",
73
73
  "@solana/kit": "^5.1.0",
74
74
  "@x402/core": "2.27.0",
75
75
  "@x402/evm": "2.27.0",
@@ -81,9 +81,9 @@
81
81
  "qs": "6.16.0",
82
82
  "ws": "^8.21.0",
83
83
  "hono": "4.13.7",
84
- "fast-uri": "3.1.7",
84
+ "fast-uri": "3.1.8",
85
85
  "body-parser": "2.3.0",
86
86
  "@hono/node-server": "2.0.12",
87
- "ip-address": "10.4.0"
87
+ "ip-address": "10.7.1"
88
88
  }
89
89
  }