npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pagai/mcp

v0.1.1

Published

MCP server for Pagai — issue invoices, create payment links and check payments from Claude, Cursor or any MCP client

Readme

Pagai MCP server

Emite facturas, genera links de pago y revisa cobros desde Claude, ChatGPT, Cursor o cualquier cliente compatible con MCP.

Instalación

Se distribuye por npm. Necesitas Node.js 18+.

Claude Code / Cursor — un comando

claude mcp add pagai --env PAGAI_API_KEY=fai_tu_key -- npx -y @pagai/mcp

Claude Desktop y cualquier otro cliente MCP

Añade el bloque a la config de tu cliente. En Claude Desktop está en Configuración → Desarrollador → Editar configuración:

{
  "mcpServers": {
    "pagai": {
      "command": "npx",
      "args": ["-y", "@pagai/mcp"],
      "env": { "PAGAI_API_KEY": "fai_tu_key" }
    }
  }
}

Reinicia el cliente después de guardar.

Para desarrollo local, apunta al archivo en vez de a npm:

claude mcp add pagai --env PAGAI_API_KEY=fai_tu_key -- node /ruta/a/factur-ai/mcp/server/index.js

De dónde sale la API key

Dashboard de Pagai → Configuración → API keysCrear key. Se muestra una sola vez; si la pierdes, crea otra.

Los scopes por defecto no incluyen payments:write ni invoices:write. Si quieres usar mark_invoice_paid, marca esos scopes al crear la key. Si te falta uno, el error te dice exactamente cuál en details.required_scope.

Qué puedes pedirle

| Ejemplo | Herramienta | |---|---| | "Cóbrale $50.000 a [email protected] por el diseño web, vence en 30 días" | create_invoice | | "Mándame un link de pago por $30.000" | create_payment_link | | "¿Qué tengo por cobrar?" / "Muéstrame las vencidas" | list_invoices | | "¿Me pagó Juan?" | get_invoice_status | | "Juan me transfirió, márcala pagada" | mark_invoice_paid | | "Recuérdale a Juan que me pague" | send_reminder |

Son seis herramientas y no veinticinco a propósito: las definiciones se pagan en el contexto del modelo antes de que leas nada, y un catálogo grande empeora la elección de herramienta. Lo que falta (webhooks, carga masiva, DTE) se hace por la REST API, que es la superficie completa.

Seguridad

El servidor corre en tu máquina y habla HTTPS con la API de Pagai. No tiene acceso a la base de datos: puede hacer exactamente lo que permita tu API key, ni más. Para limitarlo, crea una key con menos scopes — por ejemplo solo invoices:read si quieres que el agente pueda consultar pero no emitir.

Los reintentos son seguros: el servidor genera un Idempotency-Key por operación, así que un timeout seguido de reintento no emite la factura dos veces.

Desarrollo

npm install
node server/index.js   # arranca en stdio
npm publish            # publica en npm (requiere 2FA o token con bypass)

Apunta a otro entorno con PAGAI_API_URL (por defecto https://api.pagai.cl/api/v1/external).

El contrato de errores está en docs/integration-errors.md: cada fallo trae un code estable y un retry, y el servidor los pasa tal cual al modelo.