agent402-mcp 0.12.12 → 0.13.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 CHANGED
@@ -1,15 +1,19 @@
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 + 100+ 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), or **with compute (proof-of-work)** when no wallet is configured. (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.) 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+: 400+ pay-per-call web tools + 100+ 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).
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), **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. 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 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.
6
6
 
7
7
  ## Quick start
8
8
 
9
9
  **Zero install (hosted connector):** add `https://agent402.tools/mcp` as a remote
10
10
  MCP server - e.g. claude.ai → Settings → Connectors → Add custom connector. The
11
- pure-CPU tools run free there (rate-limited); for the full catalog and no rate
12
- limit, run this package locally with a wallet:
11
+ pure-CPU tools run free there (rate-limited), and the paid tools are payable
12
+ right on the connector over [MPP](https://agent402.tools/what-is-mpp): a paid
13
+ call answers JSON-RPC error `-32042` with the challenges (`-32043` if a presented credential was refused), and an MCP client
14
+ wrapped with `mppx`'s `McpClient.wrap()` (USDC on Base/Celo, or native Tempo)
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:
13
17
 
14
18
  With a funded wallet (USDC on Base, Polygon, Arbitrum, Monad, or Solana, or USDG on Robinhood Chain - the underlying service accepts 12 chains in total, but this package currently signs only EVM and Solana payments) - every tool available:
15
19
 
@@ -25,7 +29,21 @@ With a funded wallet (USDC on Base, Polygon, Arbitrum, Monad, or Solana, or USDG
25
29
  }
26
30
  ```
27
31
 
28
- Without a wallet - the 200+ pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet):
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:
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "agent402": {
38
+ "command": "npx",
39
+ "args": ["-y", "agent402-mcp"],
40
+ "env": { "AGENT402_CREDITS_KEY": "a402_YOUR_KEY" }
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ Without a wallet or credits key - the 200+ pure-CPU tools work free via proof-of-work (the network/browser/memory tools will ask for a wallet or a credits key):
29
47
 
30
48
  ```json
31
49
  {
@@ -37,14 +55,40 @@ Without a wallet - the 200+ pure-CPU tools work free via proof-of-work (the netw
37
55
 
38
56
  Claude Code: `claude mcp add agent402 -- npx -y agent402-mcp`
39
57
 
58
+ ## Configuration
59
+
60
+ Every variable the server reads (all optional):
61
+
62
+ | env | default | meaning |
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. |
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. |
67
+ | `AGENT402_URL` | `https://agent402.tools` | Target service (point at your own deployment). |
68
+ | `AGENT402_TOOLS` | curated set | Comma-separated slugs to expose as first-class tools. |
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. |
70
+ | `AGENT402_BUDGET` | unlimited | Hard cap on total USD spent per session (e.g. `1.00`). Applies to the wallet and the credits path. |
71
+ | `AGENT402_NETWORKS` | _(unset)_ | Restrict + order the chains to pay on - e.g. `robinhood` (USDG on Robinhood Chain), `base,solana`, or a raw CAIP-2 like `eip155:4663`. Unset = the client picks (effectively Base on multi-chain sellers). |
72
+
73
+ Spend controls are enforced **before a payment is signed** (or a credits call is
74
+ sent) - a runaway model is refused, not billed. `payment.info` reports the
75
+ caps, what's been spent, and what remains. With no wallet key and no credits key,
76
+ the server runs in proof-of-work mode (pure-CPU tools stay free). Use dedicated
77
+ low-value wallets for `AGENT_KEY` / `SOLANA_AGENT_KEY`, funded only with what
78
+ you intend to spend. Most tools cost $0.001–$0.02. The routing tiers top out
79
+ at $0.55 (`route-execute-max`); multi-tool skill packs run up to $1.50; and the
80
+ report products run $0.20 to $1.10 per report (domain-audit $0.20 up to research-max $1.10),
81
+ so set `AGENT402_MAX_PER_CALL` if you want a hard per-call ceiling.
82
+
40
83
  ## How it works
41
84
 
42
85
  - On startup the server reads the live catalog from `https://agent402.tools/api/pricing` + `/openapi.json`.
43
- - **Flagship tools** (`search`, `answer`, `search-news`, `render`, `stock-quote`, `transcribe`, `memory-read`, `memory-write`) are exposed as first-class MCP tools - search/answer is the front door. Override the set with `AGENT402_TOOLS`.
44
- - The rest of the 500+ endpoint catalog is reachable via `find_tool` / `search_tools` + `call_tool` - keeping your context window small.
45
- - 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; without a key 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.)
46
- - `payment_info` tells the model which mode it's in and what a wallet would unlock.
47
- - `list_top_sellers` returns the live x402 leaderboard - which sellers are settling the most USDC (primarily 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. (Aliases: `list_x402_sellers`, `top_x402_sellers`.)
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.)
89
+ - `payment.info` tells the model which mode it's in and what a wallet or a credits key would unlock.
90
+ - `server.describe` returns orientation (flagship-first tools, install one-liners, free vs paid, discovery URLs). Call it first.
91
+ - `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.
48
92
  - `route_and_execute` reaches tools **outside** this catalog in one call: give it a plain-language `task` and Agent402 resolves a proven external x402 seller (one with real on-chain settled volume), pays that seller on your behalf, and relays the result marked `untrustedContent`. Wallet-only. Flat routing fee, cheapest covering tier chosen from `maxUsd`:
49
93
 
50
94
  | Underlying seller price | Fee | Route |
@@ -54,6 +98,7 @@ Claude Code: `claude mcp add agent402 -- npx -y agent402-mcp`
54
98
  | ≤ $0.50 | $0.55 | `POST /api/route/execute-max` |
55
99
 
56
100
  A tool priced above the tier's ceiling returns a self-correcting 409 naming its direct route.
101
+ - **Report products** are catalog slugs like any other, so `catalog.call` runs them with a wallet or a credits key: `research` ($0.35), `research-pro` ($0.65), `research-max` ($1.10), `market-brief` ($0.35), `dossier` ($0.55), `dossier-max` ($0.95), `fund-report` ($0.25), `fund-report-max` ($0.50), `domain-audit` ($0.20), `domain-audit-pro` ($0.30), `token-risk` ($0.30), `token-risk-pro` ($0.60), `token-brief` ($0.35), `recall-report` ($0.20), `insider-report` ($0.25), `filing-report` ($0.25), `ticker-pack` ($0.75). The same reports are sold to people by card at https://agent402.tools/reports for $1, or $2 for the deepest three: the card price includes payment processing, and an agent paying per call pays the lower tool price for the same report. The recurring monitors (domain, SEC filing, token, fund, recall, insider, IPO - $3/month) are at https://agent402.tools/monitors.
57
102
 
58
103
  ## Workflows (skill packs)
59
104
 
@@ -65,31 +110,10 @@ automatically:
65
110
  - `prompts/list` returns each pack with typed arguments.
66
111
  - `prompts/get { name: "<slug>", arguments: { … } }` returns the rendered
67
112
  task template - a Claude-ready plan with the chosen tools wired in.
68
- - `search_tools` also surfaces matching workflows alongside individual tools,
113
+ - `catalog.search` also surfaces matching workflows alongside individual tools,
69
114
  so a task-shaped query points the agent at the right plan, not just the
70
115
  raw tools.
71
116
 
72
- ## Configuration
73
-
74
- | env | default | meaning |
75
- | --- | --- | --- |
76
- | `AGENT_KEY` | _(unset)_ | Hex private key of an EVM wallet funded with USDC on Base (or Polygon/Arbitrum/Monad), or USDG on Robinhood Chain. |
77
- | `SOLANA_AGENT_KEY` | _(unset)_ | Base58 secret key (or JSON byte array) of a Solana wallet funded with USDC on Solana. |
78
- | `AGENT402_URL` | `https://agent402.tools` | Target service (point at your own deployment). |
79
- | `AGENT402_TOOLS` | curated set | Comma-separated slugs to expose as first-class tools. |
80
- | `AGENT402_MAX_PER_CALL` | unlimited | Refuse any single call priced above this many USD (e.g. `0.01`). |
81
- | `AGENT402_BUDGET` | unlimited | Hard cap on total USDC spent per session (e.g. `1.00`). |
82
- | `AGENT402_NETWORKS` | _(unset)_ | Restrict + order the chains to pay on - e.g. `robinhood` (USDG on Robinhood Chain), `base,solana`, or a raw CAIP-2 like `eip155:4663`. Unset = the client picks (effectively Base on multi-chain sellers). |
83
-
84
- Spend controls are enforced **before a payment is signed** - a runaway model is
85
- refused, not billed. `payment_info` reports the caps, what's been spent, and
86
- what remains. With neither key set, the server runs in proof-of-work mode
87
- (pure-CPU tools stay free). Use dedicated low-value wallets for `AGENT_KEY` /
88
- `SOLANA_AGENT_KEY`, funded only with what you intend to spend. Most tools cost
89
- $0.001–$0.02; the priciest single tool is $0.55 (`route-execute-max`) and
90
- multi-tool skill packs run up to $1.50, so set `AGENT402_MAX_PER_CALL` if you
91
- want a hard per-call ceiling.
92
-
93
117
  ## Test
94
118
 
95
119
  From the repo root: `node mcp/test.js` (boots a local paywalled instance and drives the MCP server with a real client; the proof-of-work path settles real challenges).
package/index.js CHANGED
@@ -17,6 +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
22
  // AGENT402_BUDGET hard cap on total USDC spent this session (e.g. 1.00)
21
23
  // AGENT402_NETWORKS restrict + order the chains to pay on (e.g. "robinhood" for USDG on
22
24
  // Robinhood Chain, "base,solana", or a raw CAIP-2 like eip155:4663) — optional
@@ -51,6 +53,11 @@ const AGENT_KEY = process.env.AGENT_KEY || "";
51
53
  // settle on whichever chain the seller offers (EVM accepts are tried first).
52
54
  const SOLANA_AGENT_KEY = process.env.SOLANA_AGENT_KEY || "";
53
55
  const HAS_WALLET = Boolean(AGENT_KEY || SOLANA_AGENT_KEY);
56
+ // Prepaid card credits (no wallet): a key bought at https://agent402.tools/credits.
57
+ // Sent as Authorization: Bearer on every catalog call; the server debits the
58
+ // list price only on a successful (200) call and returns X-Credits-Balance.
59
+ const CREDITS_KEY = (process.env.AGENT402_CREDITS_KEY || "").trim();
60
+ const HAS_CREDITS = /^a402_[A-Za-z0-9_-]{32,64}$/.test(CREDITS_KEY);
54
61
  // Version comes from package.json — the serverInfo self-report drifted from
55
62
  // the published version once (0.11.5 vs 0.12.1) because this was a hardcoded
56
63
  // string bumped by hand. Reading the manifest makes drift impossible.
@@ -188,6 +195,7 @@ function walletRequiredText(tool) {
188
195
  `To enable it: set AGENT_KEY on this MCP server to the hex private key of an EVM wallet funded with USDC`,
189
196
  `on Base (or Polygon/Arbitrum), and/or SOLANA_AGENT_KEY to the base58 secret key of a Solana wallet funded`,
190
197
  `with USDC on Solana. Payment is per call via the x402 protocol — no signup or API key.`,
198
+ `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.`,
191
199
  `Pricing and details: ${BASE}/tools/${tool.slug}`,
192
200
  ].join(" ");
193
201
  }
@@ -206,7 +214,23 @@ async function callEndpoint(tool, args = {}) {
206
214
  }
207
215
 
208
216
  let res;
209
- if (HAS_WALLET) {
217
+ if (!HAS_WALLET && HAS_CREDITS) {
218
+ // Card credits: same budget guards as the wallet path (the server enforces
219
+ // the balance; these keep a runaway session from draining a pack).
220
+ const price = parseFloat(String(tool.price).replace(/[^0-9.]/g, "")) || 0;
221
+ if (price > MAX_PER_CALL) {
222
+ return { content: [{ type: "text", text: `Refused: "${tool.slug}" costs ${tool.price}/call, above the AGENT402_MAX_PER_CALL cap of $${MAX_PER_CALL}.` }], isError: true };
223
+ }
224
+ if (spentUsd + price > BUDGET) {
225
+ return { content: [{ type: "text", text: `Refused: session budget exhausted ($${spentUsd.toFixed(4)} of $${BUDGET} spent; "${tool.slug}" costs ${tool.price}).` }], isError: true };
226
+ }
227
+ res = await fetch(url, { ...init, headers: { ...init.headers, Authorization: `Bearer ${CREDITS_KEY}` } });
228
+ if (res.ok) spentUsd += price;
229
+ if (res.status === 402) {
230
+ let body = {}; try { body = await res.clone().json(); } catch { /* plain */ }
231
+ return { content: [{ type: "text", text: `Credits refused for "${tool.slug}": ${body.error || "payment required"}${body.balanceUsd != null ? ` (balance $${body.balanceUsd})` : ""}. Top up at ${body.topup || `${BASE}/credits`}.` }], isError: true };
232
+ }
233
+ } else if (HAS_WALLET) {
210
234
  const price = parseFloat(String(tool.price).replace(/[^0-9.]/g, "")) || 0;
211
235
  if (price > MAX_PER_CALL) {
212
236
  return {
@@ -422,7 +446,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
422
446
  title: "Search the Agent402 tool catalog",
423
447
  annotations: { title: "Search the Agent402 tool catalog", ...SAFE },
424
448
  description:
425
- `BROWSE the long catalog behind the flagship set: keyword search over Agent402's 500+ deterministic pay-per-call tools (exact count ${catalog.size}). Start with listed flagships for search/answer/news/render/stock/transcribe/memory; use this for long-tail slugs. Counterpart catalog.find resolves a task to ONE ready-to-run pick. Many pure-CPU tools are free via proof-of-work. OpenAI-compatible LLM gateway at ${BASE}/v1 (chat nano $0.003, auto $0.01, embeddings $0.002) via catalog.call when a wallet key is set. Returns matching tools + workflow templates; call them with catalog.call.`,
449
+ `BROWSE the long catalog behind the flagship set: keyword search over Agent402's 500+ pay-per-call tools (exact count ${catalog.size}). Start with listed flagships for search/answer/news/render/stock/transcribe/memory; use this for long-tail slugs. Counterpart catalog.find resolves a task to ONE ready-to-run pick. Many pure-CPU tools are free via proof-of-work. OpenAI-compatible LLM gateway at ${BASE}/v1 (chat nano $0.003, auto $0.01, embeddings $0.002) via catalog.call when a wallet key is set. Returns matching tools + workflow templates; call them with catalog.call.`,
426
450
  inputSchema: {
427
451
  type: "object",
428
452
  properties: {
@@ -590,7 +614,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
590
614
  const computePayable = [...catalog.values()].filter((t) => t.computePayable).length;
591
615
  return mcpJsonResult({
592
616
  service: BASE,
593
- mode: HAS_WALLET ? "usdc" : "proof-of-work",
617
+ mode: HAS_WALLET ? "usdc" : HAS_CREDITS ? "credits" : "proof-of-work",
594
618
  wallet: address,
595
619
  solanaWallet: solanaAddress,
596
620
  network: pricingInfo?.payment?.network ?? "base",
@@ -599,7 +623,8 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
599
623
  payableWithCompute: computePayable,
600
624
  walletOnly: catalog.size - computePayable,
601
625
  workflows: skillPacks.length,
602
- spendControls: HAS_WALLET
626
+ 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` },
627
+ spendControls: (HAS_WALLET || HAS_CREDITS)
603
628
  ? {
604
629
  maxPerCallUsd: MAX_PER_CALL === Infinity ? "unlimited" : MAX_PER_CALL,
605
630
  sessionBudgetUsd: BUDGET === Infinity ? "unlimited" : BUDGET,
@@ -608,8 +633,10 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
608
633
  }
609
634
  : "n/a (proof-of-work mode spends CPU, not money)",
610
635
  note: HAS_WALLET
611
- ? "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."
612
- : `No wallet 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 for Base/Polygon/Arbitrum and/or SOLANA_AGENT_KEY for Solana).`,
636
+ ? "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."
637
+ : HAS_CREDITS
638
+ ? "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."
639
+ : `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).`,
613
640
  install: {
614
641
  claudeCodeHosted: `claude mcp add --transport http agent402 ${BASE}/mcp`,
615
642
  claudeCodeNpm: "claude mcp add agent402 -s user -- npx -y agent402-mcp@latest",
@@ -629,7 +656,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
629
656
  positioning: `Agent402 is the applied layer of Agentic Finance: software agents that pay and get paid on their own, per request, over x402 or MPP (Machine Payments Protocol) - both answered on the same 402. ${BASE}/agentic-finance, ${BASE}/glossary.`,
630
657
  startHere: {
631
658
  firstJob: "Search the web and answer questions. Call web.search or web.answer directly, or catalog.find with your task.",
632
- mode: HAS_WALLET ? "usdc" : "proof-of-work",
659
+ mode: HAS_WALLET ? "usdc" : HAS_CREDITS ? "credits" : "proof-of-work",
633
660
  },
634
661
  install: {
635
662
  claudeCodeHosted: `claude mcp add --transport http agent402 ${BASE}/mcp`,
package/output-schemas.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // Flagship MCP surface — the small default tools/list agents see first.
6
6
  //
7
7
  // Product intent (competitive brief 2026-08): Agent402 wins as the deterministic
8
- // tools layer beside LLM gateways (BlockRun et al.). Default MCP exposure is a
8
+ // tools layer beside per-token LLM gateways. Default MCP exposure is a
9
9
  // tight flagship set; the long catalog stays callable via find_tool /
10
10
  // search_tools / call_tool. Keep this list aligned with mcp/index.js
11
11
  // DEFAULT_CURATED (stdio package cannot import this file when published).
@@ -99,7 +99,7 @@ export const FLAGSHIP_WRITERS = new Set(["memory-write"]);
99
99
 
100
100
  /** initialize.serverInfo description (MCP Implementation.description). */
101
101
  export const MCP_SERVER_DESCRIPTION =
102
- "Agent402 - deterministic pay-per-call tools for AI agents: live web search and cited answers, news, browser render, market data, speech-to-text, wallet-keyed memory, plus 500+ long-tail tools via catalog.find. Settle in USDC via x402 or MPP (Machine Payments Protocol) on the same 402, or free via proof-of-work. The applied layer of Agentic Finance. Maintained by Havok Holdings LLC.";
102
+ "Agent402 - pay-per-call tools and models for AI agents: live web search and cited answers, news, browser render, market data, speech-to-text, wallet-keyed memory, plus 500+ long-tail tools via catalog.find. Settle in USDC via x402 or MPP (Machine Payments Protocol) on the same 402, or free via proof-of-work. The applied layer of Agentic Finance. Maintained by Havok Holdings LLC.";
103
103
 
104
104
  /** initialize.serverInfo.websiteUrl */
105
105
  export const MCP_SERVER_WEBSITE = "https://agent402.tools";
@@ -507,15 +507,16 @@ export function mcpInitializeInstructions(baseUrl) {
507
507
  const install = mcpInstallHints(baseUrl);
508
508
  const hosted = install.hostedUrl;
509
509
  return [
510
- "Agent402 is a deterministic tools layer for AI agents (Havok Holdings LLC) - the applied layer of Agentic Finance: agents that pay and get paid per request over x402 or MPP, or free via proof-of-work.",
510
+ "Agent402 is a tools and models layer for AI agents (Havok Holdings LLC) - the applied layer of Agentic Finance: deterministic utilities, a metered model gateway and finished reports, paid per request over x402 or MPP, or free via proof-of-work on the pure-CPU tools.",
511
511
  "Front door: call web.search or web.answer for live web search and cited answers.",
512
512
  "Also listed: web.news, browser.render, market.quote, audio.transcribe, memory.read, memory.write.",
513
513
  "Long catalog (500+ tools): call catalog.find with your task, or catalog.search then catalog.call.",
514
514
  "Orientation: call server.describe. Payment rails / wallet setup: call payment.info.",
515
515
  "Missing a tool: call demand.request. Ecosystem sellers: call sellers.list.",
516
516
  `Install (hosted, zero wallet): ${install.claudeCodeHosted}`,
517
- `Install (npm + wallet for paid flagships): ${install.claudeCodeNpm}`,
517
+ `Install (npm + wallet or prepaid card credits for paid flagships): ${install.claudeCodeNpm}`,
518
518
  `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`,
519
520
  `Docs: ${baseUrl}/llms.txt · ${baseUrl}/api/find?q=… · status ${baseUrl}/status`,
520
521
  ].join("\n");
521
522
  }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "agent402-mcp",
3
- "version": "0.12.12",
3
+ "version": "0.13.1",
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",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/MikeyPetrillo/Agent402.git"
9
+ "url": "git+https://github.com/MikeyPetrillo/Agent402.git",
10
+ "directory": "mcp"
10
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
13
  "type": "module",
@@ -68,7 +69,7 @@
68
69
  ],
69
70
  "license": "MIT",
70
71
  "dependencies": {
71
- "@modelcontextprotocol/sdk": "^1.12.0",
72
+ "@modelcontextprotocol/sdk": "^1.30.0",
72
73
  "@solana/kit": "^5.1.0",
73
74
  "@x402/core": "2.21.0",
74
75
  "@x402/evm": "2.21.0",
@@ -77,9 +78,10 @@
77
78
  "viem": "^2.21.0"
78
79
  },
79
80
  "overrides": {
81
+ "qs": "6.16.0",
80
82
  "ws": "^8.21.0",
81
83
  "hono": "4.12.34",
82
- "fast-uri": "3.1.5",
84
+ "fast-uri": "3.1.7",
83
85
  "body-parser": "2.3.0",
84
86
  "@hono/node-server": "2.0.12",
85
87
  "ip-address": "10.4.0"