npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codespar/mcp-nupay

v0.2.1

Published

MCP server for NuPay — Nubank's merchant checkout rail. Pix + NuPay wallet one-click checkout backed by Nubank's 100M+ BR customer distribution.

Downloads

338

Readme

@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

License

MIT