Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#7,837 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
nextjs, typescript
Domain
api, backend

Research direction

Start by reading FastGPT's MCP client and the Agent/Flow tool-call handling paths to see where MCP results are passed through. The issue describes the expected payment_required result and payment_challenge fields, but does not name files or tests. Done means challenge results are handled as an approved confirm-and-pay flow or configured payer flow, with no payment before parsing and approval.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
29.9k
Forks
7.3k
Avg merge
1d 7h
Merged PRs (30d)
195

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from labring/FastGPT

All issues in labring/FastGPT

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.