agent402-mcp 0.12.11 → 0.13.0
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 +56 -32
- package/index.js +43 -6
- package/output-schemas.js +1 -1
- package/package.json +1 -1
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),
|
|
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)
|
|
12
|
-
|
|
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, 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
|
-
|
|
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 $5 to $39 per report (research $5 up to dossier-max $39),
|
|
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**
|
|
44
|
-
- The rest of the 500+ endpoint catalog is reachable via `
|
|
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;
|
|
46
|
-
- `
|
|
47
|
-
- `
|
|
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` ($5), `research-pro` ($15), `research-max` ($30), `market-brief` ($15), `dossier` ($19), `dossier-max` ($39), `fund-report` ($9), `fund-report-max` ($19), `domain-audit` ($5), `domain-audit-pro` ($9), `token-risk` ($5), `token-risk-pro` ($12), `recall-report` ($5), `insider-report` ($9). The same reports are sold by card at https://agent402.tools/reports, and the recurring monitors (domain, fund, recall, insider, IPO - $9/month) 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
|
-
- `
|
|
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 {
|
|
@@ -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
|
-
|
|
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)
|
|
612
|
-
:
|
|
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`,
|
|
@@ -671,6 +698,10 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
671
698
|
payersWindow: r.payers,
|
|
672
699
|
volumeUsdc7d: Math.round((r.d7?.volumeUsdc || 0) * 10000) / 10000,
|
|
673
700
|
routable: !!r.routable,
|
|
701
|
+
// Seller names/homepages are self-reported third-party content (same
|
|
702
|
+
// F09 rule as the hosted connector): never let a downstream agent read
|
|
703
|
+
// seller copy as an instruction.
|
|
704
|
+
...(r.self ? {} : { untrustedContent: true }),
|
|
674
705
|
}));
|
|
675
706
|
return mcpJsonResult({
|
|
676
707
|
wire: "mpp",
|
|
@@ -680,6 +711,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
680
711
|
sort, include,
|
|
681
712
|
totalSellers: Array.isArray(lb.rows) ? lb.rows.length : 0,
|
|
682
713
|
results: rows,
|
|
714
|
+
...(rows.some((r) => r.untrustedContent) ? { containsUntrustedContent: true } : {}),
|
|
683
715
|
...(lb.stale ? { note: "Leaderboard is stale or still warming - retry in a few minutes." } : {}),
|
|
684
716
|
source: `${BASE}/api/mpp-leaderboard`,
|
|
685
717
|
});
|
|
@@ -703,6 +735,9 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
703
735
|
// Trim to the same compact row shape the hosted MCP connector returns —
|
|
704
736
|
// cross-surface agents see one mental model. Full row (origins,
|
|
705
737
|
// endpoints, scan metadata) stays accessible at /api/leaderboard.
|
|
738
|
+
// Same untrusted-content marking as the hosted connector: a seller's
|
|
739
|
+
// name/homepage is self-reported external content. `snap.self` (or a
|
|
740
|
+
// row flagged self) is this host's own wallet when the API says so.
|
|
706
741
|
const rows = (snap.leaderboard || []).map((r) => ({
|
|
707
742
|
rank: r.rank,
|
|
708
743
|
name: r.name,
|
|
@@ -712,8 +747,10 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
712
747
|
callsSettled: r.callsSettled || 0,
|
|
713
748
|
totalUsd: Math.round((r.totalUsd || 0) * 10000) / 10000,
|
|
714
749
|
uniqueBuyers: r.uniqueBuyers || 0,
|
|
750
|
+
...(r.self ? {} : { untrustedContent: true }),
|
|
715
751
|
}));
|
|
716
752
|
return mcpJsonResult({
|
|
753
|
+
...(rows.some((r) => r.untrustedContent) ? { containsUntrustedContent: true } : {}),
|
|
717
754
|
window: snap.windowLabel || snap.windowServed || "24h",
|
|
718
755
|
asOf: snap.asOf,
|
|
719
756
|
sort: snap.sortServed || sort,
|
package/output-schemas.js
CHANGED
|
@@ -514,7 +514,7 @@ export function mcpInitializeInstructions(baseUrl) {
|
|
|
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
519
|
`Docs: ${baseUrl}/llms.txt · ${baseUrl}/api/find?q=… · status ${baseUrl}/status`,
|
|
520
520
|
].join("\n");
|
package/package.json
CHANGED