mcpField
M
mcp-pagar-me

mcp-pagar-me

Local
github.com/codesparFinance275Updated 4w ago

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

  1. 0122 tools for orders, charges, transfers and subscriptions
  2. 02Charges via Pix, boleto or credit card
  3. 03Recipient management and balance lookup for split payments
  4. 04Receivables anticipation lookup and requests
  5. 05Webhook registration for event notifications

Use cases

  1. 01Creating orders and charges for a Brazilian e-commerce agent
  2. 02Managing split-payment recipients and sending transfers or withdrawals
  3. 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.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-pagar-me": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-pagar-me"
],
"env": {
"PAGARME_API_KEY": "<PAGARME_API_KEY>",
"PAGARME_PUBLIC_KEY": "<PAGARME_PUBLIC_KEY>"
}
}
}
}
Run commandnpx -y @codespar/mcp-pagar-me
Environment variables to set
PAGARME_API_KEYSecretSecret key (sk_xxx) for Pagar.me
PAGARME_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.

Packages
npm@codespar/mcp-pagar-me0.2.2

Tools

22

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
itemsarrayYesOrder items
customerobjectYesCustomer object with name, email, document, type
customer.namestringYesCustomer name
customer.typeenumYesCustomer typeindividual | company
customer.emailstringYesCustomer email
customer.documentstringYesCPF or CNPJ
paymentsarrayYesPayment 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

npm License: MIT

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)

ToolPurpose
create_orderCreate an order in Pagar.me with items and payment
get_orderGet order details by ID
list_ordersList orders with optional filters
create_chargeCreate a charge (Pix, boleto, or credit card)
get_chargeGet charge details by ID
create_recipientCreate a recipient for split payments
get_balanceGet current account balance
create_transferCreate a transfer to a recipient
refundRefund a charge (full or partial)
list_recipientsList recipients with optional filters
create_anticipationRequest anticipation of receivables for a recipient (antecipação)
get_anticipationGet anticipation details by ID
get_anticipation_limitsGet anticipation limits available for a recipient
create_planCreate a subscription plan
update_planUpdate an existing subscription plan
create_subscriptionCreate a recurring subscription for a customer
cancel_subscriptionCancel a recurring subscription
create_card_tokenTokenize a credit card (PCI-safe).
create_withdrawalCreate a withdrawal (saque) transferring recipient balance to their registered bank account
register_webhookRegister a webhook endpoint to receive event notifications
capture_chargeCapture a pre-authorized charge (auth-then-capture flow).
partial_refundRefund 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
  1. Go to Pagar.me Dashboard
  2. Create an account
  3. Get your secret key (sk_test_xxx for test mode)
  4. Set the PAGARME_API_KEY environment variable

Environment Variables

VariableRequiredDescription
PAGARME_API_KEYYesSecret key (sk_xxx) from Pagar.me dashboard
PAGARME_PUBLIC_KEYNoPublic key (pk_xxx) for create_card_token only

Roadmap

v0.3 (planned)
  • list_charges — List charges with filters
  • list_subscriptions — List subscriptions
  • list_plans — List plans
  • batch_charges — Create multiple charges in a single request
  • list_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

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.