Feature request: recognise pay-per-call x402 results from MCP tools (pending payment response)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 38/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
Start by reading apps/sim/lib/internal/mcp/execute-tool.ts and tracing the mcp-tool-selector result path to see how result.output reaches the canvas. Identify where a payment_required envelope can be represented without raw passthrough. Done means a parsed challenge exposes price, pay_to, and scheme, requires operator or approved payer approval, and supports payment and retry.
由索引模型根據 Issue 內容生成。
描述
Is your feature request related to a problem? Please describe.
Sim wires external MCP servers into canvas workflows and executes their tools. In execute-tool.ts (apps/sim/lib/internal/mcp/execute-tool.ts), a successful tool call returns { success: true, data: { success: true, output: result.output } } — the MCP server's tool output is passed straight through to the workflow.
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: it returns HTTP 200 with result content of the form {"status":"payment_required", "payment_challenge": {"price_xno": 0.0001, ...}}. When a Sim workflow calls such a tool through mcp-tool-selector, result.output is that JSON blob, and the canvas shows raw JSON instead of a confirm-and-pay step. This has been verified against a live pay-per-call merchant MCP (Vend API Merchant at extract.paypercall.dev/mcp): initialize returns 200 with correct tools, but tools/call returns 200 whose result content is a payment_required envelope.
This is the one missing client-side behaviour for zero-signup pay-per-call tools to be usable from a Sim workflow — they already work at the MCP protocol level.
Describe the solution you'd like
In the MCP tool-call path, detect a payment_required / x402 payment_challenge result structurally (not as raw JSON passthrough) and:
- surface a per-call confirmable payment step — price,
pay_to, scheme — so the operator can pay and retry from the canvas/UI, and/or - support an optional per-credential "payer" config so admin-added pay-per-call tools settle automatically under approval control.
Security invariant: no money moves unless the challenge parses AND the operator (or a configured, approved payer) approves.
Describe alternatives you've considered
- Keep raw JSON passthrough for paid tools. Works, but a workflow that dumps
payment_challengeJSON to the user is not usable for pay-per-call tools. - Build a separate x402 proxy outside Sim. Adds ops overhead and defeats the purpose of a visual MCP workflow.
- Use a custom extraction tool that pre-encodes the payment. Very platform-specific and doesn't leverage the growing x402 catalogue.
Additional context
A working reference:
- Vend API Merchant MCP manifest: https://extract.paypercall.dev/.well-known/mcp
- x402 settlement manifest: https://extract.paypercall.dev/.well-known/x402
- 9 MCP tools (web extract, link check, geoip, web search, youtube transcript, etc.), single calls ~0.0001 XNO, no signup, no API keys, per-call settlement in Nano (XNO) via nano:mainnet.
- A bare probe returns 402 with the full challenge:
curl -i https://extract.paypercall.dev/api/v1/extract?url=https://example.com
This is a first — Sim had zero x402 / pay-per-call coverage before this issue (GitHub search confirmed).
- 主要語言
- TypeScript
- 星號
- 29.8k
- 分支
- 3.9k
- 平均合併
- 1 小時 44 分鐘
- 30 天內合併 PR
- 841
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
simstudioai/sim 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
simstudioai/sim#9831 ·
維護者通常 1 天內回覆
-
v2 API rate limits self-hosted installs by IP even with billing disabled可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 1/5 1 小時以內 新手友好度 75/100
simstudioai/sim#8452 ·
維護者通常 1 天內回覆
-
Railway template generates invalid ENCRYPTION_KEY (should be 64-char hex string)可能重新可做 @sahooarnav2007-gif 於 15 天前認領,目前沒有進行中的 PR。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
simstudioai/sim#6246 · 3 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
simstudioai/sim#1204 · 8 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
simstudioai/sim#9734 ·
維護者通常 1 天內回覆
相似的 Issue
-
Bug: Cloudflare Pages static _redirects identity rule causes RSC Flight to reload as HTML可能已有人在做 @Donvero 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
Mantitup-Org/vista#210 ·
-
status: waiting for maintainer
難度 2/5 1-3 小時 新手友好度 88/100
mui/material-ui#49751 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
diplodoc-platform/transform#1184 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
JonasKruckenberg/imagetools#973 ·
維護者通常 1 天內回覆