Fiscalapi

Issue CFDIs from
your AI agent

Fiscalapi MCP connects your Fiscalapi tenant (the space in Fiscalapi that holds your issuers, recipients, credits, and data) to an AI client such as Claude Code, Cursor, or Codex, or to your own app or agent. Ask your agent to issue, look up, or cancel CFDI 4.0 (Mexico's electronic invoice) in plain language, with the same permissions and credits as the API.

No extra cost: each CFDI your agent issues uses 1 stamp (a stamping credit), the same as in the API.

What you can ask for

Write what you need. The agent picks the tool, looks up the data in your tenant, and shows you the result.

“Invoice the 3 consulting services from May to Comercializadora del Norte”

The agent looks up the recipient and the products, builds the income invoice (type I, the regular sales invoice), and stamps it when you confirm.

“Log the payment I received yesterday for invoice A-1024”

Issues the payment complement (the complement that records each payment) for the PPD invoice (paid in installments or later, Pago en parcialidades o diferido), with the payment's date and amount.

“Which invoices did I issue this week, and which are still active?”

Lists your invoices with filters and checks each one's status with the SAT (Mexico's tax authority).

“Cancel invoice A-1031, the recipient's RFC is wrong”

Chooses the cancellation reason, cancels the invoice with the SAT, and checks the cancellation status.

“Is this supplier on the 69-B list?”

