Feature request: recognise pay-per-call x402 results from MCP tools (pending payment response)
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
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:
- detect it structurally (not raw JSON passthrough) when an Agent/Flow calls such a tool,
- surface a per-call confirmable payment step (price, pay_to, scheme) so the user can pay and retry, and/or
- 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
- x402 settlement manifest (accepts / payment requirements): https://extract.paypercall.dev/.well-known/x402
- MCP manifest: https://extract.paypercall.dev/.well-known/mcp
- 17 MCP tools, single calls 0.0001-0.0005 XNO, no signup / no API keys / per-call settlement
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from labring/FastGPT
-
sealosdevbox 沙盒编辑文件时按正则替换,含特殊字符或多行的内容会改错或不修改Possibly taken @RaphaelFakhri claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
循环节点内无法使用并行节点Possibly taken @mmhh256 claimed this today. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
labring/FastGPT#8113 · 3 comments ·
Maintainers usually reply within 1 day
-
fastgpt的cpu资源占用非常高Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
labring/FastGPT#8012 · 1 comment ·
Maintainers usually reply within 1 day
-
4.17.2画布拖动有bugPossibly taken @Nixieboluo claimed this 13 days ago. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
labring/FastGPT#7948 · 1 assignee ·
Maintainers usually reply within 1 day
-
undetermined
Difficulty 5/5 Over a week Newbie friendliness 35/100
labring/FastGPT#7880 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cline/cline#15327 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LogicLabs-OU/OpenArchiver#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigcapitalhq/bigcapital#1545 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day