{
  "markdown": "# US Economic, SEC EDGAR & On-Chain Data — a pay-per-call MCP server\n\n21 data tools that AI agents discover and pay for **per call**, settled in USDC on **Base** via the\n[x402](https://x402.org) payment protocol. No account, no API key, no subscription.\n\n**Live:** <https://x402.agentfund.net> · [Agent guide](https://x402.agentfund.net/SKILL.md) ·\n[Verification ledger](https://x402.agentfund.net/VERIFICATION.md) ·\n[Settlements](https://x402.agentfund.net/monitor)\n\n| Endpoint | Purpose |\n| --- | --- |\n| `POST /mcp` | MCP over streamable-HTTP (stateless) |\n| `POST /x402/<tool>` | One HTTP route per tool; arguments as a plain JSON body |\n| `GET /openapi.json` | OpenAPI 3.1 discovery document with `x-payment-info` per route |\n| `GET /SKILL.md` | Agent-facing usage guide |\n| `GET /VERIFICATION.md` | How each tool was verified, and the upstream traps found |\n| `GET /monitor` | Live on-chain settlement dashboard |\n| `GET /health` | Liveness and configuration mode |\n\n## The tools\n\n**US macro** — `treasury_yield_curve`, `bls_cpi`, `macro_pce`, `macro_jobs`, `macro_gdp`,\n`macro_retail_sales`, `macro_housing`, `macro_energy`, `macro_release_calendar`\n\n**SEC EDGAR** — `edgar_filings_feed`, `edgar_financials`, `edgar_insider_transactions`,\n`edgar_13f_holdings`, `edgar_full_text_search`\n\n**On-chain EVM** — `onchain_token_balances`, `onchain_portfolio`, `onchain_cross_chain_balances`,\n`onchain_oracle_price`, `onchain_gas`\n\n**Pure compute** — `structured_json_repair`, `tabular_to_json`\n\nPrices run **$0.001–$0.03** per call.\n\n## Why these sources\n\nEvery tool wraps **free public-domain US government data** (Treasury, BLS, BEA, Census, EIA, SEC\nEDGAR) or a **direct on-chain read** via public RPC. There is no upstream vendor licence, so\nnothing here can be revoked or repriced by a third party, and the cost of goods is zero.\n\nThe trade-off is inherited from the publishers: government statistics are **lagged and revised**,\n13F is quarterly and stale by design, and none of this is market data. Those limits are stated\nplainly in [SKILL.md](SKILL.md) rather than buried.\n\n## Correctness\n\nEvery tool was checked against **live upstream data** before shipping — not only against unit\ntests, because a test written from the same wrong assumption as the code passes happily.\n\nThat caught six real defects, including 13F values being 1000× too large by following SEC's *own*\ndocumentation, and Census silently returning five regional rows where a national figure was\nexpected. Each is documented with the evidence that exposed it, and locked in by a regression\ntest: **[VERIFICATION.md](VERIFICATION.md)**.\n\n**A failed call is never billed.** The MCP SDK turns a thrown tool error into an HTTP 200 carrying\n`isError: true`; the payment gate inspects the result and returns errors **unsettled** rather than\ncharging for a result the caller never received.\n\n## Architecture\n\n- **x402 v2** (`@x402/core`, `@x402/evm`) with the Coinbase CDP facilitator on Base mainnet.\n- **MCP on Workers** via `@hono/mcp` `StreamableHTTPTransport` (the SDK's own transport is\n  Node-`http`-based). Stateless JSON.\n- **Two entry points, one payment path.** `/mcp` and `/x402/<tool>` both run through\n  `PaymentGate.chargeAndRun`, so money-safety rules cannot drift between them.\n- **Per-tool HTTP routes exist for discovery.** The x402 Bazaar indexes plain HTTP resources only\n  — every catalog entry is `type: \"http\"` — so an MCP endpoint alone can never be listed.\n- **Discovery needs no secrets.** `initialize`, `tools/list` and `ping` are answered without\n  payment configuration, so the server introspects cleanly on a fresh clone or in a CI sandbox.\n- **Validation uses `@cfworker/json-schema`, not Ajv** — Ajv compiles via `Function`, which\n  Workers forbid, and the schema is a runtime input so it cannot be precompiled.\n- **No private keys.** The server holds only a public payout address; `config.ts` refuses\n  private-key- or seed-shaped input.\n\nAdding a tool is a one-file change plus a line in `src/tools/index.ts`.\n\n## Development\n\n```bash\nnpm install\nnpm test          # 174 tests\nnpm run typecheck\nnpm run dev       # wrangler dev\nnpm run dev:node  # tsx watch src/node.ts\n```\n\nCopy `.dev.vars.example` to `.dev.vars` for local configuration. Only the **public** payout\naddress is ever needed — never a private key or seed phrase.\n\nDocs are mirrored into the bundle (Workers have no filesystem); run `npm run gen:docs` after\nediting `SKILL.md` or `VERIFICATION.md`, or `test/docs.test.ts` will fail on the drift.\n\n## Deployment\n\nProduction runs on **Cloudflare Workers**. Secrets are set with `wrangler secret put`, never in\n`wrangler.toml`:\n\n```bash\nnpx wrangler deploy --env production\n```\n\nA `Dockerfile` is included for self-hosting the Node entrypoint; it needs no secrets, so the\ncontainer starts and passes introspection out of the box. See\n[OPERATOR_CHECKLIST.md](OPERATOR_CHECKLIST.md) for the full runbook.\n\n## Buyer-side test clients\n\n```bash\nPAYER_PRIVATE_KEY=0x… node scripts/pay-test.mjs      # pay via /mcp\nPAYER_PRIVATE_KEY=0x… node scripts/pay-http.mjs      # pay via /x402/<tool>\nnode scripts/index-all.mjs                            # dry run: Bazaar index status\n```\n\nPayment is **gasless for the payer** (the facilitator submits the transaction), so a test wallet\nneeds USDC and no ETH. `index-all.mjs` skips already-indexed routes and refuses to spend without\n`--yes`.\n\n## Licence\n\nMIT (declared in `package.json`; no `LICENSE` file has been added yet).\n",
  "bytes": 5477,
  "sha": "dbe56e41401585e9b0decf218fb7251c32a75e99f21c0c5bb0626dbbbb908ab2",
  "repo_slug": "ktcod/x402-json-repair-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_net_agentfund_us_economic_macro_sec_edga_fe399e3c/readme"
}