Skip to main content
Glama
README.md
# pix-agent

**Pix for AI agents.** An MCP server that lets agents (Claude, ChatGPT, Cursor, your own bots) charge people by Pix, confirm payment, and send Pix, with the owner's spending rules in front of every payment.

- **Charge**: create a Pix "copia e cola" (and QR) and know when it's paid.
- **Send**: every payment is checked against your rules: sent, queued for your approval, or rejected.
- **You stay in control**: agents can't approve payments, raise limits or edit rules. Approval happens only in your owner channel (a CLI in v0.1).
- **Your own account**: pix-agent connects to your provider account (Asaas today). It never holds your money.

> **Unmaintained.** This is a finished v0.1 experiment, published as is and no longer developed. The Asaas adapter has been tested only against a fake server built from the docs, never the real API: validate it in the Asaas sandbox before trusting it with money. Fork freely.

## Quick start (mock mode, no account needed)

```bash
npm install
npm run build
node dist/cli.js init          # creates ~/.pix-agent/policy.json
```

Add it to your MCP client, e.g. Claude Code:

```bash
claude mcp add pix-agent -e PIX_PROVIDER=mock -- node /path/to/pix-agent/dist/server.js
```

Or Claude Desktop / Cursor (`mcpServers` config):

```json
{
  "mcpServers": {
    "pix-agent": {
      "command": "node",
      "args": ["/path/to/pix-agent/dist/server.js"],
      "env": { "PIX_PROVIDER": "mock" }
    }
  }
}
```

In mock mode, charges are real, valid static Pix codes for `PIX_RECEIVER_KEY` (paying one in a bank app sends real money to that key). Mark them paid with `node dist/cli.js simulate-pay <chargeId>`. Sends never move money.

## Tools

| Tool | What it does |
|---|---|
| `pix_create_charge` | Create a charge; returns copia e cola (+ QR image) |
| `pix_check_charge` | pending / paid / expired / cancelled |
| `pix_send` | Send a Pix through the owner's rules (use `idempotencyKey`) |
| `pix_payment_status` | pending_approval / processing / sent / failed / rejected |
| `pix_balance` | Provider balance, spent today, remaining daily limit |
| `pix_spending_rules` | Read-only view of the rules |
| `pix_list_activity` | Recent charges and payments |

## Spending rules

`~/.pix-agent/policy.json` (amounts in reais), read on every call:

```json
{
  "perPaymentLimit": 500,
  "dailyLimit": 1000,
  "autoApproveUpTo": 50,
  "requireApprovalForNewRecipients": true,
  "trustedKeys": ["fornecedor@example.com"],
  "blockedKeys": [],
  "allowlistOnly": false,
  "maxChargeAmount": 5000
}
```

Hard rules (blocked key, per-payment limit, daily limit, allowlist) reject and still apply after you approve. Soft rules (above auto-approve, first payment to a new recipient) queue the payment for you.

## Owner CLI

```bash
node dist/cli.js pending
node dist/cli.js approve <paymentId>
node dist/cli.js reject <paymentId> "reason"
node dist/cli.js log
node dist/cli.js summary
```

Keep the CLI out of your agent's reach: an agent with shell access on the same machine could run it.

## Asaas

```bash
PIX_PROVIDER=asaas ASAAS_ENV=sandbox ASAAS_API_KEY=... ASAAS_DEFAULT_CUSTOMER_ID=cus_... node dist/server.js
```

See `.env.example` for all settings.

## Development

`npm run verify` typechecks and runs the end-to-end suite (a real MCP client against the server and CLI, plus a fake Asaas server). Changes follow `changes/NNNN-*/{intent,spec,plan}.md`; see `CLAUDE.md`.

## License

MIT. See [LICENSE](LICENSE).

TDQS

A3.9/5.0

Scored across 7 tools

Disambiguation5/5

Each tool targets a distinct Pix operation: incoming charge creation/checking, outgoing payments/status, balance, spending rules, and activity listing. The charge-status vs payment-status distinction is explicitly clear.

Naming Consistency4/5

All tools use the same pix_ prefix and snake_case, which makes the set easy to scan. However, naming mixes verb-led actions (pix_create_charge, pix_check_charge, pix_send, pix_list_activity) with noun phrases (pix_balance, pix_spending_rules, pix_payment_status).

Tool Count5/5

Seven tools is well-scoped for a focused Pix payment agent. Each tool covers a meaningful operation without unnecessary surface area.

Completeness4/5

The core lifecycle is covered: create/check incoming charges, send/check outgoing payments, balance, rules, and activity. Minor gaps remain, such as explicit charge cancellation or refund handling, but core agent workflows are supported.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues