mcp

v0.1.3
@pagai/mcp Checked 3 days ago Published 29 days ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_invoice Emitir factura

Issue an invoice and send it to the customer. Call this when the user wants to charge someone a specific amount for specific line items — 'cóbrale $50.000 a Juan por el diseño web'. The customer is matched by email (or phone when there is no email) and created if new. Returns a public payment URL to give back: with only a phone nothing is emailed, so the link is how they pay. For a quick charge with no itemisation, prefer create_payment_link. Identical requests within 24h are deduplicated and return the first result; to charge the same thing twice on purpose, set a different external_refer…

ParameterTypeDescription
customer_name *stringWho is being billed.
due_date *stringPayment deadline, YYYY-MM-DD. Ask the user if unclear rather than guessing — a wrong due date starts the dunning clock early.
items *arrayLine items. Prices are net: 19% IVA is added on top unless tax_inclusive is true.
currencystringISO code, CLP by default.
customer_emailstringMatches an existing customer, so use the real address. Email or phone is required.
customer_phonestringCustomer's phone, e.g. their WhatsApp number. Used when there is no email.
customer_rutstringChilean tax ID, if known.
document_kindstring'invoice' (factura, default), 'receipt' (boleta, for consumers) or 'quote' (cotización).
external_referencestringYour own order number, echoed back on webhooks so you can correlate.
skip_dtebooleanTrue to send it without a DTE (no SII tax document, not even when a quote gets paid): only when the user says so.
tax_inclusivebooleanTrue when the user's amounts already include IVA ('$50.000 IVA incluido'). Ask if unclear.

list_invoices Listar facturas

List invoices, most recent first. Call this for questions about what is outstanding — 'qué tengo por cobrar', 'muéstrame las facturas vencidas'. Filter with status: use 'overdue' for late invoices and 'sent' for issued-but-not-yet-paid ones. Use customer to answer '¿me pagó Juan?'.

ParameterTypeDescription
customerstringPart of the customer name, email or RUT, or their phone in any format.
limitintegerHow many to return, default 20.
statusstringOmit for all.

get_invoice_status Estado de una factura

Check whether a specific invoice was paid, and when. Call this for '¿me pagó Juan?' or before chasing someone, so you don't send a reminder for an invoice that is already settled.

ParameterTypeDescription
invoice_id *stringUUID returned by create_invoice or list_invoices.

mark_invoice_paid Marcar como pagada

Record a payment that happened outside Pagai, typically a bank transfer. Call this when the user says they already got paid — 'Juan me transfirió, márcala pagada'. This stops automated reminders. It does NOT move money; it only records that money arrived.

ParameterTypeDescription
invoice_id *string
notesstringFree-text reference, e.g. the transfer number.
payment_methodstringHow it was paid, e.g. 'bank_transfer', 'cash'.

send_reminder Enviar recordatorio

Email a payment reminder for an unpaid invoice. Call this when the user wants to chase a specific customer — 'recuérdale a Juan que me pague'. Check get_invoice_status first: reminding someone who already paid is worse than not reminding at all.

ParameterTypeDescription
invoice_id *string
custom_messagestringOptional note added to the reminder email.

cancel_invoice Anular documento

Cancel an unpaid invoice so it can no longer be paid and reminders stop — 'anula la factura de Pedro, era un error'. Drafts are deleted. Paid invoices, or ones with an accepted SII document, cannot be cancelled: the error says why. Confirm with the user first; this cannot be undone.

ParameterTypeDescription
invoice_id *string
reasonstringWhy it is being cancelled; kept in the audit log.

find_clients Buscar clientes

Search the merchant's customers by name, email, phone or RUT — 'cuál es el correo de Pedro', or to get a client_id for update_client. Omit query to list them alphabetically.

ParameterTypeDescription
limitintegerDefault 20.
querystringPart of the name, email, phone or RUT.

update_client Editar cliente

Change a customer's details — 'el correo de Pedro ahora es pedro@nuevo.cl'. Only the fields you pass change. Get client_id from find_clients.

ParameterTypeDescription
client_id *string
addressstring
emailstring
namestring
phonestring
rutstring