Nupay

Finance and commerce

MCP server for NuPay, Nubank merchant checkout: Pix + wallet one-click for 100M+ BR users.

Your AI app calls the Nupay MCP server, which does the finance and commerce work and sends the result back to the chat.

About Nupay

Nupay is a community MCP server from codespar, filed in our directory under finance and commerce. MCP server for NuPay, Nubank merchant checkout: Pix + wallet one-click for 100M+ BR users.

Nupay runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-nupay@0.2.2 and talks to it over standard input and output. It needs NUPAY_MERCHANT_KEY and NUPAY_MERCHANT_TOKEN set before Nupay starts.

Nupay is listed in the official MCP registry as io.github.codespar/mcp-nupay, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-nupay
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-nupay

How to set up Nupay

  1. Install Node.js on the machine that runs your AI app, because Nupay starts with npx and downloads its package on first run.
  2. Create NUPAY_MERCHANT_KEY and NUPAY_MERCHANT_TOKEN for Nupay in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Nupay to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Nupay tools to confirm the connection.
  5. Run one read-only task with Nupay first, and keep your app asking before each tool call until the results look right.

Nupay compared with similar servers

  • Nuvem Fiscal by codespar has fewer GitHub stars than Nupay (278 against 278); both are community servers, and both run locally.
  • Nubank by codespar has fewer GitHub stars than Nupay (278 against 278); both are community servers, and both run locally.
  • Omie by codespar has fewer GitHub stars than Nupay (278 against 278); both are community servers, and both run locally.

Before you connect Nupay

  • Give Nupay its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Nupay tool call until you trust what it does with them.
  • Treat text that Nupay fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Nupay on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Nupay

How marketing and sales teams put Nupay to work, by company size. Pick the size closest to yours and start Nupay on one use case.

Small business

  • A small business can ask Nupay which products and customers drive margin, then plan promotions around them.
  • Owners can use Nupay to check refunds, failed payments and churn reasons without opening three dashboards.
  • Nupay runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Nupay to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Nupay to check spend against budget each week and move money to what's working.
  • Start Nupay on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Nupay read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Nupay to answer revenue questions by channel and region with figures finance signs off on.
  • Nupay is a community server, so have security review the code and pin a version before Nupay touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Nupay README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@codespar/mcp-nupay

MCP server for NuPay, Nubank's merchant checkout rail.

NuPay is Nubank's answer to PayPal / Shop Pay for Brazil: a wallet-backed checkout that leverages Nubank's 100M+ BR customer distribution. Agents create a payment, the shopper confirms inside the Nubank app (push + biometric) or via Pix, and funds settle to the merchant. Pre-authorized flows (CIBA / OTP) unlock recurrence and true one-click for repeat buyers.

Tools (22)

Tool Purpose
create_payment Create a NuPay checkout payment.
get_payment Retrieve full payment details (amount, shopper, items, current status, timestamps) by pspReferenceId.
get_payment_status Retrieve a payment's status by pspReferenceId.
list_payments_by_date List payments created within a date range.
cancel_payment Cancel a payment that has not yet been captured/settled.
create_refund Refund a settled payment (full or partial).
get_refund Retrieve refund status by pspReferenceId + refundId.
list_refunds List all refunds issued against a given payment.
create_recipient Register a final beneficiary (required for regulatory split payments).
get_recipient Retrieve a registered recipient by referenceId.
update_recipient Update a registered final beneficiary (name, document, country, type).
delete_recipient Remove a registered recipient.
list_recipients List registered recipients (final beneficiaries) for the merchant.
list_settlements List settlement reports (payouts to the merchant bank account) within a date range.
get_settlement Retrieve a single settlement (payout batch) including the list of underlying transactions.
query_payment_conditions Query available installment/payment conditions for a given amount and (optionally) shopper CPF.
create_preauth_payment Create a NuPay payment using a pre-authorized Bearer access_token (pre-auth / recurrence flow).
backchannel_start Start a CIBA / OTP pre-authorization for a shopper.
backchannel_complete Complete a CIBA/OTP flow by submitting the OTP the shopper received.
backchannel_resend_otp Resend the OTP to the shopper for an in-flight authorization ticket.
exchange_token Exchange an authorization_code or refresh_token at POST /v1/token.
revoke_token Revoke an issued access_token or refresh_token at POST /v1/token/revoke.

Install

npm install @codespar/mcp-nupay

Environment

NUPAY_MERCHANT_KEY="..."     # X-Merchant-Key issued to your merchant
NUPAY_MERCHANT_TOKEN="..."   # X-Merchant-Token (secret)
NUPAY_CLIENT_ID="..."        # Optional, OAuth client_id for pre-auth / recurrence
NUPAY_CLIENT_SECRET="..."    # Optional, OAuth client_secret
NUPAY_ENV="sandbox"          # sandbox (default) | production

Authentication

Two flows:

  1. Standard merchant API (payments, refunds, recipients, payment-conditions) uses X-Merchant-Key + X-Merchant-Token headers. No token exchange.
  2. Pre-authorized / recurrence uses OAuth2 + CIBA / OTP. Start with backchannel_start, validate via backchannel_complete, then call create_preauth_payment with the returned Bearer access_token. Refresh with exchange_token (grant_type=refresh_token). Access tokens expire in 5 minutes; refresh tokens should be stored long-term for recurrence.

Base URLs are derived from NUPAY_ENV:

Sandbox Production
API https://sandbox-api.spinpay.com.br https://api.spinpay.com.br
Auth https://sandbox-authentication.spinpay.com.br/api https://authentication.spinpay.com.br/api

JWT client_assertion signing is the caller's responsibility, exchange_token expects an already-signed assertion with client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer.

Run

# stdio (default)
npx @codespar/mcp-nupay

# HTTP
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-nupay

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Questions about Nupay

What is the Nupay MCP server?

MCP server for NuPay, Nubank merchant checkout: Pix + wallet one-click for 100M+ BR users. Nupay is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Nupay MCP server?

Add Nupay to your AI app's MCP config with the command npx -y @codespar/mcp-nupay@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-nupay -- npx -y @codespar/mcp-nupay@0.2.2. To run Nupay this way you need Node.js installed.

Does Nupay need an API key?

Yes. Nupay expects NUPAY_MERCHANT_KEY and NUPAY_MERCHANT_TOKEN to be set. Create the key for Nupay in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Nupay an official MCP server?

No. Nupay is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Nupay access to company data.

What license is Nupay under?

Nupay is released under the MIT license, according to its GitHub repository. The license covers the code of Nupay; the service it connects to has its own terms.