MCP payment middleware should inspect, not seize spending authority.

Use MCP for capability discovery and contract inspection. For paid targets, fetch the fresh PAYMENT-REQUIRED challenge. The caller's wallet/policy decides whether to create the matching PAYMENT-SIGNATURE.

Current x402 Gateway: https://mcp-x402.onrender.com/mcp. GitLab is current source authority.

Package status → · GitLab source →

Where payment fits in an MCP call?

MCP describes what a tool does. x402 describes what it costs. Good middleware keeps the two separate so a model can browse tools freely while money only moves under the caller's rules.

  1. The client lists tools and reads their descriptions. This step is always free.
  2. The client calls a paid tool. The server answers with the x402 payment requirements for that call.
  3. The middleware shows the exact price, asset, network and receiver to the caller's policy, not to the model.
  4. Only if the policy approves does the wallet sign a payment for that one challenge, and the call is retried.
  5. The server verifies, settles and returns the result with settlement evidence.

Rules worth enforcing

See the x402 Gateway and how to monetize an MCP server.

Part of the MCP payments cluster

This page’s job: the middleware doctrine — payment middleware should inspect the fresh PAYMENT-REQUIRED challenge and present it to the caller’s wallet and policy; it should never seize the caller’s spending authority.

Free tool

More on ScriptMasterLabs

ScriptMasterLabs, first when you search Google
Add us as a preferred source on Google
FREE APP · SHORTLIST
Daily sealed stock shortlist with reference levels (E/S/T), trend and strength. Free, no signup. Paper research, not advice.
OPEN SHORTLIST →HOW TO USE
▸ Follow SqueezeWire on Facebook ▸ Join the Discord ▸ Visit scriptmasterlabs.com