x402 government-data search

v0.2.1
io.github.lspain1994/x402-datasets-mcp Checked 8 hours ago Published 2 months ago

Search five paid x402 government-data APIs (IRS, FDA, SSA, HCAD); full records paid over x402.

An MCP server that lets any MCP client (Claude Desktop, ChatGPT desktop, Cursor, …) search the x402 government-data APIs and see record previews. It calls the free routes only. Full records are paid, over x402. Every tool result names the paid URL and price so the client can pay it with an x402 client library. This server never holds a wallet. See docs/expansion/DECISIONS.md D15. Restart Claude Desktop. The three tools appear under the plug icon.

Summary extracted from the README.

x402 datasets — MCP server

An MCP server that lets any MCP client (Claude Desktop, ChatGPT desktop, Cursor, …) search the x402 government-data APIs and see record previews.

It calls the free routes only. Full records are paid, over x402. Every tool result names the paid URL and price so the client can pay it with an x402 client library. This server never holds a wallet. See docs/expansion/DECISIONS.md D15.

Datasets

key what free search
irs IRS Internal Revenue Bulletin — Revenue Rulings, Procedures, Notices, Treasury Decisions, 2003→now keyword
fda FDA Investigations Operations Manual — the inspector manual, 546 sections keyword
hcad HCAD Harris County property tax — protest outcomes + value history, no owner names street address
poms SSA Program Operations Manual System — the rulebook SSA staff use for retirement, disability, SSI, Medicare claims keyword
irm IRS Internal Revenue Manual — internal procedures for exams, collection, appeals, penalties, disclosure keyword

Tools

  • list_datasets() — the table above, with each dataset's id format and paid routes.
  • search_regulations({ dataset, query, limit? }) — full-text search the free index. For hcad, query is a street address.
  • get_record_preview({ dataset, id }) — free metadata and a snippet for one record, plus the paid x402 route(s) and price.

Run it

cd mcp
npm install
npm test        # 8 tests, no network
npm start       # starts the stdio server

Add it to Claude Desktop

Edit claude_desktop_config.json:

{
  "mcpServers": {
    "x402-datasets": {
      "command": "node",
      "args": ["/absolute/path/to/x402/mcp/index.mjs"]
    }
  }
}

Restart Claude Desktop. The three tools appear under the plug icon.

Paying for a full record

get_record_preview returns a paid_routes list, for example:

https://fda-iom-api.canvas-cart.workers.dev/section/chapter-05--5-1-1/full   $0.01 USDC

Call that URL with any x402 client (USDC on Base mainnet, Coinbase CDP facilitator). Read the 402 challenge, pay, retry. The repo's client/pay-and-fetch.mjs is a working example.