Skip to main content
AF

AFIP

v0.2.0-alpha.1API 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

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

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets β€” it receives scoped, short-lived session tokens.
Servers β€” Every LatAm commerce API your agent needs | CodeSpar