Skip to main content
NI

Niubiz

v0.1.0OAuth2

Peru's dominant card acquirer (ex-VisaNet, 300k+ merchants). Inbound card charges through the security-token flow.

4 tools4 env vars๐Ÿ‡ต๐Ÿ‡ช Perustable on npm

What your agent can do

Niubiz gives your agent 4 tools it calls directly โ€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • get_security_token โ€” Fetch the Niubiz API bearer token (POST /api.security/v1/security, Basic auth). Other tools fetch and cache this automatically โ€” call it explicitly only to verify credentials or force a refresh.
  • create_session_token โ€” Create a checkout session (POST /api.ecommerce/v2/ecommerce/token/session/{merchantId}). Returns the sessionKey the Niubiz checkout form needs. Send the purchase amount and the customer's IP for antifraud scoring.
  • authorize_transaction โ€” Authorize a purchase (POST /api.authorization/v3/authorization/ecommerce/{merchantId}). Pass the transactionToken the Niubiz checkout form returned after the customer entered the card, plus your purchaseNumber and the amount.
Example call
// 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("get_security_token", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-niubiz

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "niubiz": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-niubiz"
      ],
      "env": {
        "NIUBIZ_USER": "<your_niubiz_user>",
        "NIUBIZ_PASSWORD": "<your_niubiz_password>",
        "NIUBIZ_MERCHANT_ID": "<your_niubiz_merchant_id>"
      }
    }
  }
}

After restart, your agent can call any of the 4 tools below โ€” try get_security_token first.

Environment variables ยท 4

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

NIUBIZ_USER
requiredsecret

Niubiz API user

NIUBIZ_PASSWORD
requiredsecret

Niubiz API password

NIUBIZ_MERCHANT_ID
required

Merchant id (cรณdigo de comercio)

NIUBIZ_ENV
optional

Environment: 'sandbox' or 'production'. Defaults to 'sandbox'.

Available tools ยท 4

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

READget_security_token
Fetch the Niubiz API bearer token (POST /api.security/v1/security, Basic auth). Other tools fetch and cache this automatically โ€” call it explicitly only to verify credentials or force a refresh.
WRITEcreate_session_token
Create a checkout session (POST /api.ecommerce/v2/ecommerce/token/session/{merchantId}). Returns the sessionKey the Niubiz checkout form needs. Send the purchase amount and the customer's IP for antifraud scoring.
WRITEauthorize_transaction
Authorize a purchase (POST /api.authorization/v3/authorization/ecommerce/{merchantId}). Pass the transactionToken the Niubiz checkout form returned after the customer entered the card, plus your purchaseNumber and the amount.
DELETEreverse_transaction
Reverse (void) an authorization (POST /api.authorization/v3/reverse/ecommerce/{merchantId}). Same-day undo of an authorized transaction by transactionId or purchaseNumber.

Compatible frameworks

MCP is a protocol โ€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-niubiz` and add the config block above to your MCP client โ€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Niubiz โ€” MCP server ยท 4 tools | CodeSpar