{
  "markdown": "# k402-mcp — pay-per-call APIs for AI agents, settled in Kaspa\n\nAn MCP server that gives any agent (Claude Code, Claude Desktop, agent SDKs) a catalog of\n**agent-payable APIs**: text tools (summarize, schema-guaranteed extraction, classify, rewrite),\nweb reading, embeddings + semantic search, live Kaspa mainnet chain data, GPU model tiers,\ncovenants-as-a-service (compile/derive/inspect/build/check/broadcast Silverscript covenants), and\nRISC Zero attestation-as-a-service (upload a guest, preflight for a cycle-exact quote, prove, verify).\n**No account, no card, no API key** — the agent opens a session, gets a personal KAS deposit\naddress, and every call meters against the prepaid balance. Prices are USD-pegged, fractions of a\ncent per call, settled on Kaspa L1 (sub-second, ~zero fees).\n\nThe payment loop is agent-native: an unfunded call returns *instructions* (\"send KAS to this\naddress, this call costs X\"), so an agent can discover the service, learn how to pay, and use it\nautonomously — the [x402](https://www.x402.org/) idea, on Kaspa.\n\n## Hosted endpoint — zero install\n\nThe same server runs hosted at the public gateway (streamable HTTP):\n\n```\nhttps://x402-compute.68cxgfyr0.workers.dev/mcp\n```\n\nClaude Code:\n```bash\nclaude mcp add --transport http k402 https://x402-compute.68cxgfyr0.workers.dev/mcp\n```\n\nHosted sessions are **per-connection**: `open_session` binds the payment session to your MCP\nconnection and returns the key — save it, and re-attach with `use_session(<key>)` after a\nreconnect. Nothing is shared between connections.\n\n## Install (local stdio)\n\n```bash\npip install k402-mcp\n```\n\nClaude Code:\n```bash\nclaude mcp add k402 -- k402-mcp\n```\n\nClaude Desktop / generic MCP config:\n```json\n{ \"mcpServers\": { \"k402\": { \"command\": \"k402-mcp\" } } }\n```\n\nEnv (all optional): `K402_GATEWAY` (defaults to the public gateway), `K402_SESSION` (pin a funded\nsession key), `K402_STATE` (where the auto-opened session persists, default `~/.k402/session.json`).\n\n## Use\n\n1. `catalog` — see every service and its live KAS/USD price (free)\n2. `open_session` — get a session + personal Kaspa mainnet deposit address (free); fund it from\n   any wallet (min 0.25 KAS — confirmed in seconds)\n3. Call anything: `summarize`, `extract`, `classify`, `rewrite`, `read_url`, `embed_text`,\n   `search_index`/`search_query`, `kaspa_balance`, `kaspa_utxos`, `kaspa_tx_status`,\n   `kaspa_fee_estimate`, `kaspa_network`, `generate` (tiers: chat / llama / reason / think / code / kaspa-expert),\n   `covenant_compile`/`covenant_address`/`covenant_utxos`/`covenant_build`/`covenant_check`/`covenant_broadcast`,\n   `prove_guest_upload`/`prove_preflight`/`prove_submit`/`job_status`/`job_result`/`attest_verify`,\n   `payment_options`, `pay_per_call`\n4. `session_status` — watch the balance draw down (free)\n\n**New here? Start with `open_session`** — one funded deposit address, and every call meters\nagainst it. That's the whole loop. The other schemes (per-call coins, or trustless payment\nchannels) are for when you want them; `payment_options` explains each.\n\n### Trustless payment channels (`kaspa-channel`)\n\nWhere the gateway offers it, `channel_config`/`channel_status` expose a covenant payment channel:\nyour KAS sits in a Kaspa L1 covenant (not the merchant's wallet), and you pay per call with signed\nvouchers — the merchant can only ever claim what you signed, and you reclaim the rest. Opening and\nfunding a channel needs your Kaspa key, so that part runs in the [`k402`](https://pypi.org/project/k402/)\nPython client (`k402.channel`); these MCP tools cover discovery and status.\n\nExample, in Claude Code after `claude mcp add`:\n\n> \"Use the k402 tools to check the current Kaspa network status and summarize https://kaspa.org\"\n\nThe first call returns how-to-pay instructions; fund the deposit address it gives you and retry.\n\n## Notes & honest caveats\n\n- **Prototype.** Payments settle either custodial-prepaid (sessions) or trustlessly via\n  `kaspa-channel` covenant payment channels (live on mainnet, covenant unaudited — channel sizes\n  are capped). Keep balances small: a few KAS covers thousands of calls.\n- Paid tools return `payment_required` + instructions instead of failing opaquely.\n- The gateway rate-limits per IP; prices float with KAS/USD, so `catalog` shows current numbers.\n- Need KAS? Any exchange or wallet works — deposits are plain mainnet transfers.\n\n---\n`mcp-name: io.github.Kali123411/k402`\n\nMIT © Kaspa Lab\n",
  "bytes": 4439,
  "sha": "fd726fd151409757a1d749961361c406517af1c52dbe4c08ead12b980601290e",
  "repo_slug": "kali123411/k402-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kali123411_k402_942ca471/readme"
}