Pagar Me

Finance and commerce

MCP server for Pagar.me, orders, charges, recipients, transfers, plans, subscriptions, webhooks.

Your AI app calls the Pagar Me MCP server, which does the finance and commerce work and sends the result back to the chat.

About Pagar Me

Pagar Me is a community MCP server from codespar, filed in our directory under finance and commerce. MCP server for Pagar.me, orders, charges, recipients, transfers, plans, subscriptions, webhooks.

Pagar Me runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-pagar-me@0.2.2 and talks to it over standard input and output. It needs PAGARME_API_KEY set before Pagar Me starts.

Pagar Me is listed in the official MCP registry as io.github.codespar/mcp-pagar-me, version 0.2.2.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-pagar-me
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-pagar-me

How to set up Pagar Me

  1. Install Node.js on the machine that runs your AI app, because Pagar Me starts with npx and downloads its package on first run.
  2. Create PAGARME_API_KEY for Pagar Me in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Pagar Me to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Pagar Me tools to confirm the connection.
  5. Run one read-only task with Pagar Me first, and keep your app asking before each tool call until the results look right.

Pagar Me compared with similar servers

  • Pagbrasil by codespar has fewer GitHub stars than Pagar Me (278 against 278); both are community servers, and both run locally.
  • Openpay by codespar has fewer GitHub stars than Pagar Me (278 against 278); both are community servers, and both run locally.
  • Pagseguro by codespar has fewer GitHub stars than Pagar Me (278 against 278); both are community servers, and both run locally.

Before you connect Pagar Me

  • Give Pagar Me its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Pagar Me tool call until you trust what it does with them.
  • Treat text that Pagar Me fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Pagar Me on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Pagar Me

How marketing and sales teams put Pagar Me to work, by company size. Pick the size closest to yours and start Pagar Me on one use case.

Small business

  • A small business can ask Pagar Me which products and customers drive margin, then plan promotions around them.
  • Owners can use Pagar Me to check refunds, failed payments and churn reasons without opening three dashboards.
  • Pagar Me runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Pagar Me to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Pagar Me to check spend against budget each week and move money to what's working.
  • Start Pagar Me on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Pagar Me read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Pagar Me to answer revenue questions by channel and region with figures finance signs off on.
  • Pagar Me is a community server, so have security review the code and pin a version before Pagar Me touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Pagar Me README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@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
  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

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 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

Questions about Pagar Me

What is the Pagar Me MCP server?

MCP server for Pagar.me, orders, charges, recipients, transfers, plans, subscriptions, webhooks. Pagar Me is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Pagar Me MCP server?

Add Pagar Me to your AI app's MCP config with the command npx -y @codespar/mcp-pagar-me@0.2.2. In Claude Code, run claude mcp add --transport stdio codespar-pagar-me -- npx -y @codespar/mcp-pagar-me@0.2.2. To run Pagar Me this way you need Node.js installed.

Does Pagar Me need an API key?

Yes. Pagar Me expects PAGARME_API_KEY to be set. Create the key for Pagar Me in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Pagar Me an official MCP server?

No. Pagar Me is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Pagar Me access to company data.

What license is Pagar Me under?

Pagar Me is released under the MIT license, according to its GitHub repository. The license covers the code of Pagar Me; the service it connects to has its own terms.