Feature request: recognise pay-per-call x402 results from MCP tools (pending payment response)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- TypeScript
- Estrelas
- 29.8k
- Forks
- 3.9k
- Merge médio
- 1h 44min
- PRs com merge (30d)
- 841
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de simstudioai/sim
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
simstudioai/sim#9831 ·
Mantenedores costumam responder em até 1 dia
-
v2 API rate limits self-hosted installs by IP even with billing disabledTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
simstudioai/sim#8452 ·
Mantenedores costumam responder em até 1 dia
-
Railway template generates invalid ENCRYPTION_KEY (should be 64-char hex string)Talvez livre de novo @sahooarnav2007-gif assumiu há 15 dias e não há nenhum pull request aberto. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
simstudioai/sim#6246 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
simstudioai/sim#1204 · 8 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
simstudioai/sim#9734 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de simstudioai/sim
Issues semelhantes
-
Bug: Cloudflare Pages static _redirects identity rule causes RSC Flight to reload as HTMLTalvez já em andamento @Donvero assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantitup-Org/vista#210 ·
-
status: waiting for maintainer
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
mui/material-ui#49751 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
diplodoc-platform/transform#1184 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
JonasKruckenberg/imagetools#973 ·
Mantenedores costumam responder em até 1 dia