Afip

Finance and commerce

AFIP, Argentine tax authority, electronic invoicing (Factura Electrónica).

Your AI app calls the Afip MCP server, which does the finance and commerce work and sends the result back to the chat.

About Afip

Afip is a community MCP server from codespar, filed in our directory under finance and commerce. AFIP, Argentine tax authority, electronic invoicing (Factura Electrónica).

Afip runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-afip@0.2.0-alpha.3 and talks to it over standard input and output. It needs AFIP_CERT_PATH, AFIP_KEY_PATH and AFIP_CUIT set before Afip starts.

Afip is listed in the official MCP registry as io.github.codespar/mcp-afip, version 0.2.0-alpha.3.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-afip
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-afip

How to set up Afip

  1. Install Node.js on the machine that runs your AI app, because Afip starts with npx and downloads its package on first run.
  2. Create AFIP_CERT_PATH, AFIP_KEY_PATH and AFIP_CUIT for Afip in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Afip to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Afip tools to confirm the connection.
  5. Run one read-only task with Afip first, and keep your app asking before each tool call until the results look right.

Afip compared with similar servers

  • Airwallex by codespar has fewer GitHub stars than Afip (278 against 278); both are community servers, and both run locally.
  • Adyen by codespar has fewer GitHub stars than Afip (278 against 278); both are community servers, and both run locally.
  • Alegra by codespar has fewer GitHub stars than Afip (278 against 278); both are community servers, and both run locally.

Before you connect Afip

  • Give Afip its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Afip tool call until you trust what it does with them.
  • Treat text that Afip fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Afip on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Afip

How marketing and sales teams put Afip to work, by company size. Pick the size closest to yours and start Afip on one use case.

Small business

  • A small business can ask Afip which products and customers drive margin, then plan promotions around them.
  • Owners can use Afip to check refunds, failed payments and churn reasons without opening three dashboards.
  • Afip runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Afip to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Afip to check spend against budget each week and move money to what's working.
  • Start Afip on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Afip read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Afip to answer revenue questions by channel and region with figures finance signs off on.
  • Afip is a community server, so have security review the code and pin a version before Afip touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Afip README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@codespar/mcp-afip

MCP server for AFIP, the Argentine tax authority (Administracion Federal de Ingresos Publicos), for electronic invoicing (Factura Electronica) with CAE authorization

Alpha release, published under the alpha npm dist-tag. Endpoint paths follow public docs and BACEN/provider conventions but have not been fully live-validated. Pin exact versions during 0.x.x-alpha. Install with npm install @codespar/mcp-afip@alpha.

Quick Start

# Set your credentials
export AFIP_CERT_PATH="/path/to/cert.crt"
export AFIP_KEY_PATH="/path/to/key.key"
export AFIP_CUIT="20123456789"

# Run via stdio
npx -y @codespar/mcp-afip@alpha

# Run via HTTP
MCP_HTTP=true MCP_PORT=3000 npx -y @codespar/mcp-afip@alpha

Environment Variables

Variable Required Description
AFIP_CERT_PATH Yes Path to AFIP certificate (.crt)
AFIP_KEY_PATH Yes Path to AFIP private key (.key)
AFIP_CUIT Yes CUIT number of the taxpayer
AFIP_ENV No "production" or "homologation" (default: homologation)
MCP_HTTP No Set to "true" to enable HTTP transport
MCP_PORT No HTTP port (default: 3000)

Tools (20)

Tool Purpose
create_invoice Create an electronic invoice (Factura Electrónica) via AFIP
get_invoice Get invoice details by type, point of sale, and number
get_last_invoice_number Get last authorized invoice number for a point of sale and type
get_cae_status Check CAE authorization status for an invoice
list_invoice_types List available invoice types (Factura A, B, C, etc.)
list_tax_types List available tax types (IVA, percepciones, retenciones, etc.)
get_server_status Check AFIP web-service availability (WSFE status)
get_authorized_points_of_sale List authorized puntos de venta for the CUIT
create_invoice_batch Create a batch of invoices in a single CAE request (FECAESolicitar, up to 250)
create_credit_note Issue a credit note (Nota de Crédito A/B/C: types 3, 8, 13) referencing an original invoice
create_debit_note Issue a debit note (Nota de Débito A/B/C: types 2, 7, 12) referencing an original invoice
cancel_invoice Cancel/void an authorized invoice (FECancel, limited to certain types/conditions)
get_invoice_total_x_request Max number of records allowed per FECAESolicitar request (FECompTotXRequest)
list_concept_types List available concept types (FEParamGetTiposConcepto: 1=Products, 2=Services, 3=Both)
list_doc_types List document/identifier types (FEParamGetTiposDoc: 80=CUIT, 86=CUIL, 96=DNI, 99=Consumer Final)
list_iva_types List IVA tax aliquots (FEParamGetTiposIva: 21%, 10.5%, 27%, 0%, etc.)
list_currency_types List supported currencies (FEParamGetTiposMonedas)
get_currency_rate Get FX rate (cotización) for a currency vs ARS (FEParamGetCotizacion)
lookup_taxpayer Padrón lookup by CUIT (WS_SR_PADRON A4/A5/A13, fiscal status, name, address)
get_registration_certificate Get constancia de inscripción (registration certificate) for a CUIT

Auth

Uses certificate-based WSAA authentication (SOAP). The MCP server wraps AFIP's SOAP services (WSFE) internally using a REST approach. You need a valid certificate issued by AFIP. For testing, use the homologation environment.

API Reference

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

Authentication

Set these environment variables before launching the server:

  • AFIP_CERT_PATH (required), Path to AFIP certificate (.crt)
  • AFIP_KEY_PATH (required, secret), Path to AFIP private key (.key)
  • AFIP_CUIT (required), CUIT number

Issue credentials at the provider's developer portal: https://www.afip.gob.ar/ws.

License

MIT

Questions about Afip

What is the Afip MCP server?

AFIP, Argentine tax authority, electronic invoicing (Factura Electrónica). Afip is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Afip MCP server?

Add Afip to your AI app's MCP config with the command npx -y @codespar/mcp-afip@0.2.0-alpha.3. In Claude Code, run claude mcp add --transport stdio codespar-afip -- npx -y @codespar/mcp-afip@0.2.0-alpha.3. To run Afip this way you need Node.js installed.

Does Afip need an API key?

Yes. Afip expects AFIP_CERT_PATH, AFIP_KEY_PATH and AFIP_CUIT to be set. Create the key for Afip in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Afip an official MCP server?

No. Afip is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Afip access to company data.

What license is Afip under?

Afip is released under the MIT license, according to its GitHub repository. The license covers the code of Afip; the service it connects to has its own terms.