mcpField
M
mcp-rinne

mcp-rinne

Local
github.com/codesparFinance275Updated 4w ago

About mcp-rinne

mcp-rinne is an MCP server for the Rinne Brazilian payment API, covering card acquiring, PIX, banking and pricing. It targets organizations that manage multiple merchants under a B2B2B model and can run against sandbox or production.

Key features

  1. 0162 tools covering merchants, transactions, banking and pricing
  2. 02Cards on file, 3D Secure and PIX transaction support
  3. 03Ledger, cashout and balance statement queries
  4. 04Organization and merchant scope selection per call
  5. 05Separate JWT-based access management from API keys

Use cases

  1. 01Onboarding merchants and managing acquiring accounts through an AI agent
  2. 02Creating card or PIX transactions and processing refunds
  3. 03Checking balances, statements and cashout records

MCP support

The server exposes Rinne REST API operations as MCP tools, including merchant, transaction, banking and access management calls.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-rinne": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-rinne"
],
"env": {
"RINNE_API_KEY": "<RINNE_API_KEY>",
"RINNE_SANDBOX": "<RINNE_SANDBOX>",
"RINNE_EMAIL": "<RINNE_EMAIL>",
"RINNE_PASSWORD": "<RINNE_PASSWORD>",
"RINNE_COMPANY_ID": "<RINNE_COMPANY_ID>"
}
}
}
}
Run commandnpx -y @codespar/mcp-rinne
Environment variables to set
RINNE_API_KEYSecretAPI key sent as x-api-key header on every request. Organization-level keys see all merchants; merchant-level keys are scoped to one merchant.
RINNE_SANDBOXDefaults to sandbox (https://api-sandbox.rinne.com.br/core). Set to "false" for production (https://api.rinne.com.br/core).
RINNE_EMAILLogin identifier for the access-management tools (API Keys, Roles, Permissions, org Users, Zipcode lookup), which reject x-api-key by design and require a JWT session.
RINNE_PASSWORDSecretLogin password paired with RINNE_EMAIL.
RINNE_COMPANY_IDCompany to select after JWT login, for accounts with access to multiple companies.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-rinne0.1.0

Tools

62

Saved tool list · updated 2w ago

This tool takes no parameters.

Details

From the project README

@codespar/mcp-rinne

MCP server for Rinne — Brazilian card acquiring, PIX, banking, and payment infrastructure, covering the full API surface

npm License: MIT

What is Rinne?

Rinne is a Brazilian payment infrastructure API. It runs a B2B2B model: your Organization manages any number of Merchants, each merchant onboards via KYC and connects to a payment provider (Rinne itself, Cappta, Celcoin, ...) through an Affiliation, and everything downstream flows through that affiliation — card and PIX transactions, cards-on-file, 3D Secure, cashouts/payouts, ledger, and pricing.

This MCP server wraps the entire Rinne REST API — not just card acquiring — so AI agents can manage merchants, run transactions, move money, and administer access in sandbox or production.

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "rinne": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-rinne"],
      "env": {
        "RINNE_API_KEY": "your-api-key",
        "RINNE_SANDBOX": "true"
      }
    }
  }
}
Claude Code
claude mcp add rinne -- npx @codespar/mcp-rinne
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "rinne": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-rinne"],
      "env": {
        "RINNE_API_KEY": "your-api-key",
        "RINNE_SANDBOX": "true"
      }
    }
  }
}

Tools (62)

Company
ToolPurpose
get_companyGet the authenticated company (org or merchant, depending on key scope)
update_companyUpdate the authenticated company
Merchants
ToolPurpose
create_merchantCreate a merchant under your organization (KYC)
list_merchantsList merchants
get_merchantGet merchant details by ID
update_merchantUpdate a merchant
Affiliations
ToolPurpose
create_affiliationCreate a merchant account with a payment provider (Rinne, Cappta, Celcoin, ...)
register_affiliationRegister a gateway-mode affiliation using existing provider credentials
list_affiliationsList affiliations, org-wide or for one merchant
get_affiliationGet a specific affiliation
Cards on file
ToolPurpose
store_cardSave a card for reuse in future transactions
list_cardsList stored cards
get_cardGet a stored card by ID
delete_cardDelete a stored card
3D Secure
ToolPurpose
create_3ds_sessionCreate a 3DS authentication session ahead of a transaction
Transactions
ToolPurpose
create_transactionCreate a card (raw, stored, or Apple Pay/Google Pay) or PIX transaction
authenticate_transactionComplete 3DS for a transaction awaiting authentication
get_transactionGet transaction details and status, including refunds
list_transactionsList transactions, org-wide or for one merchant
cancel_transactionCancel a pending transaction (e.g. unpaid bolepix)
refund_transactionRefund a transaction, fully or partially
cancel_refundCancel a refund that hasn't settled yet
get_transaction_receiptGet a transaction's receipt (base64 PDF)
simulate_pay_transactionSandbox only — mark a transaction as paid
PIX (collection keys)
ToolPurpose
create_pix_collection_keyCreate a PIX key the merchant uses to receive payments
list_pix_collection_keysList the merchant's PIX collection keys
Ledger
ToolPurpose
list_ledger_entriesList ledger entries for the authenticated company
get_ledger_entryGet a single ledger entry
Banking
ToolPurpose
create_bank_accountRegister an external bank account (payout destination)
update_bank_accountSet a bank account as primary
register_cashout_pix_keyRegister an external PIX key as a payout destination
get_balanceGet the current balance
topup_balanceSandbox only — simulate funding the balance
get_statementGet a merchant's balance statement for a date range
create_internal_transferTransfer funds between your org's own bank accounts
list_judicial_blockagesList court-ordered account freezes affecting balances
Cashouts
ToolPurpose
create_cashoutCreate a payout to a bank account or PIX key
list_cashoutsList cashouts
get_cashoutGet a single cashout
get_cashout_receiptGet a cashout's receipt
Pricing
ToolPurpose
list_fee_policiesList fee policies (what you charge merchants)
create_fee_policyCreate a fee policy
replace_fee_policyReplace a fee policy in full
update_fee_policyPartially update a fee policy
list_cost_policiesList cost policies (what providers charge you)
list_mccsList Merchant Category Codes
Webhooks
ToolPurpose
get_webhook_dashboard_urlGet the URL to configure webhook endpoints/events
System
ToolPurpose
get_healthCheck API health status
Access management — JWT required
ToolPurpose
create_api_keyCreate an API key (shown once)
list_api_keysList API keys (prefix + last 4 only)
revoke_api_keyRevoke an API key
create_roleCreate a custom role
list_rolesList roles
list_permissionsList all available permissions
get_current_sessionWhoami for the JWT session
Users
ToolPurpose
create_userCreate a user (merchant scope: x-api-key; org scope: JWT)
list_usersList users
update_userUpdate a user's name/roles — JWT, org only
suspend_userSuspend a user — JWT, org only
activate_userReactivate a user — JWT, org only
Zipcode — JWT required
ToolPurpose
lookup_zipcodeLook up a Brazilian address by CEP
Sandbox
ToolPurpose
get_sandbox_guideReturn test cards, the amount-based decline rule, and which tools need JWT

