keycae-mcp
v1.2.0
Published
MCP Server for KeyCAE - Argentine electronic invoicing (factura electrónica) with ARCA/AFIP. 12 tools for AI agents.
Maintainers
Readme
keycae-mcp 🔌
MCP Server for KeyCAE.ar — Argentine electronic invoicing (facturación electrónica) with ARCA/AFIP.
Let AI agents emit invoices, manage credentials, handle delegations, and more — directly from Claude, Cursor, Windsurf, or any MCP-compatible client.
⚡ Quick Start
npx keycae-mcpThat's it. Your AI agent now has 15 tools for Argentine invoicing.
☁️ Remote MCP Server (no installation required)
KeyCAE also exposes a Streamable HTTP MCP server — no npx, no local setup.
Endpoint: https://keycae.ar/v1/mcp
{
"mcpServers": {
"keycae-remote": {
"url": "https://keycae.ar/v1/mcp",
"headers": {
"Authorization": "Bearer sk_live_..."
}
}
}
}⚠️ Requisito: Delegación en ARCA
ANTES de facturar, debés delegar la facturación electrónica al representante de KeyCAE en ARCA:
- Ingresá a ARCA Clave Fiscal
- Buscá el servicio "Facturación Electrónica" (ws://wsfe)
- Delegá al CUIT representante: 20254459306 (Amilcar Waldemar Serra)
- Aceptá la relación de representación
Sin esta delegación, no podés emitir facturas. El MCP server te permite verificar el estado con check_delegation y solicitarla con request_delegation.
🔧 Configuration
The MCP server requires a KEYCAE_API_KEY to run. You can configure it with:
- Sandbox Mode (No registration needed): Use the public sandbox key
sk_test_public_sandbox_cuit_20999999999. Note that in Sandbox mode you must emit using CUIT20999999999. - Production Mode: Use your live API key
sk_live_...generated when registering on keycae.ar.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"keycae": {
"command": "npx",
"args": ["-y", "keycae-mcp"],
"env": {
"KEYCAE_API_KEY": "sk_test_public_sandbox_cuit_20999999999"
}
}
}
}Cursor / Windsurf
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"keycae": {
"command": "npx",
"args": ["-y", "keycae-mcp"],
"env": {
"KEYCAE_API_KEY": "sk_test_public_sandbox_cuit_20999999999"
}
}
}
}🛠️ Available Tools (13)
| Tool | Description |
|------|-------------|
| emit_invoice | Emitir factura (24 tipos: A/B/C/M/E + 5 NC + 5 ND + 9 FCE MiPyMEs). Soporta precios netos (iva_incluido), tributos, moneda extranjera y datos del emisor por comprobante (emisor_razon_social, emisor_ingresos_brutos, etc.) |
| get_invoice | Consultar factura por ID |
| list_invoices | Listar facturas recientes |
| get_sales_report | Reporte mensual de ventas para el contador (por tipo y alícuota; NC restan, ND suman) |
| list_credentials | Listar certificados digitales |
| create_credential | Generar RSA keypair + CSR para ARCA |
| check_delegation | Verificar delegación ARCA |
| request_delegation | Solicitar delegación ARCA |
| lookup_taxpayer | Buscar contribuyente por CUIT |
| check_emission_capability | Verificar qué tipos de factura puede emitir un CUIT |
| get_condiciones_iva | Tabla de 15 condiciones IVA del receptor (códigos oficiales ARCA) |
| get_billing_status | Estado del plan y consumo |
| list_puntos_de_venta | Listar puntos de venta habilitados |
| keycae_health | Health check de la API |
📖 Resources
The server also exposes a keycae://docs resource with inline documentation covering invoice types, common workflows, and ARCA/AFIP notes.
🔄 Workflow Típico
1. check_delegation → Verificar que el CUIT esté delegado
2. list_credentials → Verificar que el certificado esté activo
3. check_emission_capability → Saber qué tipos de factura puede emitir
4. emit_invoice → Emitir la factura
5. get_invoice → Consultar detalles📋 Tipos de Comprobante
| Tipo | Descripción | Quién emite | |------|-------------|-------------| | A | IVA discriminado | Responsable Inscripto → RI | | B | IVA incluido | RI → Consumidor Final | | C | Exento (sin IVA) | Monotributo / Exento | | M | Monotributo | Monotributista | | E | Exportación | Exportadores |
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| KEYCAE_API_KEY | ✅ | — | Your KeyCAE API key |
| KEYCAE_API_URL | ❌ | https://keycae.ar | API base URL |
Licencia
MIT
