mcpField
M
mcp-dlocal

mcp-dlocal

Local
github.com/codesparFinance275Updated 4w ago

About mcp-dlocal

mcp-dlocal is an MCP server for dLocal that handles cross-border payments, payouts and refunds across more than 15 LatAm countries through one API. It is aimed at merchants and developers who need local payment methods in several Latin American markets.

Key features

  1. 01Pay-ins with local payment methods across LatAm
  2. 02Payment, refund and payout query and management
  3. 03Outgoing payouts to beneficiaries in LatAm countries
  4. 04Per-country payment method listing at runtime
  5. 05Tax document validation and FX rate queries

Use cases

  1. 01Accepting payments in several LatAm countries with local methods
  2. 02Sending payouts to suppliers or beneficiaries in the region
  3. 03Querying available payment methods per country instead of hard-coding them

MCP support

This is an MCP server that exposes dLocal payment, refund, payout and lookup tools to MCP clients. Requests are signed automatically with V2 HMAC-SHA256.

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-dlocal": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-dlocal"
],
"env": {
"DLOCAL_LOGIN": "<DLOCAL_LOGIN>",
"DLOCAL_TRANS_KEY": "<DLOCAL_TRANS_KEY>",
"DLOCAL_SECRET_KEY": "<DLOCAL_SECRET_KEY>",
"DLOCAL_BASE_URL": "<DLOCAL_BASE_URL>"
}
}
}
}
Run commandnpx -y @codespar/mcp-dlocal
Environment variables to set
DLOCAL_LOGINdLocal API Login (X-Login header)
DLOCAL_TRANS_KEYSecretdLocal API Trans-Key (X-Trans-Key header)
DLOCAL_SECRET_KEYSecretdLocal API Secret Key used to sign V2 HMAC-SHA256 requests
DLOCAL_BASE_URLdLocal API base URL. Defaults to https://api.dlocal.com (prod). Use https://sandbox.dlocal.com for sandbox.

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-dlocal0.2.2

Tools

18

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
cardobjectNoFor DIRECT card flow only — tokenized card object. Omit for REDIRECT.
payerobjectYesPayer identification
payer.namestringYesPayer full name
payer.emailstringYesPayer email
payer.documentstringYesLocal tax ID (CPF/CNPJ for BR, RFC for MX, DNI for AR, etc)
payer.user_referencestringNoMerchant-side stable user ID
amountnumberYesAmount in the country's currency, major units (e.g. 100 = 100 BRL, not cents)
countrystringYesISO-3166 alpha-2 country code (BR, MX, AR, CO, CL, PE, UY, EC, BO, CR, GT)
currencystringYesISO-4217 currency code (BRL, MXN, ARS, COP, CLP, PEN, USD, etc)
order_idstringYesMerchant-side order reference (appears in reports)
descriptionstringNoHuman-readable description for the payer
callback_urlstringNoBrowser redirect target after REDIRECT flow completes
notification_urlstringNoWebhook URL dLocal calls on status changes
payment_method_idstringYesMethod id from /payments-methods (e.g. CARD, PIX, OX, PSE, SPEI). Use list_payment_methods to enumerate for a country.
payment_method_flowenumYesDIRECT for tokenized card; REDIRECT for hosted flow (OXXO voucher, Pix QR, PSE bank select)DIRECT | REDIRECT

Details

From the project README

@codespar/mcp-dlocal

MCP server for dLocal — LatAm cross-border payments.

One API, 15+ LatAm countries, local payment methods (Pix, OXXO, PSE, SPEI, Boleto, cards). The abstraction that per-country PSP servers cannot provide on their own.

Tools (18)

ToolPurpose
create_paymentCreate a payment (pay-in) in a LatAm country using a local payment method.
get_paymentGet payment status and full detail by dLocal payment id.
get_payment_by_order_idGet a payment by the merchant-side order_id supplied at creation time.
list_paymentsList payments with optional date / country / status filters.
capture_paymentCapture an AUTHORIZED card payment.
cancel_paymentCancel an authorized-but-not-captured payment, or void a PENDING payment.
create_refundRefund a captured payment.
get_refundGet refund status by refund id.
list_refundsList refunds, optionally scoped to a payment_id.
create_payoutSend money out to a beneficiary in a LatAm country.
get_payoutGet payout status by dLocal payout id.
get_payout_by_external_idGet a payout by the merchant external_id / order_id supplied at creation time.
list_payoutsList payouts with optional date / country / status filters.
list_payment_methodsList all payment methods available for a given country.
get_balanceGet the merchant's current available balance per currency.
get_exchange_rateQuery the dLocal FX rate for a destination country/currency pair.
create_card_tokenTokenize a card for use in DIRECT-flow create_payment.
validate_documentValidate a LatAm tax/identity document (CPF or CNPJ in BR, CUIT/CUIL/DNI in AR, RUT in CL/UY, RFC/CURP in M...

Install

npm install @codespar/mcp-dlocal

Environment

DLOCAL_LOGIN="..."        # X-Login header value
DLOCAL_TRANS_KEY="..."    # X-Trans-Key header value
DLOCAL_SECRET_KEY="..."   # HMAC secret used to sign V2 requests
DLOCAL_BASE_URL="..."     # Optional. Defaults to https://api.dlocal.com. Use https://sandbox.dlocal.com for sandbox.

Authentication

Every request signs with V2 HMAC-SHA256:

X-Date: <ISO-8601 UTC>
X-Login: <login>
X-Trans-Key: <trans_key>
Authorization: V2-HMAC-SHA256, Signature: <hex(hmac_sha256(login + x_date + body, secret_key))>

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

Run

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

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

Countries covered

Argentina, Bolivia, Brazil, Chile, Colombia, Costa Rica, Ecuador, Guatemala, Mexico, Peru, Uruguay, and more. Use list_payment_methods to enumerate available methods per country at runtime rather than hard-coding.

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.