Skip to main content

k402-mcp — pay-per-call APIs for AI agents, settled in Kaspa

An MCP server that gives any agent (Claude Code, Claude Desktop, agent SDKs) a catalog of agent-payable APIs: text tools (summarize, schema-guaranteed extraction, classify, rewrite), web reading, embeddings + semantic search, live Kaspa mainnet chain data, GPU model tiers, covenants-as-a-service (compile/derive/inspect/build/check/broadcast Silverscript covenants), and RISC Zero attestation-as-a-service (upload a guest, preflight for a cycle-exact quote, prove, verify). No account, no card, no API key — the agent opens a session, gets a personal KAS deposit address, and every call meters against the prepaid balance. Prices are USD-pegged, fractions of a cent per call, settled on Kaspa L1 (sub-second, ~zero fees).

The payment loop is agent-native: an unfunded call returns instructions ("send KAS to this address, this call costs X"), so an agent can discover the service, learn how to pay, and use it autonomously — the x402 idea, on Kaspa.

Install

pip install k402-mcp

Claude Code:

claude mcp add k402 -- k402-mcp

Claude Desktop / generic MCP config:

{ "mcpServers": { "k402": { "command": "k402-mcp" } } }

Env (all optional): K402_GATEWAY (defaults to the public gateway), K402_SESSION (pin a funded session key), K402_STATE (where the auto-opened session persists, default ~/.k402/session.json).

Use

  1. catalog — see every service and its live KAS/USD price (free)
  2. open_session — get a session + personal Kaspa mainnet deposit address (free); fund it from any wallet (min 0.25 KAS — confirmed in seconds)
  3. Call anything: summarize, extract, classify, rewrite, read_url, embed_text, search_index/search_query, kaspa_balance, kaspa_utxos, kaspa_tx_status, kaspa_fee_estimate, kaspa_network, generate (tiers: chat / reason / code / kaspa-expert), covenant_compile/covenant_address/covenant_utxos/covenant_build/covenant_check/covenant_broadcast, prove_guest_upload/prove_preflight/prove_submit/job_status/job_result/attest_verify, payment_options, pay_per_call
  4. session_status — watch the balance draw down (free)

Example, in Claude Code after claude mcp add:

"Use the k402 tools to check the current Kaspa network status and summarize https://kaspa.org"

The first call returns how-to-pay instructions; fund the deposit address it gives you and retry.

Notes & honest caveats

  • Prototype. The payment rail is custodial-prepaid today (a trustless covenant-based settlement layer — the k402 protocol on Kaspa L1 — is in the works). Keep balances small: a few KAS covers thousands of calls.
  • Paid tools return payment_required + instructions instead of failing opaquely.
  • The gateway rate-limits per IP; prices float with KAS/USD, so catalog shows current numbers.
  • Need KAS? Any exchange or wallet works — deposits are plain mainnet transfers.

mcp-name: io.github.Kali123411/k402

MIT © Kaspa Lab

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k402_mcp-0.4.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k402_mcp-0.4.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file k402_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: k402_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for k402_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 84cc875171ed421646db0861bd0867ac820f0ebf0f38e024baf49492c4f5e811
MD5 f9ce106900a1581c74e194f7f6557e72
BLAKE2b-256 b2e7ce213f36e7c0e7c0d36a5f09661e96ebd550a1957e3778931c489a661056

See more details on using hashes here.

File details

Details for the file k402_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: k402_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for k402_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b07bc93089a71c50d19fbdf197679e3ad7402ec835d8a705b0fb42597c3d4f78
MD5 65fba6db5cbbda4b74a18d858279a7a2
BLAKE2b-256 f1420aa86beea095d6c3b47a296051a4787b92386733bedd13c0d7e53e6aea1a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page