Skip to main content
A

AFIP

@codespar/mcp-afip Β· v0.2.0-alpha.3

πŸ‡¦πŸ‡· ArgentinaFiscalAuth Β· API Keybeta20 tools4 env varsprerelease

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

Get started Β· freeView docs

MIT Β· runs locally or through the CodeSpar runtime

Limitations

  • v0.2.0-alpha.3 is a prerelease, with 20 tools, and the command on this page installs it. The latest stable release is 0.1.0, with 8 tools.
  • The package manifest does not declare 1 of the 4 variables the code reads.
  • The npm package ships no server.json manifest.
Package
@codespar/mcp-afip
Version
0.2.0-alpha.3 Β· prerelease
npm dist-tag
latest
Category
Fiscal
Auth
API Key
Country
πŸ‡¦πŸ‡· Argentina
License
MIT
Transport
stdio Β· streamable-http

Quickstart

Install, set the credentials, make the first call.

Pick your client. The server runs locally over stdio, or through the hosted runtime.

Add the server to your clientOne config entry. No build step, no SDK required.
Set the environment variables4 variables read by this server's code, listed below.
Restart and make the first callThe agent can call any of the 20 tools. Try create_invoice first.
terminal
# Claude Code claude mcp add afip -e AFIP_CERT_PATH=… -e AFIP_CUIT=… -e AFIP_ENV=… -e AFIP_KEY_PATH=… -- npx -y @codespar/mcp-afip@0.2.0-alpha.3 # then: /mcp to confirm the server is connected
Environment variables4 variables
AFIP_CERT_PATHPath to AFIP certificate (.crt)required
AFIP_CUITCUIT numberrequired
AFIP_ENVRead by the code; the package manifest does not declare it.
AFIP_KEY_PATHPath to AFIP private key (.key)requiredsecret

Names read from the package code (@codespar/mcp-afip@0.2.0-alpha.3). Descriptions and flags come from its manifest. Self-hosted, you hold the credentials. On the CodeSpar runtime the credential you connect is stored encrypted (AES-256-GCM, key derived per organization), and the runtime adds it to the provider call itself; the agent never receives it.

First call democreate_invoice

"Create an electronic invoice"

tools/callcreate_invoiceresult returned

Tools

What your agent can call.

20 tools, as the package's tools/list returns them.

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)

Names and descriptions come from the package's tools/list (@codespar/mcp-afip@0.2.0-alpha.3). A kind (read, write, delete) is shown only when the package annotates its tools or each tool was verified one by one; neither exists for this server yet.

Compatibility

MCP is a protocol. Any client that speaks it can mount this server.

Through the CodeSpar runtime, codespar_discover finds this server's tools, and a tools/call runs with the credential connected in your project, a test key included.

hostedhttps://connect.codespar.dev/mcp15 meta-tools

Protocol

Any MCP client

stdio Β· streamable-http

Questions

Before you install.

How do I install the AFIP MCP server?

Run npx -y @codespar/mcp-afip@0.2.0-alpha.3 and add the config block above to your MCP client: Claude Code, Cursor, Claude Desktop, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? Add the CodeSpar endpoint with a test key and connect AFIP in your project; codespar_discover finds its tools.

What can my agent do with AFIP?

AFIP exposes 20 tools for fiscal. Your agent calls them directly; the full list is above.

How does AFIP authenticate, and how are credentials stored?

AFIP uses API Key. Self-hosted, you hold the credentials: the server reads them from its environment variables. On the CodeSpar runtime the credential you connect is stored encrypted for your organization, and the runtime adds it to each provider call, so the agent never handles it.

How does AFIP handle upstream API changes?

Every server is versioned independently on npm. The command on this page pins 0.2.0-alpha.3, the version whose tools are listed here; your agent keeps running it until you change the version.

Is AFIP open source? How do I report a bug?

Yes. AFIP is MIT-licensed and published on npm as @codespar/mcp-afip, source on GitHub (link in the Details panel). Report issues on the package repository; security issues go to security@codespar.dev, and we respond within 24 hours.

Start in seconds.

On the CodeSpar runtime, the credential you connect stays encrypted for your organization and the runtime adds it to each call. You just call the tool.

Start in seconds demo
Create an account and copy a test key.
Add the hosted endpoint to your client with the config above.
Connect AFIP in your project and ask your agent for the first call.
AFIP β€” MCP server Β· 20 tools | CodeSpar