Skip to main content
FA

Facturapi

v0.2.0API Key

Mexican CFDI 4.0 e-invoicing: create, stamp, and cancel invoices with SAT validation. Your agent handles Mexican fiscal compliance.

20 tools1 env vars๐Ÿ‡ฒ๐Ÿ‡ฝ Mexicostable on npm

Install

terminal
$ npm install @codespar/mcp-facturapi

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "facturapi": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-facturapi"
      ],
      "env": {
        "FACTURAPI_API_KEY": "<your_facturapi_api_key>"
      }
    }
  }
}

After restart, your agent can call any of the 20 tools below โ€” try create_invoice first.

Environment variables ยท 1

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

FACTURAPI_API_KEY
requiredsecret

API key for FacturAPI

Available tools ยท 20

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

WRITEcreate_invoice
Create a CFDI invoice
READget_invoice
Get invoice by ID
READlist_invoices
List invoices with filters
DELETEcancel_invoice
Cancel an invoice
READdownload_invoice_pdf
Download invoice as PDF (returns download URL)
READdownload_invoice_xml
Download invoice as XML (returns download URL)
WRITEsend_invoice_email
Send invoice (PDF + XML) by email to the customer or to specific recipients
WRITEcreate_customer
Create a customer for invoicing

Compatible frameworks

MCP is a protocol โ€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets โ€” it receives scoped, short-lived session tokens.
Servers โ€” Every LatAm commerce API your agent needs | CodeSpar