Skip to main content
NU

NuPay

v0.2.1API Key

Trilha de checkout para merchants do Nubank — one-click com saldo da carteira, Pix e recorrência, apoiado na distribuição de mais de 100M de clientes BR do Nubank. OpenAPI completo verificado; a plataforma base é o Spinpay.

22 ferramentas5 env vars🇧🇷 Brasilestável no npm

O que seu agente faz

O NuPay dá ao seu agente 22 tools que ele chama direto — escolha as que precisar, no Claude, Cursor ou qualquer cliente MCP.

  • create_paymentCreate a NuPay checkout payment. Returns pspReferenceId + the redirect/QR payload the shopper needs to complete the charge (NuPay wallet push or Pix). Use merchant-key auth.
  • get_paymentRetrieve full payment details (amount, shopper, items, current status, timestamps) by pspReferenceId. Use this for richer detail than get_payment_status.
  • get_payment_statusRetrieve a payment's status by pspReferenceId.
Exemplo de chamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_payment", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-nupay

Quickstart

Adicione esta entrada ao seu claude_desktop_config.json (ou a config de qualquer cliente compatível com MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "nupay": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-nupay"
      ],
      "env": {
        "NUPAY_MERCHANT_KEY": "<your_nupay_merchant_key>",
        "NUPAY_MERCHANT_TOKEN": "<your_nupay_merchant_token>"
      }
    }
  }
}

Depois de reiniciar, seu agente pode chamar qualquer uma das 22 ferramentas abaixo — teste create_payment primeiro.

Variáveis de ambiente · 5

Necessárias pra autenticar o server. Armazenadas criptografadas ao usar a hospedagem gerenciada da CodeSpar.

NUPAY_MERCHANT_KEY
obrigatório

NuPay X-Merchant-Key issued to your merchant

NUPAY_MERCHANT_TOKEN
obrigatóriosecret

NuPay X-Merchant-Token issued to your merchant

NUPAY_CLIENT_ID
opcional

OAuth2/CIBA client_id for pre-authorized (recurrence) flows. Optional unless using backchannel_start / backchannel_complete.

NUPAY_CLIENT_SECRET
opcionalsecret

OAuth2/CIBA client_secret for pre-authorized flows. Optional unless using backchannel_* tools.

NUPAY_ENV
opcional

sandbox | production. Defaults to sandbox. Drives both checkout API and auth base URLs.

Ferramentas disponíveis · 22

Cada ferramenta é independente — seu agente carrega só o que precisa pra reduzir contexto e tempo de resposta.

WRITEcreate_payment
Create a NuPay checkout payment. Returns pspReferenceId + the redirect/QR payload the shopper needs to complete the charge (NuPay wallet push or Pix). Use merchant-key auth.
WRITEget_payment
Retrieve full payment details (amount, shopper, items, current status, timestamps) by pspReferenceId. Use this for richer detail than get_payment_status.
WRITEget_payment_status
Retrieve a payment's status by pspReferenceId.
WRITElist_payments_by_date
List payments created within a date range. Supports cursor pagination via limit + offset. Useful for reconciliation and reporting.
DELETEcancel_payment
Cancel a payment that has not yet been captured/settled.
DELETEcreate_refund
Refund a settled payment (full or partial). Idempotent via transactionRefundId.
DELETEget_refund
Retrieve refund status by pspReferenceId + refundId.
READlist_refunds
List all refunds issued against a given payment.

Frameworks compatíveis

MCP é um protocolo — qualquer framework que o fale pode montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Qualquer cliente MCPProtocolo

Perguntas frequentes

Rode `npx -y @codespar/mcp-nupay` e adicione o bloco de config acima ao seu cliente MCP — Claude, Cursor, VS Code ou qualquer cliente compatível com MCP. Sem build, sem SDK. Prefere hospedado? O tier gerenciado da CodeSpar roda pra você, com a auth resolvida.
NuPay — MCP server · 22 tools | CodeSpar