# Fiscalisto for AI agents

> Ask your coding agent to «add invoicing with Fiscalisto to my app»: connect the documentation as an MCP server, give it the one-page guide and let it try in test mode before writing the code.

Claude Code, Cursor, Codex, Copilot and other coding agents can integrate Fiscalisto on their own if they read the right things. This page says how to give them the documentation, the integration guide and a way to test, so the code comes out right the first time: with the official SDK, one `Idempotency-Key` per document, the customer's data as SAT asks for it and verified webhooks.

## The quickest way

In your project's folder:

```bash
npx fiscalisto login           # su llave de pruebas, por el navegador
npx fiscalisto init --agents   # SDK, llave en .env, AGENTS.md y la guía para su agente
```

`--agents` adds a how-to-invoice section to your `AGENTS.md` (or `CLAUDE.md`) and leaves the complete guide in `.claude/skills/fiscalisto/SKILL.md`, which Claude Code and other agents read by themselves when the task is invoicing. Then ask your agent, for example: «Add invoicing with Fiscalisto: when an order is paid, stamp its invoice and email it to the customer».

## No account yet: let your agent open one

Without an account, your agent opens a test one with your email: `POST https://fiscalisto.com/api/agente/cuenta` with `{ "email" }` returns a test key and issuer, and you get an email to claim it. The steps for the agent: [agents.md](https://fiscalisto.com/agents.md).

## Connecting the documentation (MCP)

This documentation's MCP server asks for no key or account. Your agent searches and reads the guides, describes each route with code in its language and tries requests in test mode while it codes.

- **Cursor**: [instalar con un clic](cursor://anysphere.cursor-deeplink/mcp/install?name=fiscalisto-docs&config=eyJ1cmwiOiJodHRwczovL2Zpc2NhbGlzdG8uY29tL2RvY3MvYXBpL21jcCJ9).
- **VS Code**: [instalar con un clic](https://vscode.dev/redirect/mcp/install?name=fiscalisto-docs&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Ffiscalisto.com%2Fdocs%2Fapi%2Fmcp%22%7D).
- **Claude Code**: `claude mcp add --transport http fiscalisto-docs https://fiscalisto.com/docs/api/mcp`
- **Codex**: `codex mcp add fiscalisto-docs --url https://fiscalisto.com/docs/api/mcp`
- **Claude** (web y escritorio): en [Personalizar › Conectores](https://claude.ai/customize/connectors) › Agregar conector personalizado, con la dirección `https://fiscalisto.com/docs/api/mcp`.
- **Otro cliente**: la dirección `https://fiscalisto.com/docs/api/mcp` como servidor MCP de tipo HTTP.

### By hand, in each agent

The address is `https://fiscalisto.com/docs/api/mcp` (MCP over HTTP, no key).

#### Cursor

**Instalar** opens Cursor and adds the server. By hand, in your project's `.cursor/mcp.json` (or `~/.cursor/mcp.json` for all of them):

```json
{
  "mcpServers": {
    "fiscalisto-docs": { "url": "https://fiscalisto.com/docs/api/mcp" }
  }
}
```

#### VS Code

**Instalar** opens VS Code and adds the server for Copilot. By hand, in `.vscode/mcp.json`:

```json
{
  "servers": {
    "fiscalisto-docs": { "type": "http", "url": "https://fiscalisto.com/docs/api/mcp" }
  }
}
```

#### Claude Code

```bash
claude mcp add --transport http fiscalisto-docs https://fiscalisto.com/docs/api/mcp
```

With `--scope project` it goes in the project's `.mcp.json`, for your whole team.

#### Codex

```bash
codex mcp add fiscalisto-docs --url https://fiscalisto.com/docs/api/mcp
```

The CLI, the Codex extension and the ChatGPT desktop app share this configuration.

#### Claude (web and desktop)

In [Customize › Connectors](https://claude.ai/customize/connectors), **Add custom connector** with the address `https://fiscalisto.com/docs/api/mcp`.

#### Another client

Add the address as an HTTP (streamable HTTP) MCP server.

### Its tools

| Tool | What it does |
| --- | --- |
| `get_started` | The complete integration guide on one page. Your agent asks for it first. |
| `search_docs` | Searches the guides and the reference, in Spanish or English. |
| `get_page`, `list_pages` | Reads a whole page or lists them all. |
| `list_operations` | Every operation with its `operationId`, method and path, by section. |
| `describe_operation` | An operation by its `operationId`, its SDK method (`invoices.create`), «POST /v1/invoices» or in words («create invoice»): its fields and the code with the SDK of the `language` you pick. |
| `describe_object` | An object's fields (`Invoice`, `Event`…) with an example. |
| `explain_error` | What an `error.code` means and how to fix it. |
| `call_api` | Tries a real request in test mode with your `fk_test_` key and returns the status, the `Request-Id` and the JSON. It never accepts an `fk_live_`. |

`call_api`'s requests show in **Desarrolladores › Solicitudes** with the key they used.

## The guide on one page

[`/docs/api/SKILL.md`](https://fiscalisto.com/docs/api/SKILL.md) is everything an agent needs to integrate Fiscalisto: the key, each language's SDK, stamping with `Idempotency-Key`, the customer's data, SAT's rejections, signed webhooks, cancelling, testing and going live. It's an [Agent Skill](https://agentskills.io): save it in your project's `.claude/skills/fiscalisto/SKILL.md` (`npx fiscalisto init --agents` does it) and your agent uses it when the task is invoicing. It's the same text `get_started` returns.

## The documentation as text

- [`/docs/api/llms.txt`](https://fiscalisto.com/docs/api/llms.txt): the index of every page ([llmstxt.org](https://llmstxt.org)).
- Every Spanish page exists in Markdown: add `.md` to its address (for example [`/docs/api/webhooks.md`](https://fiscalisto.com/docs/api/webhooks.md)), or ask for it with `Accept: text/markdown`. Every page also has **Copiar como Markdown**, **Abrir en ChatGPT**, **Abrir en Claude**, **Abrir en Cursor** and **Conectar su agente** above the title.
- [`/docs/api/llms-full.txt`](https://fiscalisto.com/docs/api/llms-full.txt): every guide and the reference in one file, with the cURL and TypeScript examples.
- The complete OpenAPI 3.1 document, no key: [`https://api.fiscalisto.com/v1/openapi.json`](https://api.fiscalisto.com/v1/openapi.json).
- `npx fiscalisto docs` prints the integration guide in the terminal, without internet.

## Testing without a key and with one

- **Without a key:** `npx fiscalisto mock` starts the API at `http://127.0.0.1:12111`, without internet, so your agent writes and runs tests from the first minute. It answers like the API but doesn't check SAT's rules. See [CLI](https://fiscalisto.com/en/docs/api/cli).
- **With your test key:** the MCP's `call_api`, or the CLI with `--json` (`npx fiscalisto invoices create --example --json`), stamp in SAT's test environment at no cost. The [test RFCs](https://fiscalisto.com/en/docs/api/pruebas-y-produccion#trigger-each-sat-rejection) trigger each SAT rejection so your agent handles the errors.

> **Your key.** Give your agent only the test key (`fk_test_`) and keep it in `.env`, never in code. You put the live one on your server yourself when everything works.
