mcpField
M
mcp-transbank

mcp-transbank

Local
github.com/codesparFinance275Updated 4w ago

About mcp-transbank

mcp-transbank is an MCP server for Transbank, Chile's dominant card acquirer. It covers Webpay Plus redirect payments, Webpay Mall split payments across merchant codes, and OneClick Mall card enrollment and charges. It suits businesses in Chile that want agents to handle card payments, with integration and production environments selected through environment variables.

Key features

  1. 01Create, commit, query, and refund Webpay Plus transactions
  2. 02Split a Webpay Mall transaction across child seller codes
  3. 03Enroll, delete, and charge OneClick Mall cards by merchant code
  4. 04Deferred capture and transaction status lookups
  5. 05Switch between integration and production via environment variables

Use cases

  1. 01Create Webpay Plus payments for a Chilean storefront and confirm them after return
  2. 02Settle one order across several sellers on a multi-merchant platform
  3. 03Manage enrolled OneClick Mall cards for recurring or card-on-file payments

MCP support

This is an MCP server that exposes 19 tools to MCP clients for calling Transbank Webpay Plus, Webpay Mall, and OneClick Mall endpoints.

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-transbank": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-transbank"
],
"env": {
"TRANSBANK_COMMERCE_CODE": "<TRANSBANK_COMMERCE_CODE>",
"TRANSBANK_API_KEY_SECRET": "<TRANSBANK_API_KEY_SECRET>",
"TRANSBANK_ENV": "<TRANSBANK_ENV>"
}
}
}
}
Run commandnpx -y @codespar/mcp-transbank
Environment variables to set
TRANSBANK_COMMERCE_CODETransbank merchant commerce code (sent as Tbk-Api-Key-Id header)
TRANSBANK_API_KEY_SECRETSecretTransbank API secret key (sent as Tbk-Api-Key-Secret header)
TRANSBANK_ENVEnvironment: 'integration' (default, https://webpay3gint.transbank.cl) or 'production' (https://webpay3g.transbank.cl)

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-transbank0.2.0-alpha.3

Tools

19

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountnumberYesAmount in CLP (integer, no decimals)
buy_orderstringYesMerchant-side order id (max 26 chars)
return_urlstringYesURL Transbank redirects the user back to after payment
session_idstringYesMerchant-side session id (max 61 chars)

Details

From the project README

@codespar/mcp-transbank

MCP server for Transbank — Chile's dominant card acquirer.

Transbank is effectively default for Chilean commerce (state-origin roots, owned by a consortium of Chilean banks). Shipping this server is a prerequisite for any "CodeSpar covers LatAm" claim that includes Chile.

Two products are covered:

  • Webpay Plus — one-shot redirect payments (buy_order + amount, user is redirected to Webpay to pay).
  • Webpay OneClick Mall — tokenized recurring / card-on-file payments that can split across multiple merchant codes (the "mall" model).

Tools (19)

ToolPurpose
webpay_create_transactionCreate a Webpay Plus transaction.
webpay_commit_transactionCommit a Webpay Plus transaction after the user has returned from the Webpay flow.
webpay_get_transaction_statusGet the current status of a Webpay Plus transaction by token.
webpay_refund_transactionRefund a committed Webpay Plus transaction.
webpay_increase_amountCapture a previously authorized Webpay Plus transaction (partial-capture / deferred-capture flow).
webpay_capture_transactionDeferred-capture for a previously authorized Webpay Plus transaction.
webpay_mall_create_transactionCreate a Webpay Mall transaction — one parent buy_order split across several seller commerce codes.
webpay_mall_commit_transactionCommit a Webpay Mall transaction after the user has returned.
webpay_mall_get_transaction_statusGet the status of a Webpay Mall transaction by token (includes per-child details).
webpay_mall_refund_transactionRefund one child seller of a Webpay Mall transaction.
webpay_mall_capture_transactionDeferred-capture for one child seller inside a Webpay Mall transaction.
oneclick_create_inscriptionStart a OneClick Mall card-enrollment flow.
oneclick_finish_inscriptionFinalize a OneClick Mall enrollment after the user has returned.
oneclick_delete_inscriptionDelete (revoke) a stored OneClick Mall card for a user.
oneclick_authorizeCharge a stored OneClick Mall card across one or more mall merchant codes.
oneclick_captureCapture a previously authorized OneClick Mall charge (deferred-capture flow).
oneclick_refundRefund a OneClick Mall charge.
oneclick_statusGet the status of a OneClick Mall transaction by parent buy_order.
oneclick_get_transaction_by_buy_orderLook up a OneClick Mall transaction by parent buy_order.

Install

npm install @codespar/mcp-transbank@alpha

Environment

TRANSBANK_COMMERCE_CODE="..."   # merchant commerce code (Tbk-Api-Key-Id)
TRANSBANK_API_KEY_SECRET="..."  # secret key (Tbk-Api-Key-Secret)
TRANSBANK_ENV="integration"     # 'integration' (default) or 'production'

Integration base URL: https://webpay3gint.transbank.cl Production base URL: https://webpay3g.transbank.cl

Authentication

Every request sends two headers:

Tbk-Api-Key-Id: <commerce_code>
Tbk-Api-Key-Secret: <api_key_secret>
Content-Type: application/json

The server handles headers automatically — you only configure the env vars.

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-transbank

# HTTP (for server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-transbank

Webpay Plus flow

  1. Call webpay_create_transaction with buy_order, session_id, amount, return_url.
  2. Redirect user to url?token_ws=<token>.
  3. User pays at Webpay, is redirected back to return_url.
  4. Call webpay_commit_transaction with the returned token to actually charge.

OneClick Mall flow

  1. Call oneclick_create_inscription with username, email, response_url. Redirect user to url_webpay.
  2. After user returns, call oneclick_finish_inscription. Store the returned tbk_user against your user.
  3. To charge later, call oneclick_authorize with username, tbk_user, a parent mall buy_order, and a details array (one entry per child merchant).

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.