Checks an RFC (Mexico's taxpayer ID) against the Lista 69-B (the SAT list of taxpayers presumed to invoice nonexistent transactions) and the Lista 69-B Bis (the SAT list of taxpayers presumed to have improperly transferred tax losses) before you pay them.

“Download the CFDIs I received in October from the SAT”

Requests a bulk download (the SAT service that delivers the CFDIs a taxpayer issued and received) for the period and returns the summary of the documents when it finishes.

27 tools on the Fiscalapi API

Each tool calls the API with your API key. The tax rules and validations are the same, and a rejection reaches the agent with its details.

7 CFDI types

Income invoices, credit notes (an Egreso CFDI), payment complements, global invoices (factura global, one CFDI that groups a period's sales to the general public), payroll CFDIs (the CFDI issued for each salary payment), Carta Porte (the CFDI complement that documents the transport of goods in Mexico), and Comercio Exterior (the CFDI foreign trade complement for exports), with one tool for each.

Lookup and cancellation

Lists invoices, returns one by its ID, checks their status with the SAT, cancels them with a reason, and emails the XML and PDF.

People and products

Looks up, registers, and updates issuers, recipients, and products with their tax details.

SAT catalogs

Looks up keys in the SAT's CFDI 4.0 catalogs, so the agent doesn't make them up.

Bulk download

Creates download rules, requests the CFDIs for a period from the SAT, and checks the result.

69-B lists

Checks an RFC against the SAT's Lista 69-B and Lista 69-B Bis.

Credits and certificates

Shows the environment, your credit balance, your recent transactions, and the validity period of your CSDs (the digital seal certificate used to sign CFDIs) and your e.firma (the SAT advanced electronic signature that identifies a taxpayer, formerly FIEL).

Webhooks

Lists the events from the last 30 days with their deliveries and resends the one you need.

The server also includes 3 guided prompts that walk the agent step by step through an invoice, a payment complement, or a cancellation.

How to connect

It authenticates the same way as the API: with your API key and your tenant, in the X-API-KEY and X-TENANT-KEY headers.

  1. 1

    Create an API key

    In the dashboard, create an API key only for the MCP and assign it to the person (any individual or company you register in Fiscalapi) whose permissions the agent uses.

  2. 2

    Store your credentials

    Set the API key and your tenant as environment variables or in your server's secrets manager. Your client or your app reads them from there, and they aren't written to any file.

  3. 3

    Add the server

    Add the URL and the two headers to your AI client or, with an MCP SDK, to your app. On the API keys page of the dashboard, "Connect MCP" copies the configuration for the most common clients.

  4. 4

    Ask in plain language

    Start in the test environment. When your workflow is ready, switch the URL and the API key to production.

One server per environment

The URL sets the environment of the connection. The agent can't change it.

Fiscalapi MCP URL by environment and what each one allows
ConnectionURL
Testhttps://test.mcp.fiscalapi.com/mcp

Stamps on the test PAC (a SAT-authorized provider that stamps CFDIs). Invoices aren't valid for tax purposes.

Productionhttps://live.mcp.fiscalapi.com/mcp

Stamps real CFDIs with the SAT and uses your stamps.

Test, read onlyhttps://test.mcp.fiscalapi.com/mcp/readonly

Exposes only the 10 lookup tools of the test environment: the agent can't issue or cancel.

Production, read onlyhttps://live.mcp.fiscalapi.com/mcp/readonly

Exposes only the 10 lookup tools of the production environment: the agent can't issue or cancel.

Use an API key from the same environment as the URL: a test API key doesn't work in production.

Security

What the server guarantees on each connection. Keep in mind that what you type in the chat or what your app sends to the model, and what the tools return, reaches the provider of the model your client or your app uses.

  • Your certificates don't pass through the agent

    CSDs, your e.firma, and their passwords don't go in or out through any tool. You upload them in the dashboard or through the API.

  • The API key's permissions

    The agent can do only what the person who owns the API key can do, and nothing more. With an API key used only for the MCP, you can revoke it whenever you want without touching your other integrations.

  • One environment per connection

    Each connection works only in the environment of its URL. A test connection never stamps in production.

  • No duplicate invoices

    Each issuance carries an idempotency key. If the agent retries, it receives the same invoice instead of stamping another one.

  • Confirmation before issuing or canceling

    In clients that support confirmation in the MCP protocol (elicitation), the server shows you a summary and waits for your answer. In the others, you confirm through your client's tool approval. In your own app, it's your app that asks for confirmation before it issues or cancels.

  • XML and PDF by email

    No tool returns the XML or PDF in the chat. They're emailed to the recipient or to the address you specify.

Frequently asked questions about Fiscalapi MCP

What is Fiscalapi MCP?

It's a remote server for the Model Context Protocol (MCP) that connects your AI agent to your Fiscalapi tenant. With it, the agent issues, looks up, and cancels CFDI 4.0, manages people and products, requests bulk downloads, and checks RFCs against the Lista 69-B and Lista 69-B Bis, all through the Fiscalapi API.

Which clients does it work with?

It works with an AI client such as Claude Code, Cursor, or Codex, or with your own app or agent built with an MCP SDK. In detail, it works with any client or app that uses MCP over streamable HTTP and sends headers, such as Claude Code, Cursor, VS Code with GitHub Copilot, Codex, and Windsurf. It connects with an API key and your tenant. This version doesn't have OAuth, so it doesn't work in ChatGPT or in claude.ai connectors.

Can I use it from my own app or agent?

Yes. Your app's backend connects with an MCP SDK, using the environment's URL and the X-API-KEY and X-TENANT-KEY headers. Your app gives the tools to its model and runs the one the model picks. Call it from your server, never from the browser. The guide at docs.fiscalapi.com/en/mcp-server has examples in TypeScript, Python, and C#.

How much does it cost?

It has no extra cost. It uses the same credits as the API: each issued CFDI uses 1 stamp, each check against the Lista 69-B and Lista 69-B Bis uses 1 validation credit per list, and a bulk download rule takes a seat (one RFC and one download type in bulk download) for as long as it exists. The other tools don't use credits.

Can I test it without stamping real invoices?

Yes. Connect it to https://test.mcp.fiscalapi.com/mcp with a test API key. It stamps on the test PAC, and the invoices aren't valid for tax purposes.

Can the agent see my certificates or passwords?

No. No tool receives or returns CSDs, e.firma, private keys, or passwords. The agent issues with an issuer that already has its CSD uploaded to Fiscalapi.

What happens if the agent repeats an issuance?

Each issuance carries an idempotency key. If the agent repeats it with the same key, it receives the invoice that was already stamped and doesn't issue another one.

How do I limit the agent to lookups?

Connect it to the /mcp/readonly path: https://test.mcp.fiscalapi.com/mcp/readonly in test and https://live.mcp.fiscalapi.com/mcp/readonly in production. That path exposes only the lookup tools. It limits what the agent sees, not the API key: with the same API key, another connection to /mcp can still issue and cancel.

What data does the model provider receive?

What you type in the chat or what your app sends to the model, and what the tools return, such as RFCs, legal names, and line items, reaches the provider of the model your client or your app uses. Review its terms before you work with real data.

How is it different from the Docs MCP server?

Fiscalapi MCP operates your tenant: it issues, looks up, and cancels. The Docs MCP server helps your agent write your integration with the API reference and guides. It runs on your computer and doesn't need an API key. Connect both if your agent also writes code.

Take the next step

Connect your agent to Fiscalapi

Sign up, generate a test API key, and issue your first invoice from your agent or your app.