Skip to main content
FA

Facturapi

v0.2.1API 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

What your agent can do

Facturapi gives your agent 20 tools it calls directly β€” pick the ones it needs, in Claude, Cursor, or any MCP client.

  • create_invoice β€” Create a CFDI invoice
  • get_invoice β€” Get invoice by ID
  • list_invoices β€” List invoices with filters
Example call
// Your agent calls a tool directly β€” no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("create_invoice", { /* ... */ });

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

Run `npx -y @codespar/mcp-facturapi` and add the config block above to your MCP client β€” Claude, Cursor, VS Code, or any MCP-compatible client. No build step, no SDK required. Prefer hosted? CodeSpar's managed tier runs it for you with auth handled.
Facturapi β€” MCP server Β· 20 tools | CodeSpar