x402-list-mcp 0.4.2 → 0.5.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,93 @@
1
+ # Changelog
2
+
3
+ All notable changes to `x402-list-mcp` are recorded here. This project follows semantic
4
+ versioning: while the major version is 0, a minor bump may carry a breaking change.
5
+
6
+ ## 0.5.2 - 2026-10-07
7
+
8
+ ### Fixed: catalog descriptions
9
+
10
+ Removed fixed catalog counts from the server instructions and the search and health tool descriptions.
11
+
12
+ ### Documentation and package metadata
13
+
14
+ - Added hosted and local Claude Code installation commands, a Cursor install link and remote configuration, and VS Code and Codex connection examples.
15
+ - Linked the public source repository and Glama badge, and made ranking guidance refer to the returned `ranking_version`.
16
+ - Moved the 0.4.x upgrade notice below, alongside the 0.5.0 breaking-change details.
17
+ - Added npm keywords: `directory`, `discovery`, `trust`, `uptime`, `agent`.
18
+
19
+ ## 0.5.1 - 2026-09-01
20
+
21
+ ### Added: tool titles and annotations
22
+
23
+ All seven tools now declare a human-readable `title` and tool annotations. The six read-only
24
+ tools carry `readOnlyHint: true`; the paid `x402_assess_services` carries `readOnlyHint: false`.
25
+ Nothing else changed: same names, same parameters, same response shapes, same semantics.
26
+
27
+ ## 0.5.0 - 2026-08-21
28
+
29
+ > **Upgrading from 0.4.x? Every tool was renamed.** 0.5.0 moved all of them into the `x402_*` namespace
30
+ > and removed the old names, with no compatibility aliases: a `tools/call` for `get_service` or
31
+ > `search_x402_services` now comes back as a JSON-RPC `-32602` "Tool not found", and the old names are
32
+ > absent from `tools/list` too. The old-to-new table and the upgrade checklist (prompts, client
33
+ > allow lists, eval fixtures) are below.
34
+
35
+ ### BREAKING: every tool was renamed into the `x402_*` namespace
36
+
37
+ All six tools that shipped in 0.4.x now answer under a new name. **The old names no longer
38
+ exist.** A `tools/call` for any of them is answered with a JSON-RPC error (`-32602`,
39
+ `Tool <name> not found`), and they do not appear in `tools/list` either. Nothing else about
40
+ the tools changed in this release: same parameters,
41
+ same response shapes, same semantics.
42
+
43
+ | Old name (0.4.x, removed) | New name (0.5.0) |
44
+ | --- | --- |
45
+ | `search_x402_services` | `x402_search_services` |
46
+ | `get_service` | `x402_get_service` |
47
+ | `find_best_service` | `x402_find_best_service` |
48
+ | `check_health` | `x402_check_health` |
49
+ | `get_facilitator_volumes` | `x402_facilitator_volumes` |
50
+ | `assess_services` | `x402_assess_services` |
51
+
52
+ ### There are no compatibility aliases, on purpose
53
+
54
+ The old names were not kept as deprecated aliases. Two reasons, both deliberate:
55
+
56
+ 1. **One surface to maintain.** Aliases double the number of registered tools, and every one
57
+ of them has to keep its schema, its description and its tests in step with the real tool
58
+ for as long as the alias lives. Two names for one behaviour is two places to get wrong.
59
+ 2. **The model's context budget is the scarce resource.** Every registered tool spends tokens
60
+ in the agent's preamble before a single question is asked, and a deprecated duplicate spends
61
+ them twice over while also forcing a paragraph of "prefer the new name" guidance. Keeping the
62
+ aliases would have made the preamble worse in exactly the dimension this release is trying to
63
+ improve.
64
+
65
+ Breaking now is cheap and it will never be cheaper: the installed base is small, and a clean
66
+ namespace is what makes the tools legible next to the other MCP servers an agent has loaded.
67
+
68
+ ### What you need to do to upgrade
69
+
70
+ Search your setup for the six old names and replace them with the new ones, everywhere they are
71
+ written down by hand:
72
+
73
+ - system prompts, skill files and agent instructions that name a tool ("call `get_service`
74
+ after `search_x402_services`");
75
+ - code that calls tools programmatically, for example `client.callTool({ name: "check_health" })`;
76
+ - allow lists, deny lists and per-tool permission rules in your MCP client configuration, which
77
+ match on the tool name and will silently stop matching;
78
+ - evaluation fixtures and transcripts that assert on tool names.
79
+
80
+ Nothing needs to change in your MCP server configuration itself: the package name, the binary,
81
+ the environment variables and the hosted endpoint are all unchanged.
82
+
83
+ ### Added: a seventh tool, `x402_change_events`
84
+
85
+ A read-only, free feed of the changes x402-list observes on listed services over time: a service
86
+ moving its payout address, changing an endpoint price, or altering its 402 schema. Filter by
87
+ `service` (a listing slug), by `type` (one of `payto_changed`, `price_changed`, `schema_changed`),
88
+ and by `days`; page through with `page` and `per_page`. Each event carries the observation
89
+ timestamp, a summary, and the before and after snapshots. Payout addresses are returned masked by
90
+ the API, as they are on the website.
91
+
92
+ Use it to answer "has this service changed under me since I last looked", which is the question
93
+ a static listing cannot answer.
package/README.md CHANGED
@@ -1,34 +1,119 @@
1
1
  # x402-list-mcp
2
2
 
3
- MCP server for x402-list: discover x402 payment services and on-chain-verified facilitator settlement volume.
3
+ [![Glama MCP server](https://glama.ai/mcp/servers/mcccsm/x402-list-mcp/badges/score.svg)](https://glama.ai/mcp/servers/mcccsm/x402-list-mcp)
4
+
5
+ Discover x402 payment APIs, check uptime and pricing, and inspect on-chain-verified settlement volume per facilitator through MCP.
4
6
 
5
7
  ## What is x402-list
6
8
 
7
- [x402-list](https://x402-list.com) is the directory of services that accept x402 (HTTP 402 stablecoin) payments. Its distinctive, defensible data is **on-chain-verified settlement volume per facilitator**, not self-reported numbers. Listed services are continuously health-monitored (uptime, response time, status).
9
+ [x402-list](https://x402-list.com) is a directory of services that accept x402 (HTTP 402 stablecoin) payments. It monitors listed services for uptime, response time and status, and measures facilitator settlement volume on-chain.
8
10
 
9
- This package is a **thin wrapper** over the public x402-list HTTP JSON API. It holds no keys, touches no database, and makes no writes to the directory. Every tool but one is read-only; the single paid tool, `assess_services`, only relays an x402 payment challenge that you sign yourself client-side (the package never holds keys, never signs, and never settles). It exposes the directory to AI agents through the Model Context Protocol.
11
+ This package is a **thin wrapper** over the public x402-list HTTP JSON API. It holds no keys, touches no database, and makes no writes to the directory. It exposes the directory to AI agents through the Model Context Protocol as seven tools: six are free and read-only, and the seventh, `x402_assess_services`, is the only paid one, a pass-through that relays an x402 payment challenge you sign yourself client-side (the package never holds keys, never signs, and never settles).
10
12
 
11
13
  ## Install and quick start
12
14
 
13
- ### stdio (local MCP clients)
15
+ Connect to the hosted server at `https://mcp.x402-list.com/mcp` using Streamable HTTP, or run the npm package locally over stdio. Local use requires Node.js 20 or newer and npm; the hosted connection needs no local Node.js installation.
16
+
17
+ ### Claude Code
18
+
19
+ Connect to the hosted server:
14
20
 
21
+ ```sh
22
+ claude mcp add --transport http x402-list https://mcp.x402-list.com/mcp
15
23
  ```
16
- npx -y x402-list-mcp
24
+
25
+ Or use the local package instead:
26
+
27
+ ```sh
28
+ claude mcp add --transport stdio x402-list -- npx -y x402-list-mcp
29
+ ```
30
+
31
+ Choose one transport. See the [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp) for configuration scopes.
32
+
33
+ ### Cursor
34
+
35
+ [Add the hosted server to Cursor](https://cursor.com/link/mcp/install?name=x402-list&config=eyJ1cmwiOiJodHRwczovL21jcC54NDAyLWxpc3QuY29tL21jcCJ9), then confirm the installation in Cursor.
36
+
37
+ The install link encodes the same configuration as this manual entry in `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
38
+
39
+ ```json
40
+ {
41
+ "mcpServers": {
42
+ "x402-list": {
43
+ "url": "https://mcp.x402-list.com/mcp"
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ See the [Cursor MCP documentation](https://cursor.com/docs/mcp) and [install-link format](https://cursor.com/docs/mcp/install-links).
50
+
51
+ ### VS Code
52
+
53
+ Add this entry to `.vscode/mcp.json` in your project, then start the server from the editor and use it in Copilot agent mode:
54
+
55
+ ```json
56
+ {
57
+ "servers": {
58
+ "x402-list": {
59
+ "type": "http",
60
+ "url": "https://mcp.x402-list.com/mcp"
61
+ }
62
+ }
63
+ }
17
64
  ```
18
65
 
19
- Claude Desktop / generic MCP client config:
66
+ See the [VS Code MCP documentation](https://code.visualstudio.com/docs/agent-customization/mcp-servers) for other configuration locations.
67
+
68
+ ### Codex
69
+
70
+ Add the hosted server with the Codex CLI:
71
+
72
+ ```sh
73
+ codex mcp add x402-list --url https://mcp.x402-list.com/mcp
74
+ ```
75
+
76
+ Or add this entry to `~/.codex/config.toml`; the CLI and IDE extension share this configuration:
77
+
78
+ ```toml
79
+ [mcp_servers.x402-list]
80
+ url = "https://mcp.x402-list.com/mcp"
81
+ ```
82
+
83
+ See the [Codex MCP documentation](https://developers.openai.com/codex/mcp).
84
+
85
+ ### Claude Desktop and other local stdio clients
86
+
87
+ Add this entry to `claude_desktop_config.json`, or the equivalent configuration for your stdio client, and restart the client:
20
88
 
21
89
  ```json
22
- { "mcpServers": { "x402-list": { "command": "npx", "args": ["-y", "x402-list-mcp"] } } }
90
+ {
91
+ "mcpServers": {
92
+ "x402-list": {
93
+ "command": "npx",
94
+ "args": ["-y", "x402-list-mcp"]
95
+ }
96
+ }
97
+ }
23
98
  ```
24
99
 
25
- ### Hosted HTTP (Streamable HTTP transport)
100
+ See the [local MCP connection guide](https://modelcontextprotocol.io/docs/develop/connect-local-servers) for the Claude Desktop configuration file location.
101
+
102
+ The client launches the same command you can run in a terminal:
26
103
 
104
+ ```sh
105
+ npx -y x402-list-mcp
27
106
  ```
107
+
108
+ ### Self-host Streamable HTTP
109
+
110
+ To run your own HTTP instance in a POSIX shell:
111
+
112
+ ```sh
28
113
  MCP_HTTP_PORT=3000 npx -y x402-list-mcp --http
29
114
  ```
30
115
 
31
- Hosted endpoint: `https://mcp.x402-list.com/mcp`. Health probe: `GET /healthz` returns `{"status":"ok"}`.
116
+ Connect your client to `http://localhost:3000/mcp`. The health probe at `http://localhost:3000/healthz` returns `{"status":"ok"}`.
32
117
 
33
118
  ## Environment variables
34
119
 
@@ -44,12 +129,30 @@ Hosted endpoint: `https://mcp.x402-list.com/mcp`. Health probe: `GET /healthz` r
44
129
 
45
130
  | Tool | What it does |
46
131
  | --- | --- |
47
- | `search_x402_services` | Search and filter the directory by query, category, network, status, and `signable` (whether the last observed 402 envelope carries the EIP-712 domain parameters a standard x402 client needs in order to sign); sort by newest/uptime/cheapest/endpoints. |
48
- | `get_service` | Full detail for one service by slug: endpoints, per-endpoint USD pricing, uptime windows, networks, settlement asset. |
49
- | `find_best_service` | Ranked recommendation for a need, computed server-side (GET /api/v1/best). Ranks mostly by reliability, x402 compliance and price (status, verified, uptime, response time, USD price), with a small (~10%) weight on per-service on-chain traction; shared-payout and unmeasured-network services stay neutral. The compliance term is capped at 0.6 (the floor of the C band) when at least one EVM route is missing the EIP-712 domain parameters a standard x402 client needs in order to sign, which is why `ranking_version` is now 2. |
50
- | `check_health` | Live status, directory-wide or per service (uptime snapshots, consecutive failures). |
51
- | `get_facilitator_volumes` | Per-facilitator on-chain-verified settlement volume (today UTC/7d/30d/all) in USD, tx counts, and an on-chain vs listed flag. The `*_24h` fields cover today (UTC) so far, not a trailing 24-hour window. |
52
- | `assess_services` | **Paid** ($0.25 USDC on Base, x402). Fresh on-demand AI comparison of a shortlist of listed services for a stated need. Pass-through: it never holds keys, never signs, and never settles. Call without `payment_signature_b64` to get the x402 challenge verbatim, sign it client-side, then retry with the signature to get the report. Optionally add a `probe` target `{ slug, endpoint_path? }` to also test one listed service live: the price becomes $0.25 plus that endpoint price X (non-refundable), and the report gains a `probe_report` block with a verdict and truncated extracts, never the verbatim third-party body. |
132
+ | `x402_search_services` | Search and filter the directory by query, category, network, status, and `signable` (whether the last observed 402 envelope carries the EIP-712 domain parameters a standard x402 client needs in order to sign); sort by newest/uptime/cheapest/endpoints. |
133
+ | `x402_get_service` | Full detail for one service by slug: endpoints, per-endpoint USD pricing, uptime windows, networks, settlement asset. |
134
+ | `x402_find_best_service` | Ranked recommendation for a need, computed server-side (GET /api/v1/best). Ranks mostly by reliability, x402 compliance and price (status, verified, uptime, response time, USD price), with a small (~10%) weight on per-service on-chain traction that can never dominate those three. Read the answer's `ranking_version` to identify its scoring generation (see below), and its `units` map for scoring caveats. |
135
+ | `x402_check_health` | Live status, directory-wide or per service (uptime snapshots, consecutive failures). |
136
+ | `x402_facilitator_volumes` | Per-facilitator on-chain-verified settlement volume (today UTC/7d/30d/all) in USD, tx counts, and an on-chain vs listed flag. The `*_24h` fields cover today (UTC) so far, not a trailing 24-hour window. |
137
+ | `x402_change_events` | Free, read-only feed of what the monitor observed changing on listed services, most recent first, in exactly three event types (`payto_changed`, `price_changed`, `schema_changed`). Filter by `service` (the listing slug: the parameter is named `service`, not `slug`), by `type`, and by `days` (1 to 365, default 90); page with `page` / `per_page` (up to 100 per page). Each event carries the observation timestamp, a diff summary, and the before/after 402 snapshots. Prices inside an event are atomic token amounts, never dollars, and every payout address is returned masked by the API: the feed reports THAT the payTo changed, never the address. |
138
+ | `x402_assess_services` | **Paid** ($0.25 USDC on Base, x402). Fresh on-demand AI comparison of a shortlist of listed services for a stated need. Pass-through: it never holds keys, never signs, and never settles. Call without `payment_signature_b64` to get the x402 challenge verbatim, sign it client-side, then retry with the signature to get the report. Optionally add a `probe` target `{ slug, endpoint_path? }` to also test one listed service live: the price becomes $0.25 plus that endpoint price X (non-refundable), and the report gains a `probe_report` block with a verdict and truncated extracts, never the verbatim third-party body. |
139
+
140
+ ## Ranking generations
141
+
142
+ `x402_find_best_service` returns its scoring generation in `ranking_version`. Compare scores only
143
+ within the same generation. The changes below explain why scores across generations differ:
144
+
145
+ - **Generation 2** capped the compliance term at 0.6, the floor of the C band, when at least one of a
146
+ service's EVM routes was observed missing the EIP-712 domain parameters (`extra.name`, `extra.version`)
147
+ a standard x402 client needs in order to sign a payment. A fact about the envelope on the wire, not a
148
+ judgement on the merit of the service.
149
+ - **Generation 3** added the anti-wash rules on the traction term: an absolute floor of $10 on 30d
150
+ settlement volume, below which the term scores 0 because sub-floor volume is indistinguishable from
151
+ dust and must not move rank; a discount on a payout concentrated in one buyer, up to half the traction
152
+ term when a single buyer accounts for all of it, since one buyer is one relationship and not the broad
153
+ demand the term is meant to reward; and a service that publishes no mappable payTo now scores 0 on that
154
+ term instead of having the weight renormalized away, so hiding the payout address no longer beats
155
+ having a measured one.
53
156
 
54
157
  ## Units note
55
158
 
@@ -57,11 +160,11 @@ All monetary values are decimal US dollars and are passed through verbatim. Ther
57
160
 
58
161
  ## Honesty note
59
162
 
60
- Two different on-chain volume signals; do not conflate them. **Facilitator volume** (`get_facilitator_volumes`) is the ecosystem headline, aggregated per facilitator. **Per-service traction** (the `traction` block on each service, weighed at ~10% inside `find_best_service`) is settlement measured over a service's own payTo via recognized settlers - a deliberate **conservative undercount**, not an estimate: unattributed settlements are left out, never scaled up. A service whose payTo is shared across services (operator-level volume, `shared_payout: true`) or that sits on a network not yet measured carries no per-service figure and stays neutral in the ranking; never read shared or unmeasured volume as one service's revenue. To ask "which facilitators have real on-chain volume", use `get_facilitator_volumes` and read the `verification` flag.
163
+ Two different on-chain volume signals; do not conflate them. **Facilitator volume** (`x402_facilitator_volumes`) is the ecosystem headline, aggregated per facilitator. **Per-service traction** (the `traction` block on each service, weighed at ~10% inside `x402_find_best_service`) is settlement measured over a service's own payTo via recognized settlers - a deliberate **conservative undercount**, not an estimate: unattributed settlements are left out, never scaled up. When a payTo is shared across services (`shared_payout: true`), only settlement VOLUME is attributed pro-quota, the operator-level volume over that address divided across the services sharing it, which is a declared convention and not an individually observed measure, while transaction count and unique buyers stay whole operator-level integers; a service on a network not yet measured, or a shared-payout member whose probe has been failing, carries no traction term at all and the remaining weights are renormalized over it. Never read shared, pro-quota or unmeasured volume as one service's revenue. To ask "which facilitators have real on-chain volume", use `x402_facilitator_volumes` and read the `verification` flag.
61
164
 
62
165
  ## Source
63
166
 
64
- The source code is not public yet. This package is a thin read-only wrapper over the public x402-list REST API, documented at https://x402-list.com/api.
167
+ Source code: [mcccsm/x402-list-mcp](https://github.com/mcccsm/x402-list-mcp). This repository mirrors the MCP package when it is published. The public REST API is documented at [x402-list.com/api](https://x402-list.com/api).
65
168
 
66
169
  ## License
67
170
 
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: x402-list
3
- description: Discover x402 payment services and on-chain-verified facilitator settlement volume via the x402-list directory. Use when a user or agent needs to find an API/service that accepts x402 (HTTP 402 stablecoin) payments, compare services by reliability and price, check service uptime/health, or look up which x402 facilitators have real on-chain settlement volume.
3
+ description: Discover x402 payment services and on-chain-verified facilitator settlement volume via the x402-list directory. Use when a user or agent needs to find an API/service that accepts x402 (HTTP 402 stablecoin) payments, compare services by reliability and price, check service uptime/health, see whether a service has changed its price, payout address or 402 schema since it was last looked at, or look up which x402 facilitators have real on-chain settlement volume.
4
4
  ---
5
5
 
6
6
  # x402-list
@@ -15,19 +15,22 @@ x402-list is a directory of services that accept x402 payments. Its distinctive,
15
15
 
16
16
  ## Tool guide (when to use each)
17
17
 
18
- - `search_x402_services`: find and filter services by free-text query, category, network, and status; sort by newest, uptime, cheapest, or endpoint count. Start here for discovery. Add `signable: true` when you intend to pay with a standard x402 client and want only services whose last observed 402 envelope carries the EIP-712 domain parameters needed to sign (`signable: false` returns the opposite set; a service whose latest assessment has not measured that check matches neither value, so omit the parameter to see it).
19
- - `get_service`: deep-dive one service by slug. Returns every endpoint, per-endpoint USD pricing, uptime windows (24h/7d/30d/90d), accepted networks, and the settlement asset.
20
- - `find_best_service`: get a ranked recommendation for a need, computed server-side (GET /api/v1/best). Ranks mostly by reliability, x402 compliance and price (status, verified, uptime_24h, response time, USD price), filtered by category and network, with a small (~10%) weight on per-service on-chain traction (settlement volume, tx count, unique buyers - a conservative undercount). Traction never dominates; shared-payout or unmeasured-network services stay neutral. The compliance term is the share of deterministic conformance checks the service passes, capped at 0.6 (the floor of the C band) when at least one of its EVM routes is missing the EIP-712 domain parameters a standard x402 client needs in order to sign a payment; that cap is why the returned `ranking_version` is 2, so scores stored under generation 1 are not comparable with these.
21
- - `check_health`: live status. With no slug, a directory-wide snapshot (online/degraded/offline/unknown counts plus per-service status). With a slug, that service's status, uptime windows, response time, consecutive failures, and recent daily uptime snapshots.
22
- - `get_facilitator_volumes`: the headline metric. Per-facilitator settlement volume (24h/7d/30d/all) in USD, transaction counts, and an `on-chain` vs `listed` verification flag. Optional daily timeseries and per-chain breakdown.
23
- - `assess_services`: PAID ($0.25 USDC on Base, x402). A fresh on-demand AI comparison of a shortlist of listed services for a stated need. This is a pass-through: it never holds keys, never signs, and never settles. Call it once without `payment_signature_b64` to receive the x402 payment challenge verbatim, sign accepts[0] client-side with your own wallet, then call again with the same question and services plus `payment_signature_b64` to receive the report and a settlement receipt. It charges only for the fresh reasoning, never to read an already-computed assessment (that stays free on `get_service`); a run that cannot be produced answers before settling, so you are never charged, and there is no refund. Optionally add a `probe` target `{ slug, endpoint_path? }` to also test one listed service live: when the server has probing armed the price becomes $0.25 plus that endpoint price X (non-refundable), and the report gains a `probe_report` block with a verdict and truncated extracts, never the verbatim third-party body.
18
+ - `x402_search_services`: find and filter services by free-text query, category, network, and status; sort by newest, uptime, cheapest, or endpoint count. Start here for discovery. Add `signable: true` when you intend to pay with a standard x402 client and want only services whose last observed 402 envelope carries the EIP-712 domain parameters needed to sign (`signable: false` returns the opposite set; a service whose latest assessment has not measured that check matches neither value, so omit the parameter to see it).
19
+ - `x402_get_service`: deep-dive one service by slug. Returns every endpoint, per-endpoint USD pricing, uptime windows (24h/7d/30d/90d), accepted networks, and the settlement asset.
20
+ - `x402_find_best_service`: get a ranked recommendation for a need, computed server-side (GET /api/v1/best). Ranks mostly by reliability, x402 compliance and price (status, verified, uptime_24h, response time, USD price), filtered by category and network, with a small (~10%) weight on per-service on-chain traction (settlement volume, tx count, unique buyers - a conservative undercount). Traction never dominates; a shared payout has only its VOLUME attributed pro-quota (counts stay whole operator-level integers), and an unmeasured-network service, or a shared member whose probe is failing, carries no traction term at all. The response carries `ranking_version`, **3** today, plus a `units` map with every scoring caveat in full; scores stored under an earlier generation are NOT comparable with these, because the math moved twice. Generation 2 introduced the compliance cap: the compliance term is the share of deterministic conformance checks the service passes, capped at 0.6 (the floor of the C band) when at least one of its EVM routes is missing the EIP-712 domain parameters a standard x402 client needs in order to sign a payment, which is a fact about the envelope on the wire and not a judgement on the merit of the service. Generation 3 added the anti-wash rules on the traction term: an absolute $10 floor on 30d settlement volume, under which the term scores 0 because sub-floor volume is indistinguishable from dust and must not move rank; a discount on a payout concentrated in one buyer, up to half the traction term when a single buyer accounts for all of it, since one buyer is one relationship and not broad demand; and a 0 term, instead of a renormalization, for a service that publishes no mappable payTo, so hiding the payout address no longer beats having a measured one.
21
+ - `x402_check_health`: live status. With no slug, a directory-wide snapshot (online/degraded/offline/unknown counts plus per-service status). With a slug, that service's status, uptime windows, response time, consecutive failures, and recent daily uptime snapshots.
22
+ - `x402_facilitator_volumes`: the headline metric. Per-facilitator settlement volume (24h/7d/30d/all) in USD, transaction counts, and an `on-chain` vs `listed` verification flag. Optional daily timeseries and per-chain breakdown.
23
+ - `x402_change_events`: the drift feed, free and read-only. What the monitor observed changing on listed services, most recent first, in exactly three event types: `payto_changed` (the payout address set changed), `price_changed` (at least one endpoint changed price), `schema_changed` (the 402 envelope gained or lost accepts entries or priced endpoints). Reach for it before trusting anything you cached about a service, and right after a payment failed for no obvious reason. Filter with `service` (the listing slug, the same slug `x402_get_service` takes), `type`, and `days` (1 to 365, default 90); page with `page` and `per_page` (up to 100). **The slug parameter is named `service`, not `slug`**: pass the wrong name and the API answers with the whole unfiltered feed, silently and with no error, so check `filters_applied` in the response before reading the result as one service's history. `total` is the server's count over the whole filtered window, not the length of the page you are holding (`returned` is that). Two units traps: the prices inside an event are ATOMIC token amounts, never dollars, and every payTo is masked by the API by design, so the feed tells you THAT the payout address changed, never what it changed to.
24
+ - `x402_assess_services`: PAID ($0.25 USDC on Base, x402). A fresh on-demand AI comparison of a shortlist of listed services for a stated need. This is a pass-through: it never holds keys, never signs, and never settles. Call it once without `payment_signature_b64` to receive the x402 payment challenge verbatim, sign accepts[0] client-side with your own wallet, then call again with the same question and services plus `payment_signature_b64` to receive the report and a settlement receipt. It charges only for the fresh reasoning, never to read an already-computed assessment (that stays free on `x402_get_service`); a run that cannot be produced answers before settling, so you are never charged, and there is no refund. Optionally add a `probe` target `{ slug, endpoint_path? }` to also test one listed service live: when the server has probing armed the price becomes $0.25 plus that endpoint price X (non-refundable), and the report gains a `probe_report` block with a verdict and truncated extracts, never the verbatim third-party body.
24
25
 
25
26
  ## The honesty guard
26
27
 
27
- Keep two on-chain signals distinct. **Facilitator volume** (`get_facilitator_volumes`) is aggregated per facilitator and is the headline metric. **Per-service traction** (the `traction` block on a service, and a ~10% weight inside `find_best_service`) is measured over that service's own payTo via recognized settlers and is a deliberate **conservative undercount** - never an upper bound, never an estimate. When a payTo is shared across services (operator-level volume, `shared_payout: true`) or sits on a network we do not measure, there is no per-service figure and the service stays neutral in the ranking; do not present shared or unmeasured volume as a single service's revenue. If asked "which service does the most volume", show the measured `traction` where it exists, flag the undercount and any shared/unmeasured caveat, and offer facilitator volumes (via `get_facilitator_volumes`) for the ecosystem aggregate.
28
+ Keep two on-chain signals distinct. **Facilitator volume** (`x402_facilitator_volumes`) is aggregated per facilitator and is the headline metric. **Per-service traction** (the `traction` block on a service, and a ~10% weight inside `x402_find_best_service`) is measured over that service's own payTo via recognized settlers and is a deliberate **conservative undercount** - never an upper bound, never an estimate. When a payTo is shared across services (`shared_payout: true`), only settlement VOLUME is attributed pro-quota, the operator-level volume over that address divided across the services sharing it, which is a declared convention and not an individually observed measure, while transaction count and unique buyers stay whole operator-level integers, never fractional; when a service sits on a network we do not measure, or is a shared-payout member whose probe has been failing, it carries no traction term at all and the other weights are renormalized over it. Do not present shared, pro-quota or unmeasured volume as a single service's revenue. If asked "which service does the most volume", show the measured `traction` where it exists, flag the undercount and any shared/unmeasured caveat, and offer facilitator volumes (via `x402_facilitator_volumes`) for the ecosystem aggregate.
28
29
 
29
30
  ## Typical workflows
30
31
 
31
- - "Find me a cheap, reliable image-generation x402 API on Base" -> `find_best_service` with category, network `Base`, your need as `q`, and `prefer: cheapest`, then `get_service` on the top pick.
32
- - "Is service X healthy?" -> `check_health` with `slug: X`.
33
- - "Which x402 facilitators are real (have on-chain volume)?" -> `get_facilitator_volumes` with `timeframe: 30d`, then read each `verification` flag.
32
+ - "Find me a cheap, reliable image-generation x402 API on Base" -> `x402_find_best_service` with category, network `Base`, your need as `q`, and `prefer: cheapest`, then `x402_get_service` on the top pick.
33
+ - "Is service X healthy?" -> `x402_check_health` with `slug: X`.
34
+ - "Which x402 facilitators are real (have on-chain volume)?" -> `x402_facilitator_volumes` with `timeframe: 30d`, then read each `verification` flag.
35
+ - "I integrated service X last month and the call just started failing / costing more" -> `x402_change_events` with `service: X` and a `days` window that covers the gap, then read the newest `price_changed` or `schema_changed` event and re-check the current record with `x402_get_service`.
36
+ - "Is it still safe to pay this service?" -> `x402_change_events` with `service: X` and `type: payto_changed`: a recent payout change is the signal to re-verify before sending money, and the addresses themselves come back masked, so verify against the live 402 envelope rather than against this feed.
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const USER_AGENT = "x402-list-mcp/0.4.2 (+https://x402-list.com)";
1
+ export declare const USER_AGENT = "x402-list-mcp/0.5.2 (+https://x402-list.com)";
2
2
  export interface ApiEnvelope<T> {
3
3
  data: T;
4
4
  meta?: Record<string, unknown>;
@@ -21,12 +21,26 @@ export interface AiMarkedField<T = string> {
21
21
  confidence: number;
22
22
  source: "ai";
23
23
  }
24
+ /** Staleness of a compliance GRADE (T3 B-24#0 + A-07#1). The grade is a snapshot off the last
25
+ * captured 402 envelope, not re-derived on every probe, so `updated_at` cannot tell an agent the
26
+ * host is still reachable or how old the capture is. Two independent machine-keyable signals:
27
+ * probe_failing the up-probe has been failing past the decay window (grade no longer being
28
+ * re-confirmed; may be an unreachable host). Keyed off last_success_at.
29
+ * last_success_at the timestamp probe_failing derives from, distinct from updated_at.
30
+ * envelope_captured_at when the 402 envelope the grade was computed from was last captured; can be
31
+ * weeks old while probes still pass. The grade's OWN staleness. */
32
+ export interface ComplianceStaleness {
33
+ probe_failing: boolean;
34
+ last_success_at: string | null;
35
+ envelope_captured_at: string | null;
36
+ }
24
37
  /** Compact assessment summary carried on each list item (backs ranking). */
25
38
  export interface AssessmentSummary {
26
39
  compliance_grade: "A" | "B" | "C" | "D" | "F" | "unknown" | null;
27
40
  compliance_passed: number | null;
28
41
  compliance_total: number | null;
29
42
  compliance_failed_checks: string[] | null;
43
+ compliance_staleness: ComplianceStaleness | null;
30
44
  reliability_uptime_30d: number | null;
31
45
  response_p95_ms: number | null;
32
46
  price_usd: number | null;
@@ -72,6 +86,7 @@ export interface AssessmentDetail {
72
86
  }[];
73
87
  pay_to_source: "payTo" | "payToAddress" | "treasury" | null;
74
88
  pay_to_location: "accept" | "element" | null;
89
+ staleness: ComplianceStaleness | null;
75
90
  } | null;
76
91
  site: {
77
92
  homepage: boolean | null;
@@ -390,6 +405,45 @@ export interface NetworkItem {
390
405
  avg_uptime: number | null;
391
406
  }
392
407
  export declare const getNetworks: () => Promise<ApiEnvelope<NetworkItem[]>>;
408
+ export type ChangeEventType = "payto_changed" | "price_changed" | "schema_changed";
409
+ export interface ChangeEvent {
410
+ slug: string;
411
+ name: string;
412
+ type: ChangeEventType;
413
+ observed_at: string;
414
+ /**
415
+ * Per-type diff digest; the shape follows `type`:
416
+ * payto_changed { payToAdded: string[], payToRemoved: string[] } (addresses MASKED by the API)
417
+ * price_changed { priceChanges: [{ network, endpoint, oldPrice, newPrice, assetName }] }
418
+ * oldPrice/newPrice are ATOMIC token amounts (uint256 strings), NOT dollars.
419
+ * schema_changed { schemaAdded, schemaRemoved, endpointsAdded, endpointsRemoved: string[] }
420
+ * Left as `unknown` on purpose: it is passed through verbatim and never rescaled or reshaped.
421
+ */
422
+ summary: unknown;
423
+ /** The service's full accepts array before the change. payTo values are MASKED by the API
424
+ * (finding B-21#0, deliberate) and `price` inside is an ATOMIC token amount, not dollars. */
425
+ old_snapshot: unknown;
426
+ /** Same shape as old_snapshot, after the change. */
427
+ new_snapshot: unknown;
428
+ }
429
+ export interface ChangesResponse {
430
+ data: ChangeEvent[];
431
+ meta: {
432
+ total: number;
433
+ page: number;
434
+ per_page: number;
435
+ total_pages: number;
436
+ days: number;
437
+ };
438
+ }
439
+ export declare const getChanges: (q: {
440
+ /** Service slug. The wire name is `service`; sending `slug` is silently ignored by the API. */
441
+ service?: string;
442
+ type?: ChangeEventType;
443
+ days?: number;
444
+ page?: number;
445
+ per_page?: number;
446
+ }) => Promise<ChangesResponse>;
393
447
  export interface AssessPostResult {
394
448
  status: number;
395
449
  body: unknown;
package/dist/api.js CHANGED
@@ -10,7 +10,7 @@ const PREFIX = "/api/v1";
10
10
  const DEFAULT_TIMEOUT_MS = Number(process.env.X402_LIST_TIMEOUT_MS ?? 15000);
11
11
  // version: keep in sync with package.json / server.json / SERVER_INFO in server.ts.
12
12
  // Exported so the version-sync test can assert it carries the same version as the others.
13
- export const USER_AGENT = "x402-list-mcp/0.4.2 (+https://x402-list.com)";
13
+ export const USER_AGENT = "x402-list-mcp/0.5.2 (+https://x402-list.com)";
14
14
  export class ApiError extends Error {
15
15
  status;
16
16
  body;
@@ -67,7 +67,7 @@ export async function apiGet(path, query, opts) {
67
67
  // Full-text search param is `q`; pagination is `page` / `per_page`.
68
68
  // `verified` IS a real query filter on /services, applied SQL-side by the API: meta.total counts the
69
69
  // filtered set, so list_services passes it through instead of filtering the page it got back.
70
- // (find_best_service still narrows its own scored pool in tools.ts: that is ranking, not this param.)
70
+ // (x402_find_best_service still narrows its own scored pool in tools.ts: that is ranking, not this param.)
71
71
  export const getServices = (q) => apiGet("/services", q);
72
72
  export const getBest = (q) => apiGet("/best", q);
73
73
  export const getService = (slug) => apiGet(`/services/${encodeURIComponent(slug)}`);
@@ -78,6 +78,7 @@ export const getFacilitators = (q) => apiGet("/facilitators", q);
78
78
  export const getStatus = () => apiGet("/status");
79
79
  export const getCategories = () => apiGet("/categories");
80
80
  export const getNetworks = () => apiGet("/networks");
81
+ export const getChanges = (q) => apiGet("/changes", q);
81
82
  /**
82
83
  * POST a body to /assess. Unlike apiGet this does NOT throw on a non-2xx status: a 402 is the
83
84
  * expected payment challenge and a 400/503 is a normal control answer the caller must see. Only a
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,iEAAiE;AACjE,EAAE;AACF,4EAA4E;AAC5E,qEAAq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IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,IAAI,CAAC,CAAC,sCAAsC;IACrD,CAAC;IACD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI;QACJ,wBAAwB,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC7D,wBAAwB,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;KAC9D,CAAC;AACJ,CAAC"}
package/dist/http.js CHANGED
@@ -1,13 +1,16 @@
1
1
  // Streamable HTTP transport server (hosted mode), built on Node's native http.
2
2
  // One McpServer instance per MCP session, per the MCP spec. The SDK transport
3
3
  // does the protocol work (POST messages, GET SSE stream, DELETE terminate); this
4
- // wrapper only handles routing, CORS, the /healthz probe, and the session map.
4
+ // wrapper only handles routing, CORS, the /healthz probe, and the session registry
5
+ // (bounded: idle TTL + LRU cap, see sessions.ts).
5
6
  import { createServer } from "node:http";
6
7
  import { randomUUID } from "node:crypto";
7
8
  import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
8
9
  import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
9
10
  import { buildServer } from "./server.js";
11
+ import { SessionRegistry } from "./sessions.js";
10
12
  const MAX_BODY_BYTES = 1024 * 1024; // ~1 MB
13
+ const SWEEP_INTERVAL_MS = 60_000;
11
14
  const ALLOWED_ORIGINS = (process.env.MCP_ALLOWED_ORIGINS ?? "")
12
15
  .split(",")
13
16
  .map((s) => s.trim())
@@ -69,7 +72,9 @@ function jsonRpcError(res, status, message) {
69
72
  });
70
73
  }
71
74
  export async function startHttp(port) {
72
- const transports = new Map();
75
+ const transports = new SessionRegistry();
76
+ // unref: the sweeper must never be the reason the process stays up.
77
+ setInterval(() => transports.sweep(), SWEEP_INTERVAL_MS).unref();
73
78
  const httpServer = createServer((req, res) => {
74
79
  void handle(req, res).catch((e) => {
75
80
  console.error("HTTP handler error:", e);
@@ -110,39 +115,39 @@ export async function startHttp(port) {
110
115
  jsonRpcError(res, 400, `Invalid request body: ${e.message}`);
111
116
  return;
112
117
  }
113
- let transport;
114
- if (sid && transports.has(sid)) {
115
- transport = transports.get(sid);
116
- }
117
- else if (!sid && isInitializeRequest(body)) {
118
- transport = new StreamableHTTPServerTransport({
118
+ // get() also refreshes the session's idle clock.
119
+ let transport = sid ? transports.get(sid) : undefined;
120
+ if (!transport) {
121
+ if (sid || !isInitializeRequest(body)) {
122
+ jsonRpcError(res, 400, "No valid session. Send an initialize request first.");
123
+ return;
124
+ }
125
+ const created = new StreamableHTTPServerTransport({
119
126
  sessionIdGenerator: () => randomUUID(),
120
127
  onsessioninitialized: (id) => {
121
- transports.set(id, transport);
128
+ transports.set(id, created);
122
129
  },
123
130
  ...(ALLOWED_HOSTS.length > 0
124
131
  ? { enableDnsRebindingProtection: true, allowedHosts: ALLOWED_HOSTS }
125
132
  : {}),
126
133
  });
127
- transport.onclose = () => {
128
- if (transport.sessionId)
129
- transports.delete(transport.sessionId);
134
+ created.onclose = () => {
135
+ if (created.sessionId)
136
+ transports.delete(created.sessionId);
130
137
  };
131
- await buildServer().connect(transport);
132
- }
133
- else {
134
- jsonRpcError(res, 400, "No valid session. Send an initialize request first.");
135
- return;
138
+ await buildServer().connect(created);
139
+ transport = created;
136
140
  }
137
141
  await transport.handleRequest(req, res, body);
138
142
  return;
139
143
  }
140
144
  if (req.method === "GET" || req.method === "DELETE") {
141
- if (!sid || !transports.has(sid)) {
145
+ const transport = sid ? transports.get(sid) : undefined;
146
+ if (!transport) {
142
147
  jsonRpcError(res, 400, "No valid session.");
143
148
  return;
144
149
  }
145
- await transports.get(sid).handleRequest(req, res);
150
+ await transport.handleRequest(req, res);
146
151
  return;
147
152
  }
148
153
  res.writeHead(405);
package/dist/http.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.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