facturapi-mcp
v1.0.0
Published
MCP Server for FacturAPI - Mexican Electronic Invoicing (CFDI 4.0). Create, manage, and cancel invoices with AI assistants.
Maintainers
Readme
FacturAPI MCP Server
Connect AI assistants (Claude, Cursor, Windsurf) to Mexican electronic invoicing (CFDI 4.0) via FacturAPI.
Create, manage, and cancel invoices using natural language.
Instead of navigating dashboards and filling forms, just tell your AI:
"Genera una factura para Juan Perez, RFC PEPJ850101ABC, por $5,000 MXN por servicios de consultoría, pagada por transferencia electrónica"
The MCP server handles the rest — SAT-compliant CFDI creation, PDF/XML generation, email delivery, and cancellation.
Features
- Create invoices — Full CFDI 4.0 with customer, items, taxes, and SAT catalog codes
- Cancel invoices — SAT-compliant cancellation with proper motives
- List and search — Find invoices by date, customer, status, or keyword
- Download PDF/XML — Get the stamped CFDI files
- Send by email — Deliver invoices directly to customers
- Manage customers — Create, update, list, and search customers
- Manage products — Register products/services with SAT codes
- Payment receipts — Create Complemento de Pago for installment payments
- SAT catalogs — Look up payment forms, CFDI uses, tax systems, and cancellation motives
15 Tools Available
| Tool | Description |
|---|---|
| create_invoice | Create a new CFDI electronic invoice |
| list_invoices | List invoices with filters (date, status, customer) |
| get_invoice | Get detailed info about a specific invoice |
| cancel_invoice | Cancel an invoice with SAT-compliant motive |
| download_invoice | Download invoice as PDF or XML |
| send_invoice_email | Send invoice to customer by email |
| create_customer | Register a new customer (RFC, name, address) |
| list_customers | List and search customers |
| update_customer | Update customer information |
| create_product | Register a product/service with SAT codes |
| list_products | List registered products |
| create_payment_receipt | Create Complemento de Pago |
| sat_catalogs | Look up SAT catalog codes |
| get_organization | Get your business info |
Quick Start
1. Get your FacturAPI key
- Go to dashboard.facturapi.io
- Sign up (free sandbox account available)
- Copy your API key from Settings
2. Install
npm install facturapi-mcp3. Configure with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"facturapi": {
"command": "npx",
"args": ["facturapi-mcp"],
"env": {
"FACTURAPI_API_KEY": "sk_test_your_key_here"
}
}
}
}4. Use it
Open Claude and start invoicing:
- "Show me all my invoices from this month"
- "Create an invoice for ABC Company, RFC ABC010101XYZ, for $10,000 MXN consulting services, paid by wire transfer"
- "Cancel invoice [ID] because the operation was not carried out"
- "Download the PDF of invoice [ID]"
- "What payment form codes are available?"
- "List my customers"
Configuration for Other AI Tools
Cursor
Add to your Cursor MCP settings:
{
"facturapi": {
"command": "npx",
"args": ["facturapi-mcp"],
"env": {
"FACTURAPI_API_KEY": "sk_test_your_key_here"
}
}
}Claude Code
export FACTURAPI_API_KEY=sk_test_your_key_here
claude mcp add facturapi npx facturapi-mcpSAT Catalog Quick Reference
Common Payment Forms
| Code | Description | |---|---| | 01 | Efectivo (Cash) | | 03 | Transferencia electrónica (Wire transfer) | | 04 | Tarjeta de crédito (Credit card) | | 28 | Tarjeta de débito (Debit card) | | 99 | Por definir (To be defined) |
Common Tax Systems
| Code | Description | |---|---| | 601 | General de Ley Personas Morales | | 612 | Personas Físicas con Actividades Empresariales | | 626 | Régimen Simplificado de Confianza (RESICO) |
Common CFDI Uses
| Code | Description | |---|---| | G01 | Adquisición de mercancías | | G03 | Gastos en general | | S01 | Sin efectos fiscales |
Common Product Keys (Clave SAT)
| Code | Description | |---|---| | 80161500 | Servicios de consultoría de negocios | | 43232408 | Software as a Service (SaaS) | | 80111600 | Servicios de personal temporal | | 82111500 | Publicidad | | 81112100 | Servicios de diseño de software |
Development
# Clone
git clone <repo>
cd facturapi-mcp
# Install
npm install
# Development
FACTURAPI_API_KEY=sk_test_xxx npm run dev
# Build
npm run build
# Type check
npm run checkEnvironment Variables
| Variable | Required | Description |
|---|---|---|
| FACTURAPI_API_KEY | Yes | Your FacturAPI API key (starts with sk_test_ for sandbox or sk_live_ for production) |
Pricing
- Free: 10 invoices/month, read-only queries
- Pro ($19/mo): Unlimited invoices, bulk operations, customer management
- Business ($39/mo): Multi-RFC support, automated recurring invoices, analytics
License
MIT