Card data is never sent in the clear

Rinne does not accept a raw card number or CVV over this API. Every number/cvv field (and, for Apple Pay/Google Pay, network_token/cryptogram) must already be an encrypted token ("ev:...") produced by the rinne-js Card/Wallet Element running in a browser — a raw PAN/CVV is rejected with 400 VALIDATION_ERROR, and there is no server-side encryption path.

In practice, this server is the second half of a checkout: run a rinne-js flow (see rinne-js docs) to collect and encrypt the card client-side, then hand the resulting token to store_card or create_transaction here to finish the operation. Alternatively, use card_id on create_transaction to charge a card already saved via store_card.

Organization vs. merchant scope

Every resource that operates on transactions, cards, 3DS sessions, affiliations, or banking accepts an optional merchant_id:

  • Omitted — acts at the organization/self level.
  • Provided — acts on that specific merchant (/v1/merchants/{merchant_id}/...), for an organization managing multiple merchants.

refund_transaction, get_statement, and create_pix_collection_key/list_pix_collection_keys always require merchant_id — they only exist at the merchant level.

Two PIX key resources — don't confuse them

Rinne has two distinct PIX-key resources with similarly-named endpoints:

  • create_pix_collection_key (/v1/merchants/{id}/pix/keys) — a key the merchant uses to receive PIX payments, tied to a provider affiliation (provider, key_type).
  • register_cashout_pix_key (/v1/merchants/{id}/pix-keys or /v1/companies/me/pix-keys) — an external key registered as a payout destination for cashouts (key, primary).

Authentication

Most of the API uses x-api-key, but Rinne's access-management surface deliberately rejects it — a leaked API key must not be able to create other keys, roles, or users. Those tools need a JWT session instead:

AuthUsed by
x-api-key (RINNE_API_KEY)Everything else — merchants, affiliations, cards, 3DS, transactions, PIX, banking, cashouts, pricing, webhooks, merchant-scoped users
JWT (RINNE_EMAIL + RINNE_PASSWORD)create_api_key, list_api_keys, revoke_api_key, create_role, list_roles, list_permissions, get_current_session, lookup_zipcode, and org-scoped create_user/list_users/update_user/suspend_user/activate_user

This server logs in lazily on the first JWT-gated tool call and caches the token, re-logging-in once on a 401. If RINNE_COMPANY_ID is set, it selects that company right after login (for accounts with access to multiple companies). If RINNE_EMAIL/RINNE_PASSWORD aren't set, JWT-gated tools return a clear error instead of failing silently — the rest of the server works fine without them.

Sandbox / Testing

Defaults to sandbox (https://api-sandbox.rinne.com.br/core). Set RINNE_SANDBOX=false for production (https://api.rinne.com.br/core).

Sandbox simulation rules

Call get_sandbox_guide for the full JSON, or see below:

Test cards
Card numberBrand3DS
5155901222280001MastercardNo
4012001037141112VisaNo
4242424242424242VisaChallenge
Outcome by amount

The last two digits of the amount (in cents) determine the result — not the card number:

Last 2 digitsResult
00Approved
51Refused — insufficient funds
05Refused — do not honor
54Refused — expired card

Example: amount: 1051 → REFUSED with code 51.

PIX

Use simulate_pay_transaction (sandbox only) to mark a WAITING_PAYMENT PIX transaction as paid.

Reference: Rinne testing guide

Environment Variables

VariableRequiredDescription
RINNE_API_KEYYesAPI key, sent as x-api-key
RINNE_SANDBOXNoDefaults to sandbox; set to "false" for production
RINNE_EMAILNoLogin identifier for JWT-gated tools
RINNE_PASSWORDNoLogin password, paired with RINNE_EMAIL
RINNE_COMPANY_IDNoCompany to select after login, for multi-company accounts

Links

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.