# mcp-pagar-me

Connects AI agents to the Pagar.me payment platform to issue Pix charges, handle split payouts, and manage billing.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/payments/pagar-me
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-pagar-me

## What it does

This server links your workspace with the Stone-owned Pagar.me gateway. It provides 22 callable tools. An assistant can generate orders, check account balances, or trigger transactions via Pix or credit cards. Two-step charge capture and refund flows work out of the box.

Beyond single transactions, the tooling covers multi-party split payouts. You can configure recipients and schedule direct bank withdrawals. Subscription billing is supported alongside automated webhook registration.

You need `PAGARME_API_KEY` in your environment to authenticate calls. Tokenizing card details via `create_card_token` fails unless you also define `PAGARME_PUBLIC_KEY`. You can test safe workflows first by supplying sandbox test credentials from your Pagar.me account.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `PAGARME_API_KEY`, `PAGARME_PUBLIC_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PAGARME_API_KEY=<PAGARME_API_KEY> --env PAGARME_PUBLIC_KEY=<PAGARME_PUBLIC_KEY> --transport stdio pagar-me -- npx -y @codespar/mcp-pagar-me
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add pagar-me --env PAGARME_API_KEY=<PAGARME_API_KEY> --env PAGARME_PUBLIC_KEY=<PAGARME_PUBLIC_KEY> -- npx -y @codespar/mcp-pagar-me
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "pagar-me": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-pagar-me"
            ],
            "env": {
                "PAGARME_API_KEY": "<PAGARME_API_KEY>",
                "PAGARME_PUBLIC_KEY": "<PAGARME_PUBLIC_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "pagar-me": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-pagar-me"
            ],
            "env": {
                "PAGARME_API_KEY": "<PAGARME_API_KEY>",
                "PAGARME_PUBLIC_KEY": "<PAGARME_PUBLIC_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PAGARME_API_KEY=<PAGARME_API_KEY> -e PAGARME_PUBLIC_KEY=<PAGARME_PUBLIC_KEY> pagar-me npx -y @codespar/mcp-pagar-me
```
Replace <…> with your own values

## When to use it
- Generate customer charges using Pix or bank cards
- Configure split payouts and direct transfers to recipient accounts
- Execute complete or partial refunds on existing transactions
- Set up recurring subscription plans and customer enrollments

## Example prompts
- Create a new Pix charge for 150 BRL
- Check the current balance and retrieve anticipation limits for this recipient
- Issue a partial refund for charge ID `ch_12345`

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
