hacienda-mcp

v0.13.0
@dojocoding/hacienda-mcp Checked 2 days ago Published 1 month ago

MCP 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.

ParameterTypeDescription
codigoActividadEmisor *stringIssuer economic activity code (6 digits)
emisor *object
lineItems *arrayInvoice line items (at least one required)
proveedorSistemas *stringActual invoicing-system provider identification number (ProveedorSistemas)
receptor *object
condicionVentastringSale condition code: "01"=Cash, "02"=Credit, etc. Defaults to "01"
environmentstring
medioPagostringPayment method: "01"=Cash, "02"=Card, "04"=Transfer, "06"=SINPE Movil. Defaults to "01"
plazoCreditostringCredit 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).

ParameterTypeDescription
clave *stringThe 50-digit clave numerica of the document to check
profilestringConfig 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.

ParameterTypeDescription
emisorstring
limitinteger
offsetinteger
profilestring
receptorstring

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).

ParameterTypeDescription
clave *stringThe current 50-character clave of the document metadata to retrieve
profilestringConfig 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.

ParameterTypeDescription
identificacion *stringTaxpayer 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.

ParameterTypeDescription
emisorEmail *stringIssuer email address
emisorIdNumero *stringIssuer identification number
emisorNombre *stringIssuer (emisor) name
receptorNombre *stringReceiver (receptor) name
amountnumberDefault line item amount (price). Set to 0 to leave as placeholder
codigoActividadEmisorstringIssuer economic activity code (6 digits). Defaults to 620100 (IT services)
descriptionstringDefault line item description
emisorIdTipostringIssuer ID type: "01"=Fisica, "02"=Juridica, "03"=DIMEX, "04"=NITE. Defaults to "02"
includeIvabooleanWhether to include 13% IVA tax. Defaults to true
receptorEmailstringReceiver email address (optional)
receptorIdNumerostringReceiver identification number (optional)
receptorIdTipostringReceiver ID type (optional): "01"=Fisica, "02"=Juridica, "03"=DIMEX, "04"=NITE