Skip to main content
DL

dLocal

v0.2.1API Key

LatAm cross-border payments through a single API. 15+ countries, local methods (Pix, OXXO, PSE, SPEI, boleto) + cards. The one call, multi-country abstraction per-country PSPs can't provide on their own.

18 tools4 env vars🌎 LATAMstable on npm

What your agent can do

dLocal gives your agent 18 tools it calls directly β€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • create_payment β€” Create a payment (pay-in) in a LatAm country using a local payment method. Returns the payment object with a status and, for voucher/QR methods, the redirect/display data.
  • get_payment β€” Get payment status and full detail by dLocal payment id.
  • get_payment_by_order_id β€” Get a payment by the merchant-side order_id supplied at creation time. Useful when the agent only kept its own reference and not dLocal's id.
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("create_payment", { /* ... */ });

Install

terminal
$ npm install @codespar/mcp-dlocal

Quickstart

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

claude_desktop_config.json
{
  "mcpServers": {
    "dlocal": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-dlocal"
      ],
      "env": {
        "DLOCAL_LOGIN": "<your_dlocal_login>",
        "DLOCAL_TRANS_KEY": "<your_dlocal_trans_key>",
        "DLOCAL_SECRET_KEY": "<your_dlocal_secret_key>"
      }
    }
  }
}

After restart, your agent can call any of the 18 tools below β€” try create_payment first.

Environment variables Β· 4

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

DLOCAL_LOGIN
required

dLocal API Login (X-Login header)

DLOCAL_TRANS_KEY
requiredsecret

dLocal API Trans-Key (X-Trans-Key header)

DLOCAL_SECRET_KEY
requiredsecret

dLocal API Secret Key used to sign V2 HMAC-SHA256 requests

DLOCAL_BASE_URL
optional

dLocal API base URL. Defaults to https://api.dlocal.com (prod). Use https://sandbox.dlocal.com for sandbox.

Available tools Β· 18

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

WRITEcreate_payment
Create a payment (pay-in) in a LatAm country using a local payment method. Returns the payment object with a status and, for voucher/QR methods, the redirect/display data.
WRITEget_payment
Get payment status and full detail by dLocal payment id.
WRITEget_payment_by_order_id
Get a payment by the merchant-side order_id supplied at creation time. Useful when the agent only kept its own reference and not dLocal's id.
WRITElist_payments
List payments with optional date / country / status filters. Useful for reconciliation and reporting agents.
WRITEcapture_payment
Capture an AUTHORIZED card payment. Omit amount for full capture; pass amount for partial capture (must be ≀ authorized amount). Card-only.
DELETEcancel_payment
Cancel an authorized-but-not-captured payment, or void a PENDING payment. Card payments must be in AUTHORIZED state.
DELETEcreate_refund
Refund a captured payment. Supports full refund (amount omitted) or partial refund (amount set).
DELETEget_refund
Get refund status by refund id.

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-dlocal` 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.
dLocal β€” MCP server Β· 18 tools | CodeSpar