About mcp-pagar-me
mcp-pagar-me is an MCP server for Pagar.me, a payment platform in the Stone ecosystem. It covers orders, charges, recipients, transfers and subscriptions, aimed at split payment flows.
Key features
- 0122 tools for orders, charges, transfers and subscriptions
- 02Charges via Pix, boleto or credit card
- 03Recipient management and balance lookup for split payments
- 04Receivables anticipation lookup and requests
- 05Webhook registration for event notifications
Use cases
- 01Creating orders and charges for a Brazilian e-commerce agent
- 02Managing split-payment recipients and sending transfers or withdrawals
- 03Checking and requesting anticipation of receivables
MCP support
As an MCP server, it exposes Pagar.me order, charge, transfer, subscription and webhook 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-pagar-mePAGARME_API_KEYSecretSecret key (sk_xxx) for Pagar.mePAGARME_PUBLIC_KEYSecretPublic key (pk_xxx) for card tokenization (required only for create_card_token)Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
22Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | Yes | Order items |
| customer | object | Yes | Customer object with name, email, document, type |
| customer.name | string | Yes | Customer name |
| customer.type | enum | Yes | Customer typeindividual | company |
| customer.email | string | Yes | Customer email |
| customer.document | string | Yes | CPF or CNPJ |
| payments | array | Yes | Payment methods array |
Details
From the project README@codespar/mcp-pagar-me
MCP server for Pagar.me — Stone ecosystem payments with orders, charges, and split payments
Quick Start
Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"pagar-me": {
"command": "npx",
"args": ["-y", "@codespar/mcp-pagar-me"],
"env": {
"PAGARME_API_KEY": "sk_your-key"
}
}
}
}
Claude Code
claude mcp add pagar-me -- npx @codespar/mcp-pagar-me
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"servers": {
"pagar-me": {
"command": "npx",
"args": ["-y", "@codespar/mcp-pagar-me"],
"env": {
"PAGARME_API_KEY": "sk_your-key"
}
}
}
}
Tools (22)
| Tool | Purpose |
|---|---|
create_order | Create an order in Pagar.me with items and payment |
get_order | Get order details by ID |
list_orders | List orders with optional filters |
create_charge | Create a charge (Pix, boleto, or credit card) |
get_charge | Get charge details by ID |
create_recipient | Create a recipient for split payments |
get_balance | Get current account balance |
create_transfer | Create a transfer to a recipient |
refund | Refund a charge (full or partial) |
list_recipients | List recipients with optional filters |
create_anticipation | Request anticipation of receivables for a recipient (antecipação) |
get_anticipation | Get anticipation details by ID |
get_anticipation_limits | Get anticipation limits available for a recipient |
create_plan | Create a subscription plan |
update_plan | Update an existing subscription plan |
create_subscription | Create a recurring subscription for a customer |
cancel_subscription | Cancel a recurring subscription |
create_card_token | Tokenize a credit card (PCI-safe). |
create_withdrawal | Create a withdrawal (saque) transferring recipient balance to their registered bank account |
register_webhook | Register a webhook endpoint to receive event notifications |
capture_charge | Capture a pre-authorized charge (auth-then-capture flow). |
partial_refund | Refund a portion of a charge (explicit partial refund; |
Authentication
Pagar.me uses Basic Auth with the secret key (sk_xxx) as username and empty password.
Sandbox / Testing
Pagar.me provides test mode via the dashboard. Use a test-mode API key to avoid real charges.
Get your credentials
- Go to Pagar.me Dashboard
- Create an account
- Get your secret key (sk_test_xxx for test mode)
- Set the
PAGARME_API_KEYenvironment variable
Environment Variables
| Variable | Required | Description |
|---|---|---|
PAGARME_API_KEY | Yes | Secret key (sk_xxx) from Pagar.me dashboard |
PAGARME_PUBLIC_KEY | No | Public key (pk_xxx) for create_card_token only |
Roadmap
v0.3 (planned)
list_charges— List charges with filterslist_subscriptions— List subscriptionslist_plans— List plansbatch_charges— Create multiple charges in a single requestlist_webhooks/delete_webhook— Full webhook management
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.