mcpField
M
mcp-pagseguro

mcp-pagseguro

Local
github.com/codesparFinance275Updated 5w ago

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

  1. 01Exposes 24 payment-related tools
  2. 02Covers orders, charges, Pix and boleto
  3. 03Supports refunds, partial refunds and dispute lookup
  4. 04Manages subscriptions, splits and webhooks
  5. 05Sandbox mode for testing without live charges

Use cases

  1. 01Creating Pix or boleto orders through an agent
  2. 02Checking order and charge status and processing refunds
  3. 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.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-pagseguro": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-pagseguro"
],
"env": {
"PAGSEGURO_TOKEN": "<PAGSEGURO_TOKEN>"
}
}
}
}
Run commandnpx -y @codespar/mcp-pagseguro
Environment variables to set
PAGSEGURO_TOKENSecretAPI key for pagseguro

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

Tools

24

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
itemsarrayYesOrder items
chargesarrayNoPayment charges (Pix, boleto, or card)
customerobjectYesCustomer data
customer.namestringYesCustomer name
customer.emailstringYesEmail address
customer.tax_idstringYesCPF or CNPJ (numbers only)
reference_idstringNoYour unique reference ID

Details

From the project README

@codespar/mcp-pagseguro

MCP server for PagSeguro/PagBank — orders, charges, Pix, boleto, and credit card payments

npm License: MIT

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)

ToolPurpose
create_orderCreate an order in PagSeguro (Pix, boleto, or credit card)
get_orderGet order details by ID
list_ordersList orders with optional filters
create_chargeCreate a standalone charge
refundRefund a charge (full or partial)
get_pix_qrcodeGet Pix QR code payload and image for an order charge
create_customerCreate a customer in PagSeguro
get_balanceGet account balance
create_subscriptionCreate a recurring subscription plan in PagSeguro
list_subscriptionsList subscriptions with optional filters
get_notificationsGet payment notification details by notification code
create_splitCreate a split payment configuration for marketplace transactions
get_disputeGet dispute/chargeback details by ID
pay_orderPay an existing order (attach a charge/payment to an order in CREATED state)
get_chargeGet charge details by ID
list_chargesList charges with optional filters
capture_chargeCapture a pre-authorized credit card charge
cancel_chargeCancel a charge that has not yet been settled
create_boletoCreate a boleto charge
get_boletoGet boleto charge details by ID
get_public_keysGet PagSeguro public key for card data encryption (type: card)
create_payoutCreate a payout/transfer to a bank account or Pix key
create_webhookRegister an application webhook URL to receive event notifications
list_webhooksList 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
  1. Go to PagBank Developer Portal
  2. Create a developer account
  3. Generate your API token
  4. Set the PAGSEGURO_TOKEN environment variable

Environment Variables

VariableRequiredDescription
PAGSEGURO_TOKENYesBearer token from PagBank
PAGSEGURO_SANDBOXNoSet to "true" for sandbox mode

Roadmap

v0.2 (planned)
  • create_subscription — Create a recurring subscription
  • list_subscriptions — List all subscriptions with filters
  • get_notifications — Get payment notifications/webhooks
  • create_split — Create split payments between receivers
  • get_dispute — Get dispute/chargeback details
v0.3 (planned)
  • create_plan — Create a subscription plan
  • get_installments — Get installment options for a payment
  • batch_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

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.