mcpField
M
mcp-facturapi

mcp-facturapi

Local
github.com/codesparFinance275Updated 4w ago

About mcp-facturapi

mcp-facturapi is an MCP server for FacturAPI, a Mexican CFDI e-invoicing platform. It supports issuing, cancelling and emailing invoices, and managing customers and products. The server runs over both stdio and HTTP transports.

Key features

  1. 01CFDI invoice creation, lookup and cancellation
  2. 02PDF and XML invoice download links
  3. 03Invoice delivery by email
  4. 04Customer and product create, read, update and delete
  5. 05Receipt creation and listing

Use cases

  1. 01Issuing CFDI invoices for Mexican customers from an AI agent
  2. 02Listing invoices and retrieving PDF or XML files
  3. 03Maintaining customer and product records used for invoicing

MCP support

The server exposes 20 tools over MCP that call FacturAPI's invoice, customer, product and receipt endpoints.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-facturapi": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-facturapi"
],
"env": {
"FACTURAPI_API_KEY": "<FACTURAPI_API_KEY>"
}
}
}
}
Run commandnpx -y @codespar/mcp-facturapi
Environment variables to set
FACTURAPI_API_KEYSecretAPI key for FacturAPI

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-facturapi0.2.2

Tools

20

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
usestringNoCFDI use code (e.g. G01=acquisition, G03=expenses, P01=to_be_defined)
itemsarrayYesInvoice line items
seriesstringNoInvoice series
customerstringYesCustomer ID
folio_numbernumberNoInvoice folio number
payment_formstringYesSAT payment form code (e.g. 01=cash, 03=transfer, 04=credit_card)
payment_methodstringNoPUE (single payment) or PPD (deferred)

Details

From the project README

MCP FacturAPI

MCP server for FacturAPI — Mexican CFDI e-invoicing platform (equivalent to Brazil's NFe).

Quick Start

# Set your API key
export FACTURAPI_API_KEY="sk_..."

# Run via stdio
npx tsx packages/mexico/facturapi/src/index.ts

# Run via HTTP
npx tsx packages/mexico/facturapi/src/index.ts --http

Environment Variables

VariableRequiredDescription
FACTURAPI_API_KEYYesAPI key from FacturAPI dashboard
MCP_HTTPNoSet to "true" to enable HTTP transport
MCP_PORTNoHTTP port (default: 3000)

Tools (20)

ToolPurpose
create_invoiceCreate a CFDI invoice
get_invoiceGet invoice by ID
list_invoicesList invoices with filters
cancel_invoiceCancel an invoice
download_invoice_pdfDownload invoice as PDF (returns download URL)
download_invoice_xmlDownload invoice as XML (returns download URL)
send_invoice_emailSend invoice (PDF + XML) by email to the customer or to specific recipients
create_customerCreate a customer for invoicing
get_customerGet customer by ID
list_customersList customers with optional filters
update_customerUpdate an existing customer (partial update)
delete_customerDelete a customer
create_productCreate a product for invoicing
get_productGet product by ID
list_productsList products
update_productUpdate an existing product (partial update)
delete_productDelete a product
create_receiptCreate a receipt (recibo de venta) — the customer can later self-invoice it from the receipt's folio
list_receiptsList receipts with filters
list_webhooksList configured webhooks

Auth

Uses Bearer token authentication. Obtain your API key from the FacturAPI Dashboard.

API Reference


Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

Authentication

Set these environment variables before launching the server:

  • FACTURAPI_API_KEY (required, secret) — API key for FacturAPI

Issue credentials at the provider's developer portal: https://docs.facturapi.io.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.