hacienda-mcp
v0.13.0MCP Server for Costa Rica electronic invoicing (AI-accessible tools)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_invoice
Create a Factura Electronica (electronic invoice) for Costa Rica. Accepts emisor, receptor, and line items. Automatically computes taxes, totals, generates the clave numerica, and builds the XML. Returns the unsigned XML string.
| Parameter | Type | Description |
|---|---|---|
codigoActividadEmisor * | string | Issuer economic activity code (6 digits) |
emisor * | object | |
lineItems * | array | Invoice line items (at least one required) |
proveedorSistemas * | string | Actual invoicing-system provider identification number (ProveedorSistemas) |
receptor * | object | |
condicionVenta | string | Sale condition code: "01"=Cash, "02"=Credit, etc. Defaults to "01" |
environment | string | |
medioPago | string | Payment method: "01"=Cash, "02"=Card, "04"=Transfer, "06"=SINPE Movil. Defaults to "01" |
plazoCredito | string | Credit term in days (required when condicionVenta is 02) |
check_status
Check the processing status of an electronic document by its 50-digit clave numerica. Returns the current status from Hacienda (recibido, procesando, aceptado, rechazado). Requires a configured profile (run `hacienda auth login` first).
| Parameter | Type | Description |
|---|---|---|
clave * | string | The 50-digit clave numerica of the document to check |
profile | string | Config profile name (default: "default") |
list_documents
Read one bounded page of observed Hacienda metadata, optionally filtered by combined domestic emisor/receptor. No date filters, status/XML, inferred totals or complete-history claim.
| Parameter | Type | Description |
|---|---|---|
emisor | string | |
limit | integer | |
offset | integer | |
profile | string | |
receptor | string |
get_document
Get observed document metadata by its current 50-character clave. Returns observed metadata and credit/debit references only, without status or XML. Use check_status separately. Requires a configured profile (run `hacienda auth login` first).
| Parameter | Type | Description |
|---|---|---|
clave * | string | The current 50-character clave of the document metadata to retrieve |
profile | string | Config profile name (default: "default") |
lookup_taxpayer
Look up a Costa Rica taxpayer by their identification number (cedula). Returns the taxpayer name, identification type, and registered economic activities. Useful for validating a receptor before creating an invoice.
| Parameter | Type | Description |
|---|---|---|
identificacion * | string | Taxpayer identification number (9-12 digits or a 10-character alphanumeric legal entity ID) |
draft_invoice
Generate a draft invoice template with sensible defaults for Costa Rica electronic invoicing. Use this to quickly scaffold an invoice that can then be reviewed and submitted. Returns a JSON template that can be passed to create_invoice.
| Parameter | Type | Description |
|---|---|---|
emisorEmail * | string | Issuer email address |
emisorIdNumero * | string | Issuer identification number |
emisorNombre * | string | Issuer (emisor) name |
receptorNombre * | string | Receiver (receptor) name |
amount | number | Default line item amount (price). Set to 0 to leave as placeholder |
codigoActividadEmisor | string | Issuer economic activity code (6 digits). Defaults to 620100 (IT services) |
description | string | Default line item description |
emisorIdTipo | string | Issuer ID type: "01"=Fisica, "02"=Juridica, "03"=DIMEX, "04"=NITE. Defaults to "02" |
includeIva | boolean | Whether to include 13% IVA tax. Defaults to true |
receptorEmail | string | Receiver email address (optional) |
receptorIdNumero | string | Receiver identification number (optional) |
receptorIdTipo | string | Receiver ID type (optional): "01"=Fisica, "02"=Juridica, "03"=DIMEX, "04"=NITE |