agentpay-mcp 4.1.7 → 4.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +17 -3
  2. package/dist/index.js +2 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/session/types.d.ts +1 -1
  5. package/dist/session/types.d.ts.map +1 -1
  6. package/dist/tools/budget.d.ts +14 -0
  7. package/dist/tools/budget.d.ts.map +1 -1
  8. package/dist/tools/budget.js +45 -15
  9. package/dist/tools/budget.js.map +1 -1
  10. package/dist/tools/deploy.js.map +1 -1
  11. package/dist/tools/history.d.ts.map +1 -1
  12. package/dist/tools/history.js.map +1 -1
  13. package/dist/tools/payments.d.ts.map +1 -1
  14. package/dist/tools/payments.js.map +1 -1
  15. package/dist/tools/session.d.ts.map +1 -1
  16. package/dist/tools/session.js +12 -19
  17. package/dist/tools/session.js.map +1 -1
  18. package/dist/tools/x402.d.ts.map +1 -1
  19. package/dist/tools/x402.js +9 -12
  20. package/dist/tools/x402.js.map +1 -1
  21. package/dist/utils/hosted-proxy-verification.d.ts +48 -0
  22. package/dist/utils/hosted-proxy-verification.d.ts.map +1 -0
  23. package/dist/utils/hosted-proxy-verification.js +147 -0
  24. package/dist/utils/hosted-proxy-verification.js.map +1 -0
  25. package/dist/utils/paid-mcp-gateway-hardening.d.ts +51 -0
  26. package/dist/utils/paid-mcp-gateway-hardening.d.ts.map +1 -0
  27. package/dist/utils/paid-mcp-gateway-hardening.js +60 -0
  28. package/dist/utils/paid-mcp-gateway-hardening.js.map +1 -0
  29. package/dist/utils/paid-provider-health-proof.d.ts +294 -0
  30. package/dist/utils/paid-provider-health-proof.d.ts.map +1 -0
  31. package/dist/utils/paid-provider-health-proof.js +191 -0
  32. package/dist/utils/paid-provider-health-proof.js.map +1 -0
  33. package/dist/utils/x402-buyer-flow.d.ts +81 -0
  34. package/dist/utils/x402-buyer-flow.d.ts.map +1 -0
  35. package/dist/utils/x402-buyer-flow.js +188 -0
  36. package/dist/utils/x402-buyer-flow.js.map +1 -0
  37. package/dist/utils/x402-v211-compatibility.d.ts +29 -0
  38. package/dist/utils/x402-v211-compatibility.d.ts.map +1 -0
  39. package/dist/utils/x402-v211-compatibility.js +71 -0
  40. package/dist/utils/x402-v211-compatibility.js.map +1 -0
  41. package/docs/agentpay-buyer-flow-parity.md +149 -0
  42. package/docs/dependency-pin-policy.md +53 -0
  43. package/docs/fixtures/paid-provider-health-proof-voidly-2026-05-02.json +104 -0
  44. package/docs/hosted-x402-proxy-verification.md +79 -0
  45. package/docs/mcp-registry-listing-proof.md +62 -0
  46. package/docs/mcp-registry-listing.json +40 -0
  47. package/docs/paid-mcp-gateway-hardening.md +121 -0
  48. package/docs/paid-provider-health-proof.md +71 -0
  49. package/docs/paid-provider-health-proof.schema.json +89 -0
  50. package/docs/settlegrid-paid-mcp-discovery-response.md +61 -0
  51. package/docs/x402-ecosystem-submission.md +22 -0
  52. package/docs/x402-native-vs-stripe-proxy.md +1 -1
  53. package/docs/x402-v211-paid-mcp-compatibility.md +75 -0
  54. package/llms.txt +21 -0
  55. package/package.json +10 -5
