Repository avatar
Other Tools
v0.5.0
active

paycheck-mcp

io.github.cainky/paycheck-mcp

Check an x402 seller before your agent pays, verify the USDC arrived after. Read-only, never pays.

Documentation

paycheck

An MCP server that checks an x402 (HTTP 402) endpoint before your agent pays it. It works with any agent that can run an MCP server: Claude Code, Claude Desktop, Cursor, Codex, Windsurf, Hermes, OpenClaw and others. Read-only: it makes one unpaid request and optional public RPC lookups. It never signs or sends a payment. No API key.

Install

With npm (once published): npx -y paycheck-mcp, or in an MCP client config { "command": "npx", "args": ["-y", "paycheck-mcp"] }.

Needs Node 18 or newer. Clone this repo, then point your agent at dist/server.js. It is one file with no dependencies.

Any MCP client (Cursor, Windsurf, Claude Desktop, Codex and most others take this shape):

{
  "mcpServers": {
    "paycheck": { "command": "node", "args": ["/path/to/paycheck/dist/server.js"] }
  }
}

Claude Code:

claude mcp add paycheck -- node /path/to/paycheck/dist/server.js

This repo is also a Claude Code plugin (.claude-plugin/, .mcp.json, skills/).

Hermes:

hermes plugins install <owner>/paycheck-mcp
hermes plugins enable paycheck

Start a new session after adding it. The skills/check-before-you-pay/SKILL.md file tells the agent when to use each tool; agents that read skills pick it up, and for the rest the tool descriptions say the same thing.

Tools

Finding a seller:

  • find_paid_api(query, max_price_usd?, chain?, limit?) searches the free public nohumans.directory for paid x402 APIs that match a job, then probes the best matches live (no payment) and ranks them: ok before caution, directory paid-delivery evidence first, then price. Candidates marked do_not_pay are dropped. Needs internet access to that directory; its text is cleaned before it reaches the agent.

Before paying:

  • check_x402_endpoint(url, max_price_usd?, expected_pay_to?) returns ok, caution or do_not_pay, with each offer's dollar price and plain-language findings: invalid payTo address, price over your limit, payTo different from the one the seller published, redirect, free endpoint, challenge issued for another host.
  • check_payee(address, network) returns whether the address is valid for its chain and, on Base and Solana, whether it is funded and has ever sent a transaction. On Algorand it checks the account exists, has opted in to USDC (a transfer fails without that) and is not rekeyed or frozen.

After paying:

  • verify_payment(network, tx_hash, pay_to, min_amount_usd?) looks the transaction up on Base/EVM, Solana or Algorand and returns settled, not_found, failed or mismatch (money went to a different address, or less than expected).
  • log_payment(url, amount_usd, network?, tx_hash?, delivered?, note?) appends to a ledger file on your machine (query strings are not stored).
  • spend_report(days?) totals what the agent paid, by seller, and how much went to requests marked not delivered.

Many paid APIs only answer POST. When a plain GET shows no price (404, 405, 403 or an unreadable 402), check_x402_endpoint sends one unpaid POST with an empty {} body and reports it as probed_with_post. A real x402 seller answers that with a 402 before running anything; if it does not, the GET result stands.

Works with the challenges sellers already publish (v2 PAYMENT-REQUIRED header or v1/v2 JSON body) on Base and other EVM chains, Solana and Algorand.

Algorand

Algorand USDC (asset 31566704) is supported end to end using the free public Algorand indexer: payee checks and verify_payment by transaction id. For a deeper pre-payment read of an Algorand address (account age, recent activity, issuer freeze/clawback powers), Nexus sells a pay-per-call endpoint that agents pay in USDC on Algorand, 2 cents a call, with no account or API key: https://nexus.websystems.co/agents.html

What leaves your machine

No account, no key, no telemetry, no analytics. Nothing is shared with Nexus unless you set PAYCHECK_REPORT=1 (below). Requests go only to:

  • the endpoint URL you ask it to check (one unpaid GET, sometimes one unpaid POST with an empty body; redirects are not followed)
  • public chain RPCs and the public Algorand indexer, with the address or transaction hash you ask about (mainnet.base.org, sepolia.base.org, api.mainnet-beta.solana.com, api.devnet.solana.com, mainnet-idx.algonode.cloud, testnet-idx.algonode.cloud)
  • api.nohumans.directory, with your search text, only when you call find_paid_api

The spend ledger stays in a local file.

Optional: share delivery outcomes (off by default)

Set PAYCHECK_REPORT=1 and each log_payment call that has a transaction hash, a pay_to and a delivered value also sends one small report to the Nexus shop (nexus-x402-shop.vercel.app): payee address, seller host, network, transaction hash and delivered yes or no. No amount, no URL path or query, no key, no install id. The shop checks on chain that USDC really went to that payee in that transaction, and counts reporters by the paying wallet it reads there. The result feeds a delivery record per payee that the shop sells as a 2-cent lookup. Leave the variable unset and nothing is ever sent. PAYCHECK_REPORT_URL changes the target. Private, loopback and internal addresses are refused, including names that resolve to them.

Limits

An ok is a heuristic over one unpaid request and public chain facts. It does not prove the seller will deliver, and it does not replace your spending limit or approval prompt.

Hostnames are resolved first and refused if any answer is private. To probe a local test seller, set PAYCHECK_ALLOW_LOCAL=1 in the env of your MCP config before your first session.

The ledger is written to ~/.paycheck/ledger.jsonl, or to the folder named by PAYCHECK_DATA (Hermes and Claude Code plugin data folders are used automatically). Public RPC endpoints rate-limit; if a lookup fails with a 429, try again in a minute.

Other settings: PAYCHECK_MAX_USD (default 1), PAYCHECK_NO_RPC=1 to skip chain lookups.

License

Copyright (C) 2026 Kyle Cain. Licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only); see LICENSE. Built by Nexus (https://nexus.websystems.co).