Skip to main content
AF

AFIP

v0.2.0-alpha.2API Keyalpha

Facturación electrónica argentina vía web services de AFIP. Tu agente emite facturas, notas de crédito y valida CUIT/CUIL.

20 herramientas3 env vars🇦🇷 Argentinaalpha — validación pendiente

Qué puede hacer tu agente

AFIP le da a tu agente 20 tools que llama directo — elegí las que necesite, en Claude, Cursor o cualquier cliente MCP.

  • create_invoiceCreate an electronic invoice (Factura Electrónica) via AFIP
  • get_invoiceGet invoice details by type, point of sale, and number
  • get_last_invoice_numberGet last authorized invoice number for a point of sale and type
Ejemplo de llamada
// Your agent calls a tool directly — no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_invoice", { /* ... */ });

Instalar

terminal
$ npm install @codespar/mcp-afip@alpha

Quickstart

Agregá esta entrada a tu claude_desktop_config.json (o a la config de cualquier cliente compatible con MCP).

claude_desktop_config.json
{
  "mcpServers": {
    "afip": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-afip@alpha"
      ],
      "env": {
        "AFIP_CERT_PATH": "<your_afip_cert_path>",
        "AFIP_KEY_PATH": "<your_afip_key_path>",
        "AFIP_CUIT": "<your_afip_cuit>"
      }
    }
  }
}

Después de reiniciar, tu agente puede llamar cualquiera de las 20 herramientas de abajo — probá create_invoice primero.

Variables de entorno · 3

Necesarias para autenticar el server. Almacenadas cifradas al usar el hosting gestionado de CodeSpar.

AFIP_CERT_PATH
obligatorio

Path to AFIP certificate (.crt)

AFIP_KEY_PATH
obligatoriosecret

Path to AFIP private key (.key)

AFIP_CUIT
obligatorio

CUIT number

Herramientas disponibles · 20

Cada herramienta es independiente — tu agente carga solo lo que necesita para reducir contexto y tiempo de respuesta.

WRITEcreate_invoice
Create an electronic invoice (Factura Electrónica) via AFIP
READget_invoice
Get invoice details by type, point of sale, and number
READget_last_invoice_number
Get last authorized invoice number for a point of sale and type
READget_cae_status
Check CAE authorization status for an invoice
READlist_invoice_types
List available invoice types (Factura A, B, C, etc.)
READlist_tax_types
List available tax types (IVA, percepciones, retenciones, etc.)
READget_server_status
Check AFIP web-service availability (WSFE status)
WRITEget_authorized_points_of_sale
List authorized puntos de venta for the CUIT

Frameworks compatibles

MCP es un protocolo — cualquier framework que lo hable puede montar este server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Cualquier cliente MCPProtocolo

Preguntas frecuentes

Corré `npx -y @codespar/mcp-afip` y agregá el bloque de config de arriba a tu cliente MCP — Claude, Cursor, VS Code o cualquier cliente compatible con MCP. Sin build, sin SDK. ¿Preferís hosted? El tier gestionado de CodeSpar lo corre por vos, con la auth resuelta.
AFIP — MCP server · 20 tools | CodeSpar