@codespar/mcp-afip 0.2.0-alpha.1 → 0.2.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +43 -12
  2. package/dist/index.js +5 -2
  3. package/package.json +12 -3
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # MCP AFIP
2
2
 
3
+
4
+ > **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 <pkg>@alpha`.
5
+
3
6
  MCP server for **AFIP** — Argentine tax authority (Administracion Federal de Ingresos Publicos) for electronic invoicing (Factura Electronica) with CAE authorization.
4
7
 
5
8
  ## Quick Start
@@ -28,18 +31,30 @@ npx tsx packages/argentina/afip/src/index.ts --http
28
31
  | `MCP_HTTP` | No | Set to `"true"` to enable HTTP transport |
29
32
  | `MCP_PORT` | No | HTTP port (default: 3000) |
30
33
 
31
- ## Tools
34
+ ## Tools (20)
32
35
 
33
- | Tool | Description |
34
- |------|-------------|
35
- | `create_invoice` | Create an electronic invoice (Factura Electronica) |
36
- | `get_invoice` | Get invoice details by type, POS, and number |
37
- | `get_last_invoice_number` | Get last authorized invoice number for a POS |
38
- | `get_cae_status` | Check CAE authorization status |
39
- | `list_invoice_types` | List available invoice types (A, B, C, etc.) |
40
- | `list_tax_types` | List available tax types (IVA, percepciones, etc.) |
41
- | `get_server_status` | Check AFIP web-service availability |
42
- | `get_authorized_points_of_sale` | List authorized puntos de venta |
36
+ | Tool | Purpose |
37
+ |---|---|
38
+ | `create_invoice` | Create an electronic invoice (Factura Electrónica) via AFIP |
39
+ | `get_invoice` | Get invoice details by type, point of sale, and number |
40
+ | `get_last_invoice_number` | Get last authorized invoice number for a point of sale and type |
41
+ | `get_cae_status` | Check CAE authorization status for an invoice |
42
+ | `list_invoice_types` | List available invoice types (Factura A, B, C, etc.) |
43
+ | `list_tax_types` | List available tax types (IVA, percepciones, retenciones, etc.) |
44
+ | `get_server_status` | Check AFIP web-service availability (WSFE status) |
45
+ | `get_authorized_points_of_sale` | List authorized puntos de venta for the CUIT |
46
+ | `create_invoice_batch` | Create a batch of invoices in a single CAE request (FECAESolicitar, up to 250) |
47
+ | `create_credit_note` | Issue a credit note (Nota de Crédito A/B/C: types 3, 8, 13) referencing an original invoice |
48
+ | `create_debit_note` | Issue a debit note (Nota de Débito A/B/C: types 2, 7, 12) referencing an original invoice |
49
+ | `cancel_invoice` | Cancel/void an authorized invoice (FECancel — limited to certain types/conditions) |
50
+ | `get_invoice_total_x_request` | Max number of records allowed per FECAESolicitar request (FECompTotXRequest) |
51
+ | `list_concept_types` | List available concept types (FEParamGetTiposConcepto: 1=Products, 2=Services, 3=Both) |
52
+ | `list_doc_types` | List document/identifier types (FEParamGetTiposDoc: 80=CUIT, 86=CUIL, 96=DNI, 99=Consumer Final) |
53
+ | `list_iva_types` | List IVA tax aliquots (FEParamGetTiposIva: 21%, 10.5%, 27%, 0%, etc.) |
54
+ | `list_currency_types` | List supported currencies (FEParamGetTiposMonedas) |
55
+ | `get_currency_rate` | Get FX rate (cotización) for a currency vs ARS (FEParamGetCotizacion) |
56
+ | `lookup_taxpayer` | Padrón lookup by CUIT (WS_SR_PADRON A4/A5/A13 — fiscal status, name, address) |
57
+ | `get_registration_certificate` | Get constancia de inscripción (registration certificate) for a CUIT |
43
58
 
44
59
  ## Auth
45
60
 
@@ -51,4 +66,20 @@ Uses **certificate-based WSAA authentication** (SOAP). The MCP server wraps AFIP
51
66
 
52
67
  ---
53
68
 
54
- **Enterprise?** Contact us at [codespar.com](https://codespar.com) for dedicated support, custom integrations, and SLAs.
69
+ ## Enterprise
70
+
71
+ Need governance, budget limits, and audit trails for agent payments? [CodeSpar Enterprise](https://codespar.dev/enterprise) adds policy engine, payment routing, and compliance templates on top of these MCP servers.
72
+
73
+ ## Authentication
74
+
75
+ Set these environment variables before launching the server:
76
+
77
+ - `AFIP_CERT_PATH` *(required)* — Path to AFIP certificate (.crt)
78
+ - `AFIP_KEY_PATH` *(required, secret)* — Path to AFIP private key (.key)
79
+ - `AFIP_CUIT` *(required)* — CUIT number
80
+
81
+ Issue credentials at the provider's developer portal: <https://www.afip.gob.ar/ws>.
82
+
83
+ ## License
84
+
85
+ MIT
package/dist/index.js CHANGED
@@ -60,7 +60,10 @@ async function afipRequest(method, path, body) {
60
60
  }
61
61
  return res.json();
62
62
  }
63
- const server = new Server({ name: "mcp-afip", version: "0.2.0-alpha.1" }, { capabilities: { tools: {} } });
63
+ // Managed-tier pointer surfaced to the agent via MCP `instructions`.
64
+ // Informational only — nothing CodeSpar-hosted is called (MIT-safe).
65
+ const MANAGED_TIER_HINT = "This open-source CodeSpar server calls the provider's API directly. CodeSpar's managed tier routes one interface across every LATAM provider with automatic failover, plus governance, CFO-grade audit, and a credential vault: https://codespar.dev/agents (npx -y @codespar/mcp serve).";
66
+ const server = new Server({ name: "mcp-afip", version: "0.2.0-alpha.2" }, { capabilities: { tools: {} }, instructions: MANAGED_TIER_HINT });
64
67
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
65
68
  tools: [
66
69
  {
@@ -455,7 +458,7 @@ async function main() {
455
458
  const t = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (id) => { transports.set(id, t); } });
456
459
  t.onclose = () => { if (t.sessionId)
457
460
  transports.delete(t.sessionId); };
458
- const s = new Server({ name: "mcp-afip", version: "0.2.0-alpha.1" }, { capabilities: { tools: {} } });
461
+ const s = new Server({ name: "mcp-afip", version: "0.2.0-alpha.2" }, { capabilities: { tools: {} } });
459
462
  server._requestHandlers.forEach((v, k) => s._requestHandlers.set(k, v));
460
463
  server._notificationHandlers?.forEach((v, k) => s._notificationHandlers.set(k, v));
461
464
  await s.connect(t);
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@codespar/mcp-afip",
3
- "version": "0.2.0-alpha.1",
3
+ "version": "0.2.0-alpha.3",
4
4
  "description": "MCP server for AFIP — Argentine tax authority, electronic invoicing (Factura Electrónica)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
8
  "mcp-afip": "dist/index.js"
9
9
  },
10
- "files": ["dist"],
10
+ "files": [
11
+ "dist"
12
+ ],
11
13
  "scripts": {
12
14
  "build": "tsc",
13
15
  "start": "node dist/index.js"
@@ -20,6 +22,13 @@
20
22
  "typescript": "^5.8.0"
21
23
  },
22
24
  "license": "MIT",
23
- "keywords": ["afip", "tax", "argentina", "factura-electronica", "cae", "mcp"],
25
+ "keywords": [
26
+ "afip",
27
+ "tax",
28
+ "argentina",
29
+ "factura-electronica",
30
+ "cae",
31
+ "mcp"
32
+ ],
24
33
  "mcpName": "io.github.codespar/mcp-afip"
25
34
  }