@timbrix/mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@timbrix/mcp Stamp a CFDI 4.0 invoice for 5,000 MXN"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@timbrix/mcp
MCP (Model Context Protocol) server for Timbrix — lets AI agents (Claude, Cursor, ChatGPT, etc.) stamp, cancel, and query CFDI 4.0 invoices directly, through the same REST API @timbrix/sdk uses.
Full guide: see docs.timbrix.mx/ai-agents for setup, the complete tool reference, LangChain (TS/Python) examples, error handling, and authentication best practices for agents.
This is the official public repository for
@timbrix/mcp— open issues and PRs here.Listed in the Official MCP Registry as
mx.timbrix/mcp.
v1 tools
Tool | Description |
| Stamp a CFDI 4.0 Ingreso invoice |
| Cancel a stamped CFDI by UUID and motivo |
| Get CFDI usage/quota for the current billing month |
| List invoices with page/type/status filters |
timbrix_crear_emisor(registering a new RFC issuer + CSD) is not available in v1 — organization creation and CSD upload require an authenticated owner session today, not an API key. See the Timbrix dashboard or@timbrix/clito onboard a new organization.
Related MCP server: brazil-invoice-mcp
Installation
No install step is required to try it — npx @timbrix/mcp always runs the
latest published version. To install it globally instead:
npm install -g @timbrix/mcp
TIMBRIX_API_KEY=sk_... timbrix-mcpClaude Desktop (local, npx)
Add to your claude_desktop_config.json:
{
"mcpServers": {
"timbrix": {
"command": "npx",
"args": ["@timbrix/mcp"],
"env": {
"TIMBRIX_API_KEY": "sk_..."
}
}
}
}Claude Desktop (hosted, no install)
Point at https://mcp.timbrix.mx/mcp instead — same config file, no local process:
{
"mcpServers": {
"timbrix": {
"url": "https://mcp.timbrix.mx/mcp",
"headers": {
"Authorization": "Bearer sk_..."
}
}
}
}Any MCP client that supports a url + custom headers remote server config (Cursor included) works the same way.
Environment variables
Variable | Required | Description |
| only for | API key created in the Timbrix dashboard, scoped to one organization |
| no | Overrides the API base URL (default |
| no |
|
| no | HTTP transport port when |
| no | HTTP transport bind address (default |
| only when | Comma-separated hostnames this server is publicly reachable as (Host-header allowlist) |
Running the HTTP transport
MCP_TRANSPORT=http PORT=8787 npx @timbrix/mcpEndpoints:
Endpoint | Purpose |
| Streamable HTTP — |
| SSE stream for server-to-client messages on an established session |
| Explicitly terminate a session |
| Health check ( |
Sessions
The endpoint is stateful, as the MCP spec requires. A client's first
POST /mcp carries an initialize request and no session header; the server
creates one MCP server instance for it and returns an Mcp-Session-Id. Every
later request (starting with notifications/initialized) must send that header
back and is routed to the same instance — an unknown or missing session ID is
rejected rather than silently given a fresh, uninitialized server.
A session lives until one of:
the client sends
DELETE /mcpwith itsMcp-Session-Id, orit goes 30 minutes without a request, at which point the idle sweep evicts it (clients that crash, close, or lose the network never send
DELETE, so without this they would leak).
After eviction, requests on that session ID get 404 Session not found; a client
recovers by re-running initialize.
Security: bind address, Host validation, and authentication
In http mode, each session authenticates independently via the
Authorization: Bearer <api-key> or X-API-Key header sent with the
client's initialize request — there is no single, process-wide API key.
The key is never validated by this package itself; it's forwarded to the
Timbrix API on every call, exactly as stdio mode already does, so the
Timbrix API's own key validation is the source of truth. An initialize
request with neither header is rejected with 401 before any session is
created.
The server binds to
127.0.0.1by default — reachable only from the same machine. Host-header (DNS-rebinding) validation is applied on this default, so a malicious web page cannot point a hostname it controls at your loopback server and drive it through the victim's browser.Set
MCP_HTTP_HOST(e.g.MCP_HTTP_HOST=0.0.0.0) to expose it further — this also requiresMCP_ALLOWED_HOSTS, since Host-header validation still applies on a non-loopback bind (the server refuses to start without it, rather than skipping validation altogether).New-session creation is rate-limited per IP (30/minute by default) to protect the process from unbounded session creation; requests on an already-established session are never affected by this limit.
GET /healthis exempt from Host validation, so infrastructure health probes (which send their own Host header, e.g. Railway'shealthcheck.railway.app) don't need to be added toMCP_ALLOWED_HOSTS.Once a session is established, its
Mcp-Session-Idheader alone authorizes further requests on it — the API key isn't re-checked per request — so treat a session ID as sensitive as the credential that created it for the rest of that session's life.
For local, single-user agents, stdio (the default) still needs no port
at all and is the simplest option.
Development
pnpm install
pnpm dev # watch build
pnpm test # vitest
pnpm build # tsupLicense
MIT © Timbrix — see LICENSE.
Available Tools
4 toolstimbrix_cancelar_cfdiCancelar CFDIADestructiveIdempotent
Solicita la cancelación de un CFDI ya timbrado ante el SAT. Si el receptor debe aprobar la cancelación, el resultado queda en estatus 'pendiente'.
Inputs: uuid (required), motivo (required), folioSustitucion.
timbrix_consultar_saldoConsultar saldo de CFDIARead-onlyIdempotent
Devuelve cuántos CFDI ha timbrado la organización configurada en el mes calendario actual (hora Ciudad de México) contra el límite incluido en su plan, y cuándo se reinicia el periodo. Importante: cfdiIncluded y cfdiRemaining son null cuando el plan es enterprise (timbrado ilimitado), no cero — nunca reportes que al cliente le quedan 0 timbres en ese caso.
Inputs: no named parameters.
timbrix_crear_cfdi_ingresoTimbrar CFDI de ingresoA
Timbra (sella ante el SAT vía PAC) un CFDI 4.0 de tipo Ingreso para la organización configurada. Devuelve el UUID fiscal, el XML timbrado y el estatus.
Inputs: use (required), date (required), items (required), series (required), +11 more.
timbrix_listar_cfdiListar CFDIARead-onlyIdempotent
Lista los CFDI timbrados de la organización configurada, más recientes primero, con filtros opcionales de tipo y estatus.
Inputs: page, type, limit, status.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Cada herramienta cubre una acción distinta: timbrar, cancelar, listar y consultar saldo. No hay solapamiento real entre ellas; incluso listar y consultar saldo se diferencian claramente porque uno devuelve documentos y el otro uso mensual del plan.
Las cuatro herramientas siguen el patrón consistente timbrix_ + verbo en infinitivo + objeto: crear_cfdi_ingreso, cancelar_cfdi, listar_cfdi, consultar_saldo. La variante con subtipo en crear_cfdi_ingreso es descriptiva y no rompe la convención.
Cuatro herramientas es una cantidad adecuada para un servicio especializado de timbrado fiscal: cubre las operaciones esenciales sin inflar la superficie. No hay herramientas redundantes ni faltan piezas obvias dentro del alcance declarado.
El ciclo principal queda cubierto: crear/timbrar, cancelar, listar y monitorear saldo. Faltan detalles menores como consultar un CFDI específico por UUID o descargar el XML de uno ya timbrado, pero no son huecos que impidan el flujo de trabajo central.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Your company's tools, memory and Automations for ChatGPT, Claude or any MCP agent. Open source.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to issue Mexico CFDI 4.0 electronic invoices (factura electrónica) via Facturapi, with tools for creating, querying, canceling, and sending invoices.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that lets AI agents issue Brazilian NFS-e service invoices via Focus NFe, with tools for creating, querying, and canceling invoices.MIT

brasilnfe-mcpofficial
FlicenseNot gradedqualityDmaintenanceMCP server that exposes Brazilian tax infrastructure as tools, resources, and prompts, enabling AI agents to emit and manage fiscal documents (NF-e, NFC-e, NFS-e, CT-e, MDF-e, DC-e) through natural language.-- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Mexican Electronic Invoicing (CFDI 4.0, Complemento de Pagos 2.0). Provide tools to validate, generate, and explore API specifications for SAT/PAC interoperability.627 PyPIApache 2.0