Skip to main content
TR

Transbank

v0.2.0-alpha.2API Keyalpha

Chile's dominant card acquirer — state-origin roots, effectively default for Chilean commerce. Webpay Plus (single payments) + Webpay OneClick Mall (stored-card recurring). Prerequisite for any LatAm-coverage claim that includes Chile.

19 tools3 env vars🇨🇱 Chilealpha — pending validation

What your agent can do

Transbank gives your agent 19 tools it calls directly — pick the ones it needs, in Claude, Cursor, or any MCP client.

  • webpay_create_transactionCreate a Webpay Plus transaction. Returns { token, url } — redirect the user to url?token_ws=<token> to complete payment. After the user returns to return_url, call webpay_commit_transaction.
  • webpay_commit_transactionCommit a Webpay Plus transaction after the user has returned from the Webpay flow. Must be called to actually charge the card.
  • webpay_get_transaction_statusGet the current status of a Webpay Plus transaction by token.
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("webpay_create_transaction", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-transbank@alpha

Quickstart

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

claude_desktop_config.json
{
  "mcpServers": {
    "transbank": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-transbank@alpha"
      ],
      "env": {
        "TRANSBANK_COMMERCE_CODE": "<your_transbank_commerce_code>",
        "TRANSBANK_API_KEY_SECRET": "<your_transbank_api_key_secret>"
      }
    }
  }
}

After restart, your agent can call any of the 19 tools below — try webpay_create_transaction first.

Environment variables · 3

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

TRANSBANK_COMMERCE_CODE
required

Transbank merchant commerce code (sent as Tbk-Api-Key-Id header)

TRANSBANK_API_KEY_SECRET
requiredsecret

Transbank API secret key (sent as Tbk-Api-Key-Secret header)

TRANSBANK_ENV
optional

Environment: 'integration' (default, https://webpay3gint.transbank.cl) or 'production' (https://webpay3g.transbank.cl)

Available tools · 19

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

WRITEwebpay_create_transaction
Create a Webpay Plus transaction. Returns { token, url } — redirect the user to url?token_ws=<token> to complete payment. After the user returns to return_url, call webpay_commit_transaction.
READwebpay_commit_transaction
Commit a Webpay Plus transaction after the user has returned from the Webpay flow. Must be called to actually charge the card.
READwebpay_get_transaction_status
Get the current status of a Webpay Plus transaction by token.
DELETEwebpay_refund_transaction
Refund a committed Webpay Plus transaction. Full refund if amount equals original; partial otherwise.
READwebpay_increase_amount
Capture a previously authorized Webpay Plus transaction (partial-capture / deferred-capture flow).
WRITEwebpay_capture_transaction
Deferred-capture for a previously authorized Webpay Plus transaction. Uses the official PUT /capture endpoint — prefer this over webpay_increase_amount for standard deferred-capture flows.
WRITEwebpay_mall_create_transaction
Create a Webpay Mall transaction — one parent buy_order split across several seller commerce codes. Returns { token, url } exactly like Webpay Plus. Each details entry is a child charge with its own commerce_code, buy_order, and amount.
READwebpay_mall_commit_transaction
Commit a Webpay Mall transaction after the user has returned. Charges all child commerce codes at once.

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-transbank` 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.
Transbank — MCP server · 19 tools | CodeSpar