@@ -0,0 +1,79 @@
1
+ # Hosted x402 proxy buyer verification checklist
2
+
3
+ Hosted paid-MCP gateways are useful. They let an agent hit a no-signup endpoint, receive HTTP 402, pay, and keep moving.
4
+
5
+ That speed is also the risk. Before an agent signs, the buyer needs proof that the 402 challenge points to the expected recipient, chain, asset, amount, and proxy model.
6
+
7
+ ## Verified market signal
8
+
9
+ On 2026-05-01, Toolstem moved from a minimal proxy README to public Cloudflare Worker code for x402-protected `/mcp/finance` and `/mcp/sec` endpoints. The Intelligence scan verified:
10
+
11
+ - `https://mcp.toolstem.com/` returned HTTP 200
12
+ - `https://mcp.toolstem.com/health` returned HTTP 200
13
+ - `POST /mcp/finance` returned HTTP 402 with x402 payment-required details
14
+ - the payment challenge used Base Sepolia USDC during the 16:03 CT check
15
+
16
+ That is a live gateway signal. It is not a claim about production maturity, custody quality, downstream data quality, or spend-control depth.
17
+
18
+ A follow-up check from this implementation run also returned a `payment-required` header where `payTo` decoded to the zero address. Treat that as preflight evidence, not a broad verdict on Toolstem. It is exactly why a buyer-side verifier should fail closed before signing.
19
+
20
+ ## The buyer checklist
21
+
22
+ Do not let an agent pay a hosted x402 MCP proxy until these checks pass:
23
+
24
+ 1. **Payment-required header exists.** Require `payment-required` or `x-payment-required` on the HTTP 402 response. Body-only metadata is too easy for scanners and buyers to miss.
25
+ 2. **`payTo` is present and non-zero.** Reject missing recipients, malformed addresses, and `0x0000000000000000000000000000000000000000`.
26
+ 3. **Network is allowlisted.** For AgentPay MCP today, that usually means Base mainnet or Base Sepolia, depending on the wallet config and test path.
27
+ 4. **Asset is allowlisted.** Treat "USDC-like" as insufficient. Match the exact asset address or known native-asset encoding.
28
+ 5. **Amount is under the spend cap.** Validate `amount` or `maxAmountRequired` before signing. The cap check must happen before `x402_pay` sends a proof.
29
+ 6. **Approval gate is satisfied.** If the policy requires human approval, the current state must be `approved`, not merely requested.
30
+ 7. **Audit log is ready.** Record endpoint, tool call, recipient, amount, network, asset, approval state, policy version, and receipt.
31
+ 8. **Pooled-token lock-in is explicit.** If the proxy uses operator-held upstream credentials, the buyer must accept that model on purpose. Unknown is not accepted by default.
32
+
33
+ ## Test path in AgentPay MCP
34
+
35
+ `src/utils/hosted-proxy-verification.ts` adds a buyer-side verification helper. It validates the remote 402 challenge and the local buyer controls before payment.
36
+
37
+ Minimal use:
38
+
39
+ ```ts
40
+ import { verifyHostedProxyPaymentRequirement } from 'agentpay-mcp/dist/utils/hosted-proxy-verification.js';
41
+
42
+ const result = verifyHostedProxyPaymentRequirement({
43
+ status: 402,
44
+ headers: { 'payment-required': paymentRequiredHeader },
45
+ allowedNetworks: ['base-sepolia'],
46
+ allowedAssets: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'],
47
+ maxAmountRequired: '25000',
48
+ approvalGate: { required: true, state: 'approved' },
49
+ auditLog: { required: true, destination: 'otel', correlationId: 'tool-call-123' },
50
+ upstreamCredentialMode: 'buyer-owned',
51
+ });
52
+
53
+ if (!result.ok) {
54
+ throw new Error(result.failures.join('\n'));
55
+ }
56
+ ```
57
+
58
+ The tests cover the failure cases buyers care about:
59
+
60
+ - missing or body-only payment-required metadata
61
+ - zero or malformed `payTo`
62
+ - network drift
63
+ - asset mismatch
64
+ - amount over the spend cap
65
+ - pending approval
66
+ - missing audit correlation
67
+ - unresolved operator-pooled upstream tokens
68
+
69
+ Run:
70
+
71
+ ```bash
72
+ npm test -- --run tests/hosted-proxy-verification.test.ts
73
+ ```
74
+
75
+ ## AgentPay position
76
+
77
+ AgentPay MCP is not trying to be every hosted data proxy. It is the buyer-side payment-control layer: verify the 402, enforce policy, gate approval, sign locally, and write the audit row.
78
+
79
+ Use hosted proxies when they save setup time. Keep spend authority in AgentPay before the signature exists.
@@ -0,0 +1,62 @@
1
+ # AgentPay MCP directory-grade metadata proof
2
+
3
+ Paid MCP buyers are starting discovery in catalogs before they read a repository. AgentPay MCP therefore keeps a directory-grade metadata bundle in the repo and npm package.
4
+
5
+ ## Registry and listing surfaces
6
+
7
+ - npm package: `agentpay-mcp`
8
+ - MCP package identity: `io.github.up2itnow0822/agentpay`
9
+ - Repository: `https://github.com/up2itnow0822/agentpay-mcp`
10
+ - Glama listing: `https://glama.ai/mcp/servers/up2itnow0822/claw-pay-mcp`
11
+ - Glama metadata file: `glama.json`
12
+ - Smithery-compatible install metadata: `smithery.yaml`
13
+ - Directory install proof: `docs/directory-introspection-readiness.md`
14
+ - LLM crawler summary: `llms.txt`
15
+ - Registry-ready JSON: `docs/mcp-registry-listing.json`
16
+
17
+ The Glama listing slug still reflects the older `claw-pay-mcp` crawl identity. That is the valid current listing proof. Do not create a fake claim file for a directory that has not issued one. Use `glama.json`, the live Glama URL, npm identity, and repository metadata as the current claim artifacts.
18
+
19
+ ## Install-readiness checks
20
+
21
+ A directory crawler can verify AgentPay MCP without custodying user funds:
22
+
23
+ ```bash
24
+ npm pack --dry-run --json
25
+ npm exec --yes agentpay-mcp -- --help
26
+ ```
27
+
28
+ For MCP introspection, initialize before `tools/list`:
29
+
30
+ ```bash
31
+ printf '%s\n' \
32
+ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"registry-check","version":"0.0.1"}}}' \
33
+ '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}' \
34
+ '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | \
35
+ AGENT_WALLET_ADDRESS=0x0000000000000000000000000000000000000000 npx -y agentpay-mcp
36
+ ```
37
+
38
+ Expected result: `initialize` returns `agentpay-mcp`, then `tools/list` returns the payment and budget tools. The package must not generate a wallet, ask for hosted custody, or sign any payment during listing introspection.
39
+
40
+ ## Tool description standard
41
+
42
+ Directory-facing paid tools should tell buyers when to use the tool and when not to use it.
43
+
44
+ - `x402_pay`: use for one capped paid HTTP request; do not use for unknown networks, missing spend caps, or uninitialized Streamable HTTP MCP sessions.
45
+ - `x402_session_start`: use for a reusable paid entitlement; do not use if the provider lacks session semantics or if the buyer cannot store the returned session ID.
46
+ - `x402_session_fetch`: use after a valid session exists; do not use as a payment bypass or before `x402_session_start`.
47
+ - Budget tools: use for local policy enforcement before signing; do not treat catalog metadata as approval.
48
+
49
+ Every input field on paid tools must explain units, defaults, and failure behavior. Amount caps should name ETH-equivalent units. Network fields should name Base mainnet `8453` and Base Sepolia `84532` where relevant.
50
+
51
+ ## Buyer safety language
52
+
53
+ AgentPay MCP metadata must preserve these claims:
54
+
55
+ - non-custodial local signing
56
+ - operator-supplied wallet configuration
57
+ - Base mainnet and Base Sepolia x402 exact-payment support
58
+ - fail-closed unsupported networks
59
+ - spend caps before signing
60
+ - receipt/audit trail requirements
61
+
62
+ Directory metadata rule: do not claim directory hosting, managed wallets, or verified listings that are not live.
@@ -0,0 +1,40 @@
1
+ {
2
+ "schema_version": "2026-05-03.agentpay-mcp.directory-proof.v1",
3
+ "name": "AgentPay MCP",
4
+ "package": "agentpay-mcp",
5
+ "mcp_name": "io.github.up2itnow0822/agentpay",
6
+ "repository": "https://github.com/up2itnow0822/agentpay-mcp",
7
+ "homepage": "https://github.com/up2itnow0822/agentpay-mcp#readme",
8
+ "description": "Non-custodial x402 payment, budget, and receipt tools for MCP clients.",
9
+ "install": {
10
+ "npx": {
11
+ "command": "npx",
12
+ "args": ["-y", "agentpay-mcp"]
13
+ },
14
+ "docker": {
15
+ "build": "docker build -t agentpay-mcp:registry-check .",
16
+ "run": "docker run --rm -i -e AGENT_WALLET_ADDRESS=0x0000000000000000000000000000000000000000 agentpay-mcp:registry-check"
17
+ }
18
+ },
19
+ "metadata_files": [
20
+ "glama.json",
21
+ "smithery.yaml",
22
+ "llms.txt",
23
+ "docs/directory-introspection-readiness.md",
24
+ "docs/mcp-registry-listing-proof.md"
25
+ ],
26
+ "listing_proofs": {
27
+ "glama": "https://glama.ai/mcp/servers/up2itnow0822/claw-pay-mcp",
28
+ "npm": "https://www.npmjs.com/package/agentpay-mcp"
29
+ },
30
+ "custody_model": "operator_supplied_non_custodial_wallet",
31
+ "supported_x402_networks": [
32
+ { "chain_id": 8453, "network": "base", "purpose": "production" },
33
+ { "chain_id": 84532, "network": "base-sepolia", "purpose": "test" }
34
+ ],
35
+ "do_not_use_when": [
36
+ "The buyer expects the MCP directory to custody private keys.",
37
+ "The paid endpoint offers only unsupported networks.",
38
+ "The buyer cannot enforce a spend cap before signing."
39
+ ]
40
+ }
@@ -0,0 +1,121 @@
1
+ # Paid MCP gateway hardening checklist
2
+
3
+ `create-mcpay@0.7.1` makes Cloudflare Worker paid-agent gateways look easy to scaffold. Its README claims x402-compatible signup, hashed bearer keys, Durable Object atomic charging, validate-before-charge behavior, default-deny scopes, no admin CORS, and 36 attack-scenario coverage.
4
+
5
+ That raises the bar for AgentPay MCP docs. Builders will compare paid MCP gateways on security defaults, not just on whether an HTTP 402 handshake exists.
6
+
7
+ ## Hardening checks
8
+
9
+ A paid MCP gateway should pass these checks before public use:
10
+
11
+ ### Signup and challenge parsing
12
+
13
+ - `/v1/signup` or equivalent returns HTTP 402 before a payment credential exists.
14
+ - The challenge is visible in a payment-aware header, not only in a JSON body.
15
+ - Network, asset, amount, decimals, and recipient are parsed before any key is minted.
16
+ - Body-only payment metadata fails closed for buyer verification.
17
+
18
+ ### Key minting
19
+
20
+ - Raw bearer token is visible only at mint time.
21
+ - Stored token material is hashed with `sha256`, `bcrypt`, or `argon2`.
22
+ - Admin key comparison is timing safe.
23
+ - Minting has a maximum balance ceiling.
24
+
25
+ ### Atomic billing
26
+
27
+ - Debit is atomic.
28
+ - A real concurrency guard is present, such as Durable Object `blockConcurrencyWhile`, a transaction, or a lock.
29
+ - Malformed requests do not charge the buyer.
30
+ - Provider failure refund policy is documented before production use.
31
+
32
+ ### Scope defaults and browser surface
33
+
34
+ - A key with no explicit scopes cannot call paid endpoints.
35
+ - Endpoint to scope mapping has one source of truth.
36
+ - Admin routes do not expose browser CORS.
37
+ - Request body reads are bounded, with 16 KB as the preferred default.
38
+
39
+ ### Buyer audit trail
40
+
41
+ Each paid call needs an audit row with:
42
+
43
+ - buyer or key identity,
44
+ - endpoint or tool name,
45
+ - charged amount,
46
+ - payment receipt or transaction reference,
47
+ - idempotency key,
48
+ - balance before and after charge.
49
+
50
+ ## Test fixture response
51
+
52
+ The helper added in this response is `src/utils/paid-mcp-gateway-hardening.ts`. It scores a gateway fixture and fails closed when a scaffold skips any required control.
53
+
54
+ ```ts
55
+ import { verifyPaidMcpGatewayHardening } from './src/utils/paid-mcp-gateway-hardening.js';
56
+
57
+ const result = verifyPaidMcpGatewayHardening({
58
+ signup: {
59
+ enabled: true,
60
+ challengeStatus: 402,
61
+ challengeHeader: 'Payment realm="signup", protocol="x402"',
62
+ validatesBeforeKeyMint: true,
63
+ },
64
+ challengeParsing: {
65
+ validatesNetwork: true,
66
+ validatesAsset: true,
67
+ validatesAmount: true,
68
+ validatesRecipient: true,
69
+ rejectsBodyOnlyChallenge: true,
70
+ },
71
+ keyMinting: {
72
+ rawTokenVisibleOnlyAtMint: true,
73
+ tokenHashAlgorithm: 'sha256',
74
+ adminKeyTimingSafe: true,
75
+ maxMintCeiling: true,
76
+ },
77
+ billing: {
78
+ atomicDebit: true,
79
+ concurrencyGuard: 'durable-object-blockConcurrencyWhile',
80
+ noChargeOnValidationFailure: true,
81
+ refundPolicyForProviderFailure: true,
82
+ },
83
+ scopes: {
84
+ defaultDeny: true,
85
+ endpointScopeMapSingleSource: true,
86
+ },
87
+ browserSurface: {
88
+ adminCorsDisabled: true,
89
+ bodyReadLimitBytes: 16384,
90
+ },
91
+ buyerAudit: {
92
+ recordsBuyer: true,
93
+ recordsEndpoint: true,
94
+ recordsAmount: true,
95
+ recordsPaymentReceipt: true,
96
+ recordsIdempotencyKey: true,
97
+ recordsBalanceBeforeAfter: true,
98
+ },
99
+ });
100
+
101
+ if (!result.ok) throw new Error(result.failures.join('\n'));
102
+ ```
103
+
104
+ ## create-mcpay response map
105
+
106
+ | Template claim | AgentPay hardening response |
107
+ |---|---|
108
+ | x402-compatible signup | Require HTTP 402 signup challenge and receipt validation before key minting |
109
+ | Hashed bearer keys | Require raw token only at mint time and hashed storage |
110
+ | Durable Object charging | Require atomic debit plus a named concurrency guard |
111
+ | Validate-before-charge | Require no-charge validation failures in tests |
112
+ | Default-deny scopes | Require explicit scopes and one endpoint-scope source of truth |
113
+ | No admin CORS | Require admin routes to stay outside browser CORS |
114
+ | Security posture claims | Convert claims into fixture checks and audit proof |
115
+
116
+ ## Validation proof
117
+
118
+ - Helper: `src/utils/paid-mcp-gateway-hardening.ts`
119
+ - Tests: `tests/paid-mcp-gateway-hardening.test.ts`
120
+ - README link: `README.md`
121
+ - Validation command: `npm test -- --run tests/paid-mcp-gateway-hardening.test.ts`
@@ -0,0 +1,71 @@
1
+ # Paid-provider health proof checklist
2
+
3
+ A paid agent should not route work because a marketplace status page says the base service is up. It needs a machine-readable proof that answers a narrower question: which provider can receive paid work now, and what evidence says the payment path is safe?
4
+
5
+ Voidly Pay's public `pay-health/latest.json` is the right direction. On May 2, 2026, the feed reported base `health.ok: true`, but top-level `ok: false`: 5 providers probed, 2 ok, 3 failing, and `success_rate: 0.4`. Its `pay-health/stale.json` also showed stale failure streaks of 207, 207, and 312 for the failing capabilities. That is exactly why buyer agents need provider-level gates before paying.
6
+
7
+ AgentPay's buyer rule is fail closed. A provider is routable only when the health proof, receipt state, stale counter, and x402 payment metadata all pass policy.
8
+
9
+ ## Required fields
10
+
11
+ Use [`paid-provider-health-proof.schema.json`](paid-provider-health-proof.schema.json) for a portable proof shape and [`fixtures/paid-provider-health-proof-voidly-2026-05-02.json`](fixtures/paid-provider-health-proof-voidly-2026-05-02.json) for a concrete failure fixture.
12
+
13
+ The proof must include:
14
+
15
+ - `generated_at` and `source` so buyers can reject stale or unauthenticated feeds.
16
+ - `health.ok` and top-level `ok` as separate values. Base service health does not prove provider routability.
17
+ - `summary.providers_probed`, `providers_ok`, `providers_failing`, and `success_rate`.
18
+ - Per-provider `status`, `stale_streak`, `receipt_state`, `receipt_id`, `verified`, and latency.
19
+ - Per-provider `x402_payment` metadata with `network`, `asset`, `payTo`, and amount fields.
20
+ - `routing.fail_closed: true` plus an explicit `decision` and reasons.
21
+
22
+ ## Buyer routing policy
23
+
24
+ Before signing, the buyer should verify:
25
+
26
+ 1. The proof is fresh enough for the task's risk level.
27
+ 2. `summary.success_rate` meets the buyer's minimum.
28
+ 3. `providers_ok + providers_failing` matches `providers_probed`.
29
+ 4. Every selected provider has `status: ok`, `stale_streak` at or below policy, and a verified receipt state.
30
+ 5. The x402 offer uses an allowed `network`, allowed `asset`, non-zero allowlisted `payTo`, and a positive amount.
31
+ 6. `routing.fail_closed` is true. If the proof is missing or inconsistent, do not pay.
32
+
33
+ ## TypeScript verification
34
+
35
+ ```ts
36
+ import { verifyPaidProviderHealthProof } from 'agentpay-mcp/dist/utils/paid-provider-health-proof.js';
37
+ import proof from './paid-provider-health-proof-voidly-2026-05-02.json' assert { type: 'json' };
38
+
39
+ const result = verifyPaidProviderHealthProof(proof, {
40
+ minimumSuccessRate: 0.95,
41
+ maxProofAgeMs: 15 * 60 * 1000,
42
+ maxProviderStaleStreak: 2,
43
+ allowedNetworks: ['base-sepolia'],
44
+ allowedAssets: ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'],
45
+ allowedPayTo: [
46
+ '0x1111111111111111111111111111111111111111',
47
+ '0x2222222222222222222222222222222222222222'
48
+ ],
49
+ requireVerifiedReceipt: true,
50
+ requireX402PaymentMetadata: true
51
+ });
52
+
53
+ if (!result.ok) {
54
+ // Fail closed: do not sign x402 payment yet.
55
+ console.error(result.failures);
56
+ }
57
+ ```
58
+
59
+ The May 2 Voidly-derived fixture is expected to fail with a strict production policy because success rate is 0.4 and three providers are stale. The two ok providers still show how a buyer validates receipt and x402 metadata once the network-level proof is healthy.
60
+
61
+ ## Fail-closed routing guidance
62
+
63
+ Use these defaults for paid provider selection:
64
+
65
+ - Treat missing health proof as `deny`.
66
+ - Treat stale `generated_at` as `deny` unless a human explicitly approves degraded mode.
67
+ - Treat `health.ok: true` plus `ok: false` as `deny` for new paid work.
68
+ - Treat missing `x402_payment.network`, `asset`, or `payTo` as `deny`.
69
+ - Treat mismatched network, asset, or recipient as `deny` even if the provider's last receipt was verified.
70
+ - Log the proof hash, selected provider ID, receipt ID, x402 network, asset, payTo, amount, policy version, and approval ID before signing.
71
+
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/up2itnow0822/agentpay-mcp/blob/main/docs/paid-provider-health-proof.schema.json",
4
+ "title": "AgentPay paid-provider health proof",
5
+ "type": "object",
6
+ "required": ["schema", "generated_at", "source", "health", "ok", "summary", "providers", "routing"],
7
+ "properties": {
8
+ "schema": { "const": "agentpay-paid-provider-health-proof/v1" },
9
+ "generated_at": { "type": "string", "format": "date-time" },
10
+ "source": {
11
+ "type": "object",
12
+ "required": ["name"],
13
+ "properties": {
14
+ "name": { "type": "string", "minLength": 1 },
15
+ "url": { "type": "string", "format": "uri" },
16
+ "commit": { "type": "string", "minLength": 7 },
17
+ "raw_schema": { "type": "string", "minLength": 1 }
18
+ },
19
+ "additionalProperties": false
20
+ },
21
+ "health": {
22
+ "type": "object",
23
+ "required": ["ok"],
24
+ "properties": {
25
+ "ok": { "type": "boolean" },
26
+ "latency_ms": { "type": "number", "minimum": 0 }
27
+ },
28
+ "additionalProperties": false
29
+ },
30
+ "ok": { "type": "boolean" },
31
+ "summary": {
32
+ "type": "object",
33
+ "required": ["providers_probed", "providers_ok", "providers_failing", "success_rate"],
34
+ "properties": {
35
+ "providers_probed": { "type": "integer", "minimum": 0 },
36
+ "providers_ok": { "type": "integer", "minimum": 0 },
37
+ "providers_failing": { "type": "integer", "minimum": 0 },
38
+ "success_rate": { "type": "number", "minimum": 0, "maximum": 1 }
39
+ },
40
+ "additionalProperties": false
41
+ },
42
+ "providers": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "required": ["provider_id", "status", "stale_streak", "receipt_state", "verified"],
47
+ "properties": {
48
+ "provider_id": { "type": "string", "minLength": 1 },
49
+ "capability": { "type": "string", "minLength": 1 },
50
+ "capability_id": { "type": "string", "minLength": 1 },
51
+ "status": { "enum": ["ok", "failed", "stale", "unknown"] },
52
+ "stale_streak": { "type": "integer", "minimum": 0 },
53
+ "receipt_state": { "enum": ["verified", "pending_acceptance_verified", "missing", "invalid", "unverified"] },
54
+ "receipt_id": { "type": "string", "minLength": 1 },
55
+ "verified": { "type": "boolean" },
56
+ "latency_ms": { "type": "number", "minimum": 0 },
57
+ "error": { "type": "string", "minLength": 1 },
58
+ "x402_payment": {
59
+ "type": "object",
60
+ "required": ["scheme", "network", "asset", "payTo"],
61
+ "properties": {
62
+ "scheme": { "const": "exact" },
63
+ "network": { "type": "string", "minLength": 1 },
64
+ "asset": { "type": "string", "minLength": 1 },
65
+ "payTo": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" },
66
+ "amountRequired": { "type": "string", "pattern": "^[1-9][0-9]*$" },
67
+ "maxAmountRequired": { "type": "string", "pattern": "^[1-9][0-9]*$" },
68
+ "resource": { "type": "string", "format": "uri" },
69
+ "facilitator": { "type": "string", "minLength": 1 }
70
+ },
71
+ "additionalProperties": false
72
+ }
73
+ },
74
+ "additionalProperties": false
75
+ }
76
+ },
77
+ "routing": {
78
+ "type": "object",
79
+ "required": ["fail_closed", "decision", "reason"],
80
+ "properties": {
81
+ "fail_closed": { "const": true },
82
+ "decision": { "enum": ["allow", "deny", "degraded"] },
83
+ "reason": { "type": "array", "items": { "type": "string", "minLength": 1 } }
84
+ },
85
+ "additionalProperties": false
86
+ }
87
+ },
88
+ "additionalProperties": false
89
+ }
@@ -0,0 +1,61 @@
1
+ # Paid MCP discovery and budget response
2
+
3
+ SettleGrid is useful market validation for paid MCP. It shows that discovery, metering, budget checks, remote MCP endpoints, and protocol routing are becoming part of the buyer's comparison set.
4
+
5
+ AgentPay MCP should answer that shift directly: discovery helps an agent find a paid tool, but it must not become payment authorization.
6
+
7
+ ## Verified SettleGrid signal
8
+
9
+ On 2026-05-01, the Intelligence cycle verified these public SettleGrid claims and endpoints:
10
+
11
+ - `@settlegrid/mcp` on npm at version `0.1.1`
12
+ - `@settlegrid/discovery` on npm at version `1.0.1`
13
+ - repo commits at 2026-05-02T00:47:42Z and 2026-05-02T00:55:11Z, including a Stripe-only rail cutover playbook
14
+ - README claims for 14 payment protocols, built-in discovery, agent identity, budget enforcement, an HTTP MCP endpoint, an MCP discovery server, and 1,017 billing-ready templates
15
+ - `https://settlegrid.ai/api/openapi.json` returning paths including `/api/sdk/validate-key`, `/api/sdk/meter`, `/api/sessions`, `/api/agents`, and `/api/x402/verify`
16
+ - `https://settlegrid.ai/api/v1/discover` returning active monetized tool records with per-method pricing
17
+
18
+ Those are real platform signals. They do not remove the buyer's need to verify before payment.
19
+
20
+ ## AgentPay's answer
21
+
22
+ AgentPay MCP wins by keeping spend authority at the buyer edge.
23
+
24
+ A paid MCP directory can tell an agent where a tool is. AgentPay decides whether the agent is allowed to pay for it.
25
+
26
+ Before signing an x402 payment, AgentPay should verify:
27
+
28
+ 1. The response is HTTP 402 with a parseable `payment-required` or `x-payment-required` header.
29
+ 2. `payTo` is present, valid, expected, and non-zero.
30
+ 3. The requested network is on the wallet policy allowlist.
31
+ 4. The requested asset matches an allowed asset exactly.
32
+ 5. The amount is positive and under the per-call or session cap.
33
+ 6. Required human approval is already `approved`.
34
+ 7. The audit row can record endpoint, tool call, recipient, network, asset, amount, policy version, approval state, and receipt.
35
+ 8. Any hosted proxy or operator-pooled upstream credential path is explicitly accepted by policy.
36
+
37
+ ## What to copy and what not to copy
38
+
39
+ Copy the buyer-visible parts:
40
+
41
+ - clean directory metadata
42
+ - simple install paths
43
+ - live discovery endpoints
44
+ - per-tool pricing fields
45
+ - clear metering and budget language
46
+
47
+ Do not copy hosted lock-in as the default:
48
+
49
+ - do not require platform-held buyer funds by default
50
+ - do not hide recipient or asset fields behind a dashboard
51
+ - do not treat directory discovery as spend approval
52
+ - do not let platform-side budget checks replace wallet-edge caps
53
+
54
+ ## Recommended AgentPay ship path
55
+
56
+ 1. Keep the hosted proxy verifier documented and packaged.
57
+ 2. Add a discovery plus budget FAQ to the README that separates directory search from x402 authorization.
58
+ 3. Add a docs test that fails if the required buyer controls disappear from this guide.
59
+ 4. Add a scanner fixture that proves a discovered paid MCP endpoint still fails closed until approval and spend caps pass.
60
+
61
+ AgentPay's posture is simple: discover widely, verify locally, cap before signing, approve intentionally, and audit every paid call.
@@ -0,0 +1,22 @@
1
+ # x402 Ecosystem Submission Notes
2
+
3
+ This document tracks the public ecosystem listing request for `agentpay-mcp` in the x402 Foundation website repository.
4
+
5
+ - **Upstream PR:** `x402-foundation/x402` PR #1562
6
+ - **Title:** `feat(ecosystem): add agentpay-mcp to client-side integrations`
7
+ - **Proposed category:** Client-Side Integrations
8
+ - **Package:** [`agentpay-mcp` on npm](https://www.npmjs.com/package/agentpay-mcp)
9
+
10
+ ## Why this integration matters
11
+
12
+ `agentpay-mcp` is focused on the payer/client side of x402 workflows. It allows autonomous agents to detect `402 Payment Required` responses, execute the payment flow, and retry requests with policy controls.
13
+
14
+ ## Merge blockers called out in the upstream PR
15
+
16
+ At the time these notes were captured, the upstream PR reported:
17
+
18
+ 1. missing required reviewer approval from a maintainer with write access;
19
+ 2. unsigned or unverified commit signature requirement not yet satisfied; and
20
+ 3. a Vercel authorization gate for deployment preview.
21
+
22
+ These blockers are in the upstream repository and are not controlled by this repository's CI.
@@ -40,7 +40,7 @@ That is different from routing every paid call through a proxy that owns the dow
40
40
  AgentPay MCP currently has public discovery and package proof:
41
41
 
42
42
  - Glama listing: https://glama.ai/mcp/servers/up2itnow0822/claw-pay-mcp
43
- - npm package: `agentpay-mcp@4.1.6` or newer
43
+ - npm package: `agentpay-mcp@4.1.8` or newer
44
44
  - Packaged catalog metadata: `glama.json` and `smithery.yaml`
45
45
  - Packaged install paths: `npx` and Docker
46
46
  - Introspection proof: 27 MCP tools, including `x402_pay`, `check_budget`, `set_spend_policy`, and `otel_evaluate_spend`
@@ -0,0 +1,75 @@
1
+ # AgentPay MCP x402 v2.11 paid MCP compatibility proof
2
+
3
+ Toolstem's May 3 paid MCP updates made a subtle problem visible: a payment can settle and the MCP call can still fail if the client, gateway, or browser uses the wrong header contract.
4
+
5
+ AgentPay MCP treats the following as the v2.11 paid MCP baseline for buyer agents and hosted gateways.
6
+
7
+ ## Header contract
8
+
9
+ - Payment request header from client to gateway: `Payment-Signature`
10
+ - Deprecated header: `X-Payment`
11
+ - Receipt header from gateway to client: `payment-response`
12
+ - MCP session continuity header from gateway to client: `mcp-session-id`
13
+ - Browser-readable CORS expose value: `payment-response, mcp-session-id`
14
+
15
+ Do not accept `X-Payment` as the primary path in new paid MCP integrations. Keep it only as a migration alias when a legacy upstream requires it, and log that downgrade as compatibility debt.
16
+
17
+ ## Browser and Streamable HTTP gateway rule
18
+
19
+ If a paid MCP gateway serves browser-based clients, set this response header on initialize and paid tool responses:
20
+
21
+ ```http
22
+ Access-Control-Expose-Headers: payment-response, mcp-session-id
23
+ ```
24
+
25
+ Without it, browser clients may pay successfully and still be unable to read the receipt or session identifier. That breaks audit trails, retries, and follow-up `tools/call` requests.
26
+
27
+ ## Streamable HTTP initialize sequence
28
+
29
+ Paid Streamable HTTP clients should use this order:
30
+
31
+ 1. Send MCP `initialize` first. If the gateway charges for initialize, sign the request with `Payment-Signature`.
32
+ 2. Read `payment-response` and `mcp-session-id` from exposed response headers.
33
+ 3. Send `notifications/initialized` only after initialize succeeds.
34
+ 4. Call `tools/list` after the initialized notification is accepted.
35
+ 5. Call `tools/call` with `mcp-session-id` when the gateway requires session continuity.
36
+
37
+ Do not call `tools/call` before initialize. Do not hide receipt or session headers behind browser CORS. Do not let a model retry a paid call when initialize failed or the session header is missing.
38
+
39
+ ## AgentPay MCP client behavior
40
+
41
+ `x402_pay` remains the direct paid-fetch tool for one-off x402 endpoints. Use it when the buyer already has a target URL, a spend cap, and no reusable session requirement.
42
+
43
+ `x402_session_start` is the better choice when the paid endpoint supports session semantics or the buyer expects repeated calls under one paid entitlement.
44
+
45
+ Do not use either tool when the offered network is outside the configured Base mainnet or Base Sepolia x402 policy. AgentPay MCP fails closed instead of guessing a rail.
46
+
47
+ ## Network-aware receipt links
48
+
49
+ AgentPay MCP uses the configured `CHAIN_ID` to turn transaction hashes into the right receipt link:
50
+
51
+ | Chain ID | Network | Receipt base URL |
52
+ |----------|---------|------------------|
53
+ | `84532` | Base Sepolia | `https://sepolia.basescan.org/tx/<txHash>` |
54
+ | `8453` | Base mainnet | `https://basescan.org/tx/<txHash>` |
55
+
56
+ A receipt proof must store the chain ID with the transaction hash. A hash without network context is not enough for buyer auditability.
57
+
58
+ ## Base Sepolia to Base mainnet cutover checklist
59
+
60
+ Use this checklist before moving a paid MCP gateway from testnet to Base mainnet:
61
+
62
+ 1. Change `CHAIN_ID` from `84532` to `8453`.
63
+ 2. Change `RPC_URL` from `https://sepolia.base.org` or a Sepolia provider endpoint to a Base mainnet endpoint.
64
+ 3. Replace testnet USDC or test payment assets with the production Base asset address accepted by the gateway.
65
+ 4. Confirm `payTo` is the production recipient and not a test wallet.
66
+ 5. Keep `Payment-Signature` as the signing header. Do not revert to `X-Payment` during cutover.
67
+ 6. Expose `payment-response` and `mcp-session-id` through CORS for browser clients.
68
+ 7. Run initialize, `notifications/initialized`, `tools/list`, and one capped `tools/call` on mainnet with a small spend cap.
69
+ 8. Store receipt links with `chainId=8453` and verify the links point to `basescan.org`, not `sepolia.basescan.org`.
70
+ 9. Update README, registry metadata, and any directory listing notes from Base Sepolia examples to Base mainnet production status.
71
+ 10. Keep a rollback note that returns the gateway to `84532` only for test traffic.
72
+
73
+ ## Verification artifact
74
+
75
+ The constants and receipt-link helper live in `src/utils/x402-v211-compatibility.ts`. Tests in `tests/x402-v211-compatibility.test.ts` assert the header names, CORS exposure value, Streamable HTTP sequence, and Base Sepolia/Base mainnet receipt links.
package/llms.txt ADDED
@@ -0,0 +1,21 @@
1
+ # AgentPay MCP
2
+
3
+ AgentPay MCP is a non-custodial MCP server for x402 payment, budget, receipt, and wallet operations. It is published as `agentpay-mcp` and uses the MCP package identity `io.github.up2itnow0822/agentpay`.
4
+
5
+ Repository: https://github.com/up2itnow0822/agentpay-mcp
6
+ npm: https://www.npmjs.com/package/agentpay-mcp
7
+ Glama listing: https://glama.ai/mcp/servers/up2itnow0822/claw-pay-mcp
8
+
9
+ Use AgentPay MCP when an agent needs to pay x402-protected HTTP or MCP endpoints with local wallet control, spend caps, and receipt auditability. Use `x402_pay` for one capped paid request. Use `x402_session_start` and `x402_session_fetch` when a provider supports reusable paid sessions.
10
+
11
+ Do not use AgentPay MCP as a managed-wallet custody service. Do not ask a directory or hosted catalog to store `AGENT_PRIVATE_KEY`. Do not sign payments for unsupported networks or endpoints that do not expose enough payment metadata to verify `payTo`, network, asset, amount, receipt, and session state.
12
+
13
+ Required environment variables for paid calls: `AGENT_PRIVATE_KEY`, `AGENT_WALLET_ADDRESS`, `CHAIN_ID`, and `RPC_URL`. Directory introspection can list tools with a placeholder wallet address and no private key because no payment is signed during `initialize` or `tools/list`.
14
+
15
+ Important docs:
16
+
17
+ - `README.md` for user setup and tool list
18
+ - `docs/x402-v211-paid-mcp-compatibility.md` for `Payment-Signature`, `payment-response`, `mcp-session-id`, CORS, Streamable HTTP initialize order, receipt links, and Base Sepolia to Base mainnet cutover
19
+ - `docs/mcp-registry-listing-proof.md` for registry, Glama, Smithery, and install-readiness proof
20
+ - `docs/directory-introspection-readiness.md` for npx and Docker introspection
21
+ - `docs/dependency-pin-policy.md` for payment-critical dependency pinning