{"_id":"@codespar/mcp-malga","name":"@codespar/mcp-malga","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@codespar/mcp-malga","version":"0.1.0","description":"MCP server for Malga — Brazilian payments API","type":"module","main":"./dist/index.js","bin":{"mcp-malga":"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"},"keywords":["mcp","malga","payments","pix","boleto","brazil"],"license":"MIT","mcpName":"io.github.codespar/mcp-malga","_id":"@codespar/mcp-malga@0.1.0","gitHead":"1e32748df2e0a8d2c99d6da68177374e9a39753e","types":"./dist/index.d.ts","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-o5vp/Or1rol+0y1ZJw4O12P23IiAn91CPLJ4JNR9jMsiquPFzz86OI+cdasMoEBCIJcrRgdjR/7WR/aHJK70Kg==","shasum":"d85414c62d23aa9251074f08fd9c755ee10a6a14","tarball":"https://registry.npmjs.org/@codespar/mcp-malga/-/mcp-malga-0.1.0.tgz","fileCount":6,"unpackedSize":100275,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCzP20WP10HKSw93DlOGZTLnyHrtyLV/6M+dztOKAmZMQIhAKRwNkPRUGDr+IMjV54CAKKm4lqXgT4kY5roPyDS3yzn"}]},"_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-malga_0.1.0_1786301099474_0.7421420039325042"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T18:44:59.357Z","0.1.0":"2026-08-09T18:44:59.617Z","modified":"2026-08-09T18:44:59.824Z"},"maintainers":[{"name":"codespar-npm","email":"fabiano@codespar.dev"},{"name":"dangazineu","email":"daniel.gazineu@gmail.com"}],"description":"MCP server for Malga — Brazilian payments API","keywords":["mcp","malga","payments","pix","boleto","brazil"],"license":"MIT","readme":"# @codespar/mcp-malga\n\n> MCP server for **Malga** — Brazilian payments orchestration with credit card, Pix, boleto, and voucher\n\n[![npm](https://img.shields.io/npm/v/@codespar/mcp-malga)](https://www.npmjs.com/package/@codespar/mcp-malga)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n## What is Malga?\n\n**Malga** is a Brazilian payments orchestration platform. It exposes a single API across multiple acquirers (Cielo, Rede, Stone, Adyen) covering charges (credit card, Pix, boleto, voucher), capture and refund, customers, saved cards and tokenization, merchants (sub-accounts), webhooks, and checkout sessions (1:1 and 1:N payment links).\n\nThis MCP server wraps the Malga REST API so AI agents can operate payments end-to-end in sandbox or production.\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to `~/.config/claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"malga\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codespar/mcp-malga\"],\n      \"env\": {\n        \"MALGA_CLIENT_ID\": \"your-client-id\",\n        \"MALGA_API_KEY\": \"your-api-key\",\n        \"MALGA_SANDBOX\": \"true\"\n      }\n    }\n  }\n}\n```\n\n### Claude Code\n\n```bash\nclaude mcp add malga -- npx @codespar/mcp-malga\n```\n\n### Cursor / VS Code\n\nAdd to `.cursor/mcp.json` or `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"malga\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codespar/mcp-malga\"],\n      \"env\": {\n        \"MALGA_CLIENT_ID\": \"your-client-id\",\n        \"MALGA_API_KEY\": \"your-api-key\",\n        \"MALGA_SANDBOX\": \"true\"\n      }\n    }\n  }\n}\n```\n\n## Tools (24)\n\n### Charges\n\n| Tool | Purpose |\n|---|---|\n| `create_charge` | Create a charge (credit card, Pix, boleto, or voucher). `capture` defaults to `false` (pre-authorization) |\n| `get_charge` | Get charge details by ID |\n| `list_charges` | List charges with optional filters and pagination |\n| `capture_charge` | Capture a pre-authorized charge |\n| `refund_charge` | Refund a charge (full or partial) |\n\n### Customers\n\n| Tool | Purpose |\n|---|---|\n| `create_customer` | Create a customer for charges and saved cards |\n| `get_customer` | Get customer details by ID |\n| `list_customers` | List customers with optional pagination |\n\n### Cards / Tokens\n\n| Tool | Purpose |\n|---|---|\n| `create_card` | Tokenize and save a card for a customer |\n| `get_card` | Get card details by ID |\n| `list_customer_cards` | List saved cards for a customer |\n| `create_token` | Create a card token for one-time use |\n\n### Merchants\n\n| Tool | Purpose |\n|---|---|\n| `get_merchant` | Get merchant details by ID |\n| `list_merchants` | List merchants |\n\n### Webhooks\n\n| Tool | Purpose |\n|---|---|\n| `create_webhook` | Register a webhook endpoint |\n| `list_webhooks` | List registered webhooks |\n\n### Sessions\n\n| Tool | Purpose |\n|---|---|\n| `create_session` | Create a checkout session for deferred payment |\n| `get_session` | Get session details and status |\n| `pay_session` | Pay an existing session with a payment method |\n| `cancel_session` | Cancel a pending payment session |\n\n### Settings (payment link branding)\n\n| Tool | Purpose |\n|---|---|\n| `get_settings` | Get payment link branding settings (client or merchant) |\n| `create_settings` | Create payment link branding (colors, logo, company URL) |\n| `update_settings` | Update payment link branding settings |\n\n### Sandbox\n\n| Tool | Purpose |\n|---|---|\n| `get_sandbox_guide` | Return sandbox simulation rules (card, CVV, capture/refund) |\n\n## Payment link settings\n\nCustomize checkout/payment link appearance via `GET/POST/PATCH /v1/settings`:\n\n- **Scope:** client-wide by default, or per merchant with `merchantId` (`X-Merchant-Id` header).\n- **GET:** with `merchantId`, returns merchant config or falls back to client default.\n- **POST/PATCH:** exact scope only (no fallback).\n- **Branding fields:** `mainColor`, `secondaryColor`, `attentionColor`, `errorColor`, `successColor`, `backgroundColor`, `companyUrl`, `mastercardClickToPayDpaid`, and optional logo.\n- **Logo upload:** pass `logoBase64` + `logoFilename` (.png/.jpg, max 1000px).\n- **PATCH:** empty strings are ignored; API returns `422` if no effective fields are sent.\n\nReference: [Malga Settings API](https://docs.malga.io/api-reference/settings/recuperar-configuracao-de-link-de-pagamento)\n\n## Authentication\n\nMalga uses two headers on every request:\n\n- `X-Client-Id` — your Malga client ID\n- `X-Api-Key` — your Malga API key\n\nGenerate credentials from the Malga dashboard.\n\n## Sandbox / Testing\n\nDefaults to sandbox (`https://sandbox-api.malga.io`). Set `MALGA_SANDBOX=false` for production (`https://api.malga.io`).\n\n### Get your credentials\n\n1. Go to [Malga](https://malga.io)\n2. Create a sandbox account\n3. Copy your **Client ID** and **API Key** from the dashboard\n4. Set `MALGA_CLIENT_ID` and `MALGA_API_KEY`\n\n### Sandbox / Simulation Rules\n\nThis server embeds sandbox hints in tool schemas. You can also call `get_sandbox_guide` to retrieve the full rules as JSON.\n\n#### Card number (last digit)\n\n| Last digit | Authorized? | Status |\n| --- | --- | --- |\n| 0, 1 or 4 | Yes | Approved |\n| 2 | No | Not authorized |\n| 3 | No | Expired card |\n| 5 | No | Blocked card |\n| 6 | No | Timeout |\n| 7 | No | Canceled card |\n| 8 | Random | Approved / Timeout |\n\nUse any test card number from a card generator; the last digit controls the outcome.\n\n#### CVV (tokenization and saved cards)\n\n| CVV last digit | Result |\n| --- | --- |\n| 0 | Validated |\n| Any other | Not validated |\n\n#### Capture and refund failure\n\nUse `amount: 991` (cents) in `capture_charge` or `refund_charge` to simulate failure.\n\nReference: [Malga testing guide](https://docs.malga.io/documentations/welcome/testing)\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `MALGA_CLIENT_ID` | Yes | Client ID from Malga dashboard |\n| `MALGA_API_KEY` | Yes | API key from Malga dashboard |\n| `MALGA_SANDBOX` | No | Defaults to sandbox; set to `\"false\"` for production |\n\n## Links\n\n- [Malga Website](https://malga.io)\n- [Malga API Documentation](https://docs.malga.io)\n- [MCP Dev LATAM](https://github.com/codespar/mcp-dev-latam)\n- [Landing Page](https://codespar.dev/mcp)\n\n## Enterprise\n\nNeed governance, budget limits, and audit trails for agent payments? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-95d073ab119a177a8c0f2b715d10fcd7"}