# mcp-afip

Connects AI coding tools to Argentina's AFIP tax web services for electronic invoicing and CAE authorization. Helpful when automating Argentine billing routines.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/argentina/afip
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-afip

## What it does

This server exposes 20 tools allowing an assistant to communicate directly with AFIP services. It handles Factura Electrónica generation, queries last invoice numbers, checks CAE authorization codes, and sends batch submissions of up to 250 records.

Under the hood, it abstracts AFIP's SOAP and WSAA certificate authentication into clean tool calls. Connecting requires an official `.crt` certificate, a private `.key` file, and a taxpayer CUIT. By default, queries run against the homologation test environment.

Because endpoint paths are not fully live-tested in this alpha stage, pinning exact package versions avoids unexpected breaks. Transport works over stdio or HTTP via port 3000.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `AFIP_CERT_PATH`, `AFIP_KEY_PATH`, `AFIP_CUIT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-afip -e AFIP_CERT_PATH=<AFIP_CERT_PATH> -e AFIP_KEY_PATH=<AFIP_KEY_PATH> -e AFIP_CUIT=<AFIP_CUIT> -- npx -y @codespar/mcp-afip
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add afip --env AFIP_CERT_PATH=<AFIP_CERT_PATH> --env AFIP_KEY_PATH=<AFIP_KEY_PATH> --env AFIP_CUIT=<AFIP_CUIT> -- npx -y @codespar/mcp-afip
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "afip": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-afip"
            ],
            "env": {
                "AFIP_CERT_PATH": "<AFIP_CERT_PATH>",
                "AFIP_KEY_PATH": "<AFIP_KEY_PATH>",
                "AFIP_CUIT": "<AFIP_CUIT>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "afip": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-afip"
            ],
            "env": {
                "AFIP_CERT_PATH": "<AFIP_CERT_PATH>",
                "AFIP_KEY_PATH": "<AFIP_KEY_PATH>",
                "AFIP_CUIT": "<AFIP_CUIT>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e AFIP_CERT_PATH=<AFIP_CERT_PATH> -e AFIP_KEY_PATH=<AFIP_KEY_PATH> -e AFIP_CUIT=<AFIP_CUIT> afip npx -y @codespar/mcp-afip
```
Replace <…> with your own values

## When to use it
- issue electronic invoices with CAE authorization numbers
- look up taxpayer fiscal details using CUIT in Padrón
- generate debit or credit notes tied to past invoices
- submit batch invoice requests up to 250 items at once

## Example prompts
- Look up taxpayer information in the Padrón for CUIT 20123456789
- Create a type B invoice for a final consumer and request the CAE
- Fetch the last authorized invoice number for point of sale 1

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
