Argentina Invoice MCP 🇦🇷 — How can my AI agent issue a factura electrónica (CAE) in Argentina?
Use it in 60 seconds
Paste this into your MCP client config (Claude Desktop, Cursor, Windsurf, or any MCP-capable agent):
{
"mcpServers": {
"argentina-invoice": {
"type": "http",
"url": "https://inv-ar.wishpool.app/mcp"
}
}
}
Nothing to install. Credentials, when you need them, travel as HTTP headers on each request and are never stored — see the threat model.
Or run it yourself
Would you rather not send production credentials to a server you do not control? Deploy this identical code to your own account and point your agent at your own URL:
git clone https://github.com/junter1989k-ai/argentina-invoice-mcp && cd argentina-invoice-mcp && npx vercel --prod
MIT-licensed. Self-hosting removes us from the picture entirely, at no cost and with no loss of function.
Remote MCP server that lets any AI agent issue Argentina AFIP/ARCA electronic invoices (factura electrónica) — authorizing the invoice via WSFE to get the CAE (Código de Autorización Electrónico) plus its expiry — through the Afip SDK. Stateless, bring-your-own credentials, never stores anything.
Live endpoint: https://inv-ar.wishpool.app/mcp · Registry: app.wishpool/argentina-invoice-mcp
Quick start
{
"mcpServers": {
"argentina-invoice": {
"type": "http",
"url": "https://inv-ar.wishpool.app/mcp",
"headers": {
"x-afipsdk-token": "your-afip-sdk-access-token",
"x-afip-mode": "dev"
}
}
}
}
Sign up free at app.afipsdk.com for an access_token (1000 requests/month). In dev mode no AFIP certificate is needed — the test CUIT 20409378472 works out of the box. Switch x-afip-mode to prod and pass your AFIP X.509 certificate + key per-request (afip_cert / afip_key) to authorize real invoices.
Headers
| Header | Purpose |
|---|---|
x-afipsdk-token | Required. Your Afip SDK access_token (Bearer). Sign up at app.afipsdk.com. |
x-afip-mode | dev (default, AFIP homologación — no certificate) or prod. |
x-afip-cuit | Issuer CUIT, 11 digits. Defaults to the test CUIT 20409378472 in dev. |
Certificates (prod) — never stored, never logged
In prod mode, pass your own AFIP X.509 certificate and private key as per-request tool params afip_cert and afip_key (PEM strings). They are forwarded to the Afip SDK for that single request only and are never stored, logged, or persisted — sensitive material exists only for the request lifecycle. This mirrors the Afip SDK's own per-request certificate design.
Tools
| Tool | What it does |
|---|---|
create_invoice | Authorize a factura electrónica at AFIP/ARCA (WSFE FECAESolicitar) and get the cae (+ cae_expiry, invoice_number). You send flat fields (invoice_type, point_of_sale, customer doc, line items with net_price + iva_rate); the server computes the WSFE amounts — per-line net, IVA grouped into the AlicIva array, ImpNeto / ImpIVA / ImpTotal. The next invoice number is fetched automatically unless you pass invoice_number. |
query_invoice | Status check by number (WSFE FECompConsultar): cae, cae_expiry, total, Resultado (A = authorized). |
get_last_invoice_number | Last authorized number (WSFE FECompUltimoAutorizado) for a point of sale + type — next_number is this + 1. |
Owner policy guardrails ride optional headers (x-agentpay-max-amount, x-agentpay-approval-above, x-agentpay-allowed-tools) — set by the human owner in client config; the agent cannot relax them. The amount cap/threshold applies to the invoice total (ARS).
IVA / factura types (computed for you)
- Factura A (CbteTipo 1) and Factura B (CbteTipo 6) discriminate IVA: line items are grouped by alícuota (
0,10.5,21,27%) into theAlicIvaarray;ImpNeto,ImpIVAandImpTotalare computed and reconciled. - Factura C (CbteTipo 11, monotributo) does not discriminate IVA:
ImpTotal = ImpNeto,ImpIVA = 0, noAlicIva.
Example: one line net_price 100 × 1 @ 21% on a Factura B → ImpNeto 100, ImpIVA 21, ImpTotal 121 (AlicIva Id 5). The same line at 10.5% → ImpIVA 10.5; at 27% → ImpIVA 27.
There is no WSFE cancel operation in Argentina — to reverse an invoice, issue a nota de crédito (credit note) for the same amount.
Develop
node test/serve.js # local server on :3242
node test/e2e.js # protocol + IVA math unit check (A/B/C) + validation + policy + fake-token live probe
Safety
Pure stateless translation layer. The AFIP/ARCA WSAA + WSFE certification burden sits with the Afip SDK; the access_token and (in prod) the AFIP certificate + key travel per-request in headers/params, nothing is stored. Privacy policy.
Sister servers
Mexico CFDI 4.0 e-invoices are live: inv-mx.wishpool.app. India GST e-invoices: inv-in.wishpool.app. Local payments in 81 countries, one family: mcp.wishpool.app · Taiwan e-invoice 電子發票 included. More invoice countries coming: Brazil NF-e · Chile DTE · Peru CPE · Poland KSeF · Romania e-Factura · Italy SdI.
MIT licensed.