Skip to main content
DL

dLocal

v0.2.0API 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

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

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets โ€” it receives scoped, short-lived session tokens.
Servers โ€” Every LatAm commerce API your agent needs | CodeSpar