mcp-niubiz — Niubiz MCP server for Claude Code: setup and tools
An MCP server for Peru's Niubiz acquirer. It opens a checkout session, authorizes the payment and reverses it the same day.
claude mcp add --env NIUBIZ_USER=<NIUBIZ_USER> --env NIUBIZ_PASSWORD=<NIUBIZ_PASSWORD> --env NIUBIZ_MERCHANT_ID=<NIUBIZ_MERCHANT_ID> --env NIUBIZ_ENV=<NIUBIZ_ENV> --transport stdio niubiz -- npx -y @codespar/mcp-niubizWhat mcp-niubiz does
Four tools map onto Niubiz's standard ecommerce path. get_security_token fetches the bearer token and caches it for 20 minutes, so the other tools do not need it passed in. create_session_token builds the checkout with the amount and antifraud fields, authorize_transaction finishes the purchase, reverse_transaction voids it before the day ends.
Card numbers stay away from the server. The shopper enters them in Niubiz's own form, which hands back a transactionToken; authorization runs on that token. Your agent only ever handles the token.
Three credentials are mandatory: NIUBIZ_USER, NIUBIZ_PASSWORD and NIUBIZ_MERCHANT_ID. Without the merchant code the endpoints have nothing to target. NIUBIZ_ENV takes sandbox or production and starts on sandbox.
What it helps with
- open a Niubiz checkout with an amount and antifraud data
- authorize a purchase using the checkout's
transactionToken - void an authorization on the same day
- test the payment path on sandbox first
- get a Niubiz security token without handling it by hand
Example prompts for the agent
- Create a Niubiz session for 120.50 and show me the
transactionToken - Authorize the payment with that
transactionToken - Reverse the authorization we made today
How to install mcp-niubiz
Platform CLI
claude mcp add --env NIUBIZ_USER=<NIUBIZ_USER> --env NIUBIZ_PASSWORD=<NIUBIZ_PASSWORD> --env NIUBIZ_MERCHANT_ID=<NIUBIZ_MERCHANT_ID> --env NIUBIZ_ENV=<NIUBIZ_ENV> --transport stdio niubiz -- npx -y @codespar/mcp-niubizReplace <…> with your own values
Platform CLI
codex mcp add niubiz --env NIUBIZ_USER=<NIUBIZ_USER> --env NIUBIZ_PASSWORD=<NIUBIZ_PASSWORD> --env NIUBIZ_MERCHANT_ID=<NIUBIZ_MERCHANT_ID> --env NIUBIZ_ENV=<NIUBIZ_ENV> -- npx -y @codespar/mcp-niubizReplace <…> with your own values
Config file
{
"mcpServers": {
"niubiz": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-niubiz"
],
"env": {
"NIUBIZ_USER": "<NIUBIZ_USER>",
"NIUBIZ_PASSWORD": "<NIUBIZ_PASSWORD>",
"NIUBIZ_MERCHANT_ID": "<NIUBIZ_MERCHANT_ID>",
"NIUBIZ_ENV": "<NIUBIZ_ENV>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"niubiz": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@codespar/mcp-niubiz"
],
"env": {
"NIUBIZ_USER": "<NIUBIZ_USER>",
"NIUBIZ_PASSWORD": "<NIUBIZ_PASSWORD>",
"NIUBIZ_MERCHANT_ID": "<NIUBIZ_MERCHANT_ID>",
"NIUBIZ_ENV": "<NIUBIZ_ENV>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e NIUBIZ_USER=<NIUBIZ_USER> -e NIUBIZ_PASSWORD=<NIUBIZ_PASSWORD> -e NIUBIZ_MERCHANT_ID=<NIUBIZ_MERCHANT_ID> -e NIUBIZ_ENV=<NIUBIZ_ENV> niubiz npx -y @codespar/mcp-niubizReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-niubiz
How do I install mcp-niubiz in Claude Code?
Run `claude mcp add mcp-niubiz -e NIUBIZ_USER=<NIUBIZ_USER> -e NIUBIZ_PASSWORD=<NIUBIZ_PASSWORD> -e NIUBIZ_MERCHANT_ID=<NIUBIZ_MERCHANT_ID> -- npx -y @codespar/mcp-niubiz`.
What does mcp-niubiz do?
It exposes Niubiz's security token, checkout session, authorization and same-day reverse as tools an agent can call.
What does mcp-niubiz need to run?
An API user, its password and your merchant id. NIUBIZ_ENV picks between sandbox and production and defaults to sandbox.