{"_id":"@codespar/mcp-pagbrasil","name":"@codespar/mcp-pagbrasil","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@codespar/mcp-pagbrasil","version":"0.1.0","description":"MCP server for PagBrasil — cross-border acquiring into Brazil: Pix, Boleto Flash, local cards, refunds","type":"module","main":"./dist/index.js","bin":{"mcp-pagbrasil":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.8.0"},"license":"MIT","keywords":["mcp","pagbrasil","payments","pix","boleto","cross-border","brazil"],"mcpName":"io.github.codespar/mcp-pagbrasil","_id":"@codespar/mcp-pagbrasil@0.1.0","gitHead":"0cf000f9cad29acc97dc1e29789d180431c6fe12","types":"./dist/index.d.ts","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-L61fH47TTFxScfc9MWsyc92YP54zLIFvwzZDi9+6HTu8UTXY9l7bH83QUn95nMp+CVRX/vHX8fCmKINJDtFGog==","shasum":"99dee2d16fd00859950095fa61ceb7a6a99b7e7a","tarball":"https://registry.npmjs.org/@codespar/mcp-pagbrasil/-/mcp-pagbrasil-0.1.0.tgz","fileCount":4,"unpackedSize":15349,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNwI5KX5sFXyETW16pRhtb0DFS6vGpVbijKzwjXI//NgIgc9fvdD05UjDNOOlwtMri2CEw+/jWBtnVx7GVKYMA9WA="}]},"_npmUser":{"name":"codespar-npm","email":"fabiano@codespar.dev"},"directories":{},"maintainers":[{"name":"codespar-npm","email":"fabiano@codespar.dev"},{"name":"dangazineu","email":"daniel.gazineu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-pagbrasil_0.1.0_1783129678968_0.844142014893011"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-04T01:47:58.861Z","0.1.0":"2026-07-04T01:47:59.114Z","modified":"2026-07-04T01:47:59.307Z"},"maintainers":[{"name":"codespar-npm","email":"fabiano@codespar.dev"},{"name":"dangazineu","email":"daniel.gazineu@gmail.com"}],"description":"MCP server for PagBrasil — cross-border acquiring into Brazil: Pix, Boleto Flash, local cards, refunds","keywords":["mcp","pagbrasil","payments","pix","boleto","cross-border","brazil"],"license":"MIT","readme":"# @codespar/mcp-pagbrasil\n\n> MCP server for **PagBrasil** — the cross-border acquirer for international merchants selling into Brazil: Pix, Automatic Pix (PagStream), Boleto Flash, PEC Flash and local credit cards with installments. Distinct from PagBank/PagSeguro.\n\n[![npm](https://img.shields.io/npm/v/@codespar/mcp-pagbrasil)](https://www.npmjs.com/package/@codespar/mcp-pagbrasil)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to `~/.config/claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"pagbrasil\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codespar/mcp-pagbrasil\"],\n      \"env\": {\n        \"PAGBRASIL_PBTOKEN\": \"your-merchant-token\",\n        \"PAGBRASIL_SECRET\": \"your-secret-phrase\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add pagbrasil -- npx @codespar/mcp-pagbrasil\n```\n\n### Cursor / VS Code\n\nAdd to `.cursor/mcp.json` or `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"pagbrasil\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codespar/mcp-pagbrasil\"],\n      \"env\": {\n        \"PAGBRASIL_PBTOKEN\": \"your-merchant-token\",\n        \"PAGBRASIL_SECRET\": \"your-secret-phrase\"\n      }\n    }\n  }\n}\n```\n\n## Authentication\n\nEvery request carries the merchant token (`pbtoken`) and the secret phrase as **body fields** — there is no auth header. This server injects both from `PAGBRASIL_PBTOKEN` and `PAGBRASIL_SECRET`.\n\n## API shape (worth knowing)\n\nPagBrasil's API is **form-urlencoded** (not JSON) and answers **XML**. The merchant token (`pbtoken`) and secret phrase travel as body fields on every request — this server injects both from the environment. Tool responses hand the raw XML to the agent under `xml` so no fields are lost.\n\n## Tools (3)\n\n| Tool | Endpoint | What it does |\n|---|---|---|\n| `create_order` | `POST /order/add` | Create an order / request a payment (pix, boleto, creditcard). Pix responses carry `pix_code` + `pix_image`; boleto responses carry the bar code + PDF URL |\n| `get_order` | `POST /order/get` | Fetch an order's current status — poll to detect settlement |\n| `refund_order` | `POST /order/refund` | Refund a settled order (`amount_brl` for partial, omit for full) |\n\n## Environment\n\n| Variable | Required | Description |\n|---|---|---|\n| `PAGBRASIL_PBTOKEN` | yes | Merchant token from the PagBrasil Dashboard |\n| `PAGBRASIL_SECRET` | yes | Secret phrase from the Dashboard |\n| `PAGBRASIL_BASE_URL` | no | Defaults to `https://sandbox.pagbrasil.com/api`. Production hosts are issued per-merchant after the Payment Service Agreement — set the URL your dashboard provides |\n\n## Notes\n\n- `amount_brl` is in **major units** as a string: `'125.00'` = R$ 125,00.\n- `order_number` must be unique per `customer_taxid`. Same number + same taxid = idempotent no-op; same number + different taxid = rejected (`Duplicated order`).\n- `customer_taxid` must be a valid CPF or CNPJ — agents should ask the user, never invent one.\n\n## Enterprise\n\nNeed governance, budget limits, and audit trails for agent-driven payments on PagBrasil? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds a policy engine, payment routing, and compliance templates on top of these MCP servers.\n\n## License\n\nMIT © CodeSpar\n","readmeFilename":"README.md","_rev":"1-75bdcb42041900181e27e15ed7df3b80"}