x402 Doctor

com.twelvepermissionsPublished by twelvepermissions.comv1.0.0Updated Oct 24, 2026

Diagnose x402 seller endpoints: what is wrong with your 402 challenge, and how to fix it.

The publisher's own server: Twelve Permissions

VerifiedStreamable HTTPWeb executableDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

A free remote diagnostic that probes an x402 seller endpoint and reports what is wrong with its 402 payment challenge and how to fix it.

What you can do
Probe a paid x402 endpoint by performing the handshake a paying client would and checking the 402 challenge against 16 rules, with a status such as healthy, advisories, defects_found, not_x402 or unreachable and per-finding evidence and provenance (spec or observed facilitator rejection). Explain a single rule by id: what it checks, why it matters, how to fix it, and where it came from. List the whole rule table, including what was not checked, so a clean result can be read correctly.
When to use it
Use it when you run a paid x402 seller endpoint and payments do not settle or the challenge looks wrong, and you want a seller-side diagnosis without routing traffic through a facilitator. Also useful for reviewing the rule set before publishing an endpoint.
Requirements
A remote Streamable HTTP endpoint at the hosted service; no account, API key or header is declared. The service must be able to reach the target URL over the network. Rate limited to 20 requests per hour per IP and 300 per hour overall.
Before you install
The service fetches whatever URL it is given, so only probe endpoints you are authorized to test; redirects are followed to a depth of 3 with an SSRF guard re-run on each hop. It never sends a payment and never asks for a key, seed or wallet. It does not validate through a facilitator, so findings are derived only from the returned challenge. A per-IP request counter is stored for up to two hours; probe targets are not logged.

Installation

In SourceWeft

  1. Open x402 Doctor in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/com.twelvepermissions%2Fx402-doctor/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "x402-doctor": {
      "type": "http",
      "url": "https://x402-doctor.tsharpe.workers.dev/mcp"
    }
  }
}

README

x402 Doctor

A free diagnostic for x402 seller endpoints. Point it at your paid endpoint and it performs the handshake a paying client would — a GET with no X-PAYMENT header — then reports what is wrong with the 402 challenge you answered with, and what to change.

Live: https://x402-doctor.tsharpe.workers.dev

bash
curl -s -X POST https://x402-doctor.tsharpe.workers.dev/probe \  -H 'Content-Type: application/json' \  -d '{"url":"https://your-service.example/paid-endpoint"}'

Why seller-side

Buyer-side x402 is well served by the official SDKs. Seller-side is where people get stuck, because the failure happens inside a facilitator you cannot see into: your endpoint looks fine, the payment does not settle, and the error surfaces somewhere you do not control.

Every check carries a provenance field, so no finding has to be taken on trust:

  • spec — the x402 specification requires it.
  • observed (source) — we watched a real facilitator reject it, and the source is named.

What you get back

json
{  "target": "https://your-service.example/paid-endpoint",  "finalUrl": "https://your-service.example/paid-endpoint",  "status": "advisories",  "http": { "status": 402, "contentType": "application/json" },  "findings": [    {      "id": "challenge-cacheable",      "severity": "warn",      "title": "402 challenge is cacheable",      "why": "…",      "fix": "…",      "provenance": "observed (ours, 2026-08-15)",      "evidence": "cache-control: public, max-age=300"    }  ],  "checksRun": 16,  "bodyTruncated": false,  "bodyChecksSkipped": 0,  "bodySkipReason": null}

status is one of:

statusmeaning
healthynothing to report
advisoriesnotes worth reading, but no errors
defects_foundat least one error
not_x402the endpoint did not answer with an x402 challenge
unreachablethe probe could not complete — see reason

If the body was truncated or unparseable, body checks are skipped and the report says so (bodyChecksSkipped, bodySkipReason). A check that did not run is never reported as a check that passed.

The 16 checks

idseveritycheckprovenance
no-402errorEndpoint did not answer 402 without paymentspec
body-not-jsonerror402 body is not parseable JSONspec
oversized-bodywarn402 body exceeded the read capobserved (this probe)
missing-x402-versionerrorx402Version is absent or not 1spec
accepts-emptyerroraccepts is missing, not an array, or emptyspec
output-schema-nullerroroutputSchema is explicitly nullobserved (Coinbase CDP facilitator, 2026-07-17)
amount-not-atomic-stringerrormaxAmountRequired is not an atomic-unit stringspec
asset-network-mismatchwarnasset is not the USDC contract for this networkspec
missing-eip712-extraerrorscheme "exact" without the EIP-712 domain in extraspec
unknown-network-nameinfonetwork name is not one this probe recognisesspec
payto-not-an-addresserrorpayTo is not a valid address for this networkspec
payto-not-checksummedinfopayTo is not a checksummed addressspec
no-timeout-declaredinfomaxTimeoutSeconds is absentspec
challenge-cacheablewarn402 challenge is cacheableobserved (ours, 2026-08-15)
cors-headers-not-exposedinfobrowser clients will need payment headers exposed on the settlement responseobserved (x402-foundation/x402#2112)
bazaar-ext-inside-acceptswarnBazaar extension declared inside an accepts entryobserved (ours, 2026-08-14)

Also an MCP server

POST /mcp, stateless Streamable HTTP. Three tools:

toolwhat it does
probe_x402_endpointrun the diagnostic against a URL
explain_defectfull explanation of one check by id
list_checksthe whole rule table with provenance

What it deliberately does not do

  • It never validates through a facilitator. Doing so would route your traffic through someone else's facilitator credentials. Every check here is derived from the challenge you actually returned.
  • It never sends a payment, and never asks for a key, a seed, or a wallet.
  • It does not judge networks it does not know. An unrecognised network name is an info note about the limits of this probe's list — not a claim that your network is wrong. Address-format rules apply only where the address format is known.

Limits worth knowing

  • The body is read to a cap; past that, body checks are skipped and the report says so rather than guessing.
  • Redirects are followed to a depth of 3, with the SSRF guard re-run on every hop.
  • Rate limited to 20 requests/hour per IP and 300/hour overall, because the service fetches whatever URL it is given.
  • The only thing stored is a per-IP request counter for that rate limit, which expires within two hours. No analytics, and probe targets are never logged.

Security posture, and the residual risks that were accepted rather than fixed, are documented in SECURITY.md.

Reading and running the source

bash
cd doctornpm test          # 163 tests, no dependencies of any kind

Zero dependencies, runtime or dev — the suite is node --test. The rules are pure functions with no I/O; all network access lives in src/probe.js, which is also where the SSRF guard lives.

The hosted service above is free to use and needs no licence. The source is published for inspection and verification under the same terms as the rest of this repository: no licence granted at this time, all rights reserved. If you want to reuse or self-host it, ask.


Built by Twelve Permissions. Free, and unrelated to anything sold there.

Source: doctor/README.md at commit 20ce551

Tools

3

probe_x402_endpoint

Probe an x402 seller endpoint and report what it observes about it. Performs the handshake a paying client would: GET with no X-PAYMENT header, then checks the 402 challenge against 16 rules. Every finding says whether the rule comes from the x402 spec or from an observed facilitator rejection. Reports status "healthy" (nothing to report), "advisories" (only warn/info findings — the endpoint works), "defects_found" (at least one error-severity finding), "not_x402" or "unreachable".

Parametersurlrequired

explain_defect

Full explanation of one rule by id — what it checks, why it matters, how to fix it, and where the rule came from. Use when you want the reasoning without re-probing.

Parametersidrequired

list_checks

The whole rule table. Knowing what was NOT checked is part of knowing what a clean result means.

Takes no parameters.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.

Other Twelvepermissions integrations