# PatoCard MCP server

PatoCard's MCP server lets an AI agent work with a business's loyalty program:
look up a customer's card and stamps, list programs and rewards, and read the
statistics. It is a remote server (Streamable HTTP):

```
https://patocard.com/api/mcp
```

Every connection belongs to ONE business: the agent only ever sees that
business's data. The MCP is included in **every plan** (Startup and up).

## Connect

**claude.ai / Claude desktop (OAuth):** Settings → Connectors → Add custom
connector → paste `https://patocard.com/api/mcp`. Claude opens PatoCard's sign-in; the business
owner approves the connection. No key to copy.

**Claude Code (API key):** the owner creates a key in the PatoCard panel
(Ajustes → Integraciones) and runs:

```
claude mcp add --transport http patocard https://patocard.com/api/mcp --header "Authorization: Bearer pc_live_TU_LLAVE"
```

**Clients that take JSON (Cursor, etc.):**

```json
{
  "mcpServers": {
    "patocard": {
      "url": "https://patocard.com/api/mcp",
      "headers": {
        "Authorization": "Bearer pc_live_TU_LLAVE"
      }
    }
  }
}
```

**Clients that only speak stdio:**

```json
{
  "mcpServers": {
    "patocard": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://patocard.com/api/mcp",
        "--header",
        "Authorization: Bearer pc_live_TU_LLAVE"
      ]
    }
  }
}
```

OAuth metadata: `https://patocard.com/.well-known/oauth-protected-resource` and
`https://patocard.com/.well-known/oauth-authorization-server`.

## Tools

| Tool | What it does | Arguments |
|---|---|---|
| `mi_negocio` | De qué negocio es la llave, su alcance y los programas con metas y premios. La primera que llama un agente. | — |
| `programas` | Los programas de lealtad: mecánica, meta de sellos, premio y liga de alta. | — |
| `buscar_cliente` | Clientes por teléfono o email, con sus tarjetas y saldos. No hay búsqueda por nombre. | telefono o email |
| `cliente` | Un cliente por id, con sus tarjetas. | id |
| `tarjeta` | Una tarjeta por id: saldo, premios pendientes, si está en Wallet y últimas visitas. | id |
| `estadisticas` | Los números de 7, 30 o 90 días: clientes activos, sellos, premios, por programa y quiénes más vienen. | dias: 7 | 30 | 90 |

Start with `mi_negocio`: it says which business the connection belongs to
and its programs, goals and rewards.

## Things to ask it

- "¿Cuántos sellos le faltan a Ana (55 1234 5678) para su premio?"
- "How many active customers did we have in the last 30 days, by program?"
- "Who are my 10 most frequent customers this month?"
- "¿Qué premio da la tarjeta de Hot Bar y cuántos sellos pide?"

## No account yet?

A business without an account starts a free 14-day trial (no card) at
https://patocard.com/empezar — a human must accept the terms. Then the owner connects
the agent as above.

More: [REST API](https://patocard.com/docs/api.md) · [llms.txt](https://patocard.com/llms.txt) · hola@patocard.com
