Skip to main content
AF

AFIP

v0.2.0-alpha.2API Keyalpha

Argentine electronic invoicing via AFIP web services. Your agent issues facturas, notas de credito, and validates CUIT/CUIL.

20 tools3 env vars🇦🇷 Argentinaalpha — pending validation

What your agent can do

AFIP gives your agent 20 tools it calls directly — pick the ones it needs, in Claude, Cursor, or any MCP client.

  • 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
Example call
// 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", { /* ... */ });

Install

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

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

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>"
      }
    }
  }
}

After restart, your agent can call any of the 20 tools below — try create_invoice first.

Environment variables · 3

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

AFIP_CERT_PATH
required

Path to AFIP certificate (.crt)

AFIP_KEY_PATH
requiredsecret

Path to AFIP private key (.key)

AFIP_CUIT
required

CUIT number

Available tools · 20

Each tool is independent — your agent loads only what it needs to reduce context and response time.

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

Compatible frameworks

MCP is a protocol — any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

Run `npx -y @codespar/mcp-afip` and add the config block above to your MCP client — Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
AFIP — MCP server · 20 tools | CodeSpar