#7837·FastGPT

Feature request: recognise pay-per-call x402 results from MCP tools (pending payment response)

Author: dhyabi2Created Sep 24, 2026Updated Sep 24, 2026

A pay-per-call x402 MCP server is a normal MCP server that answers a tool call with a pending-payment result instead of data: tools/call returns 200 but the result text is a JSON object with fields status, message, and payment_challenge containing the settlement details (price, pay_to, x402Version, accepts array).

FastGPT's MCP client passes that JSON through as ordinary tool output, so an Agent/Flow using the tool sees a raw payment_challenge blob instead of a confirm-and-pay step -- zero-signup pay-per-call tools are effectively unusable from a workflow even though the server itself is perfectly fine.

Verified in a real MCP session (streamable HTTP) against a live pay-per-call merchant (Vend API Merchant MCP, https://extract.paypercall.dev/.well-known/x402, 17 endpoints): initialize -> 200, tools list correct; tools/call -> payment_required with a full payment_challenge (0.0001 XNO, pay_to, accepts with nano:mainnet/XNO).

What this issue asks (in FastGPT's own terms)

Recognise a payment_required / x402 payment_challenge result from a pay-per-call MCP tool and:

  1. detect it structurally (not raw JSON passthrough) when an Agent/Flow calls such a tool,
  2. surface a per-call confirmable payment step (price, pay_to, scheme) so the user can pay and retry, and/or
  3. support an optional per-application "payer" config so admin-added pay-per-call tools settle automatically.

Security invariant: no money moves unless the challenge parses AND the user (or configured payer) approves.

Working reference

Why it matters: external pay-per-call tools are a growing class of MCP servers. FastGPT already wires bidirectional MCP into Flows and Agent Skills; recognising a pending-payment result is the difference between an agent that works with them and one that dumps JSON on the user.