About mcp-pagseguro
mcp-pagseguro is an MCP server for the PagSeguro/PagBank payment platform, exposing 24 tools for orders, charges, Pix, boleto and credit card payments. It is aimed at developers who want AI assistants or agents to call Brazilian payment APIs. A sandbox mode is available for testing.
Key features
- 01Exposes 24 payment-related tools
- 02Covers orders, charges, Pix and boleto
- 03Supports refunds, partial refunds and dispute lookup
- 04Manages subscriptions, splits and webhooks
- 05Sandbox mode for testing without live charges
Use cases
- 01Creating Pix or boleto orders through an agent
- 02Checking order and charge status and processing refunds
- 03Testing payment flows in the PagSeguro sandbox
MCP support
This project is an MCP server that exposes PagSeguro payment operations as tools to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y @codespar/mcp-pagseguroPAGSEGURO_TOKENSecretAPI key for pagseguroLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
24Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | Yes | Order items |
| charges | array | No | Payment charges (Pix, boleto, or card) |
| customer | object | Yes | Customer data |
| customer.name | string | Yes | Customer name |
| customer.email | string | Yes | Email address |
| customer.tax_id | string | Yes | CPF or CNPJ (numbers only) |
| reference_id | string | No | Your unique reference ID |
Details
From the project README@codespar/mcp-pagseguro
MCP server for PagSeguro/PagBank — orders, charges, Pix, boleto, and credit card payments
Quick Start
Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"pagseguro": {
"command": "npx",
"args": ["-y", "@codespar/mcp-pagseguro"],
"env": {
"PAGSEGURO_TOKEN": "your-token",
"PAGSEGURO_SANDBOX": "true"
}
}
}
}
Claude Code
claude mcp add pagseguro -- npx @codespar/mcp-pagseguro
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"servers": {
"pagseguro": {
"command": "npx",
"args": ["-y", "@codespar/mcp-pagseguro"],
"env": {
"PAGSEGURO_TOKEN": "your-token",
"PAGSEGURO_SANDBOX": "true"
}
}
}
}
Tools (24)
| Tool | Purpose |
|---|---|
create_order | Create an order in PagSeguro (Pix, boleto, or credit card) |
get_order | Get order details by ID |
list_orders | List orders with optional filters |
create_charge | Create a standalone charge |
refund | Refund a charge (full or partial) |
get_pix_qrcode | Get Pix QR code payload and image for an order charge |
create_customer | Create a customer in PagSeguro |
get_balance | Get account balance |
create_subscription | Create a recurring subscription plan in PagSeguro |
list_subscriptions | List subscriptions with optional filters |
get_notifications | Get payment notification details by notification code |
create_split | Create a split payment configuration for marketplace transactions |
get_dispute | Get dispute/chargeback details by ID |
pay_order | Pay an existing order (attach a charge/payment to an order in CREATED state) |
get_charge | Get charge details by ID |
list_charges | List charges with optional filters |
capture_charge | Capture a pre-authorized credit card charge |
cancel_charge | Cancel a charge that has not yet been settled |
create_boleto | Create a boleto charge |
get_boleto | Get boleto charge details by ID |
get_public_keys | Get PagSeguro public key for card data encryption (type: card) |
create_payout | Create a payout/transfer to a bank account or Pix key |
create_webhook | Register an application webhook URL to receive event notifications |
list_webhooks | List registered application webhooks |
Authentication
PagSeguro uses a Bearer token for authentication. Generate your token from the PagBank developer portal.
Sandbox / Testing
PagSeguro provides a sandbox at sandbox.api.pagseguro.com. Set PAGSEGURO_SANDBOX=true to use it.
Get your credentials
- Go to PagBank Developer Portal
- Create a developer account
- Generate your API token
- Set the
PAGSEGURO_TOKENenvironment variable
Environment Variables
| Variable | Required | Description |
|---|---|---|
PAGSEGURO_TOKEN | Yes | Bearer token from PagBank |
PAGSEGURO_SANDBOX | No | Set to "true" for sandbox mode |
Roadmap
v0.2 (planned)
create_subscription— Create a recurring subscriptionlist_subscriptions— List all subscriptions with filtersget_notifications— Get payment notifications/webhookscreate_split— Create split payments between receiversget_dispute— Get dispute/chargeback details
v0.3 (planned)
create_plan— Create a subscription planget_installments— Get installment options for a paymentbatch_refunds— Process multiple refunds in a single request
Want to contribute? Open a PR or request a tool.
Links
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
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.