Lee y explica facturas de la luz españolas (QR de la CNMC). Todo en local.
Aplicación 100% cliente (sin backend) que explica tu factura de la luz. Sube tu factura (PDF o imagen), el navegador lee el código QR de la CNMC y te muestra un desglose claro de lo que estás pagando: potencia, energía, impuestos y contrato.
👉 Pruébala en vivo: entiende-tu-factura
Privacidad: todo el procesamiento ocurre en tu navegador. Tu factura nunca se envía a ningún servidor.
jsqr + pdfjs-distSi prefieres que sea tu agente quien lea la factura, hay un servidor MCP que expone la
misma lógica: factura-luz-mcp. Se ejecuta en local, así que la factura
tampoco sale de tu ordenador.
claude plugin marketplace add ilopezluna/entiende-tu-factura
claude plugin install factura-luz@entiende-tu-factura
O, si prefieres solo el servidor MCP sin el comando /entender:
claude mcp add factura-luz -- npx -y factura-luz-mcp
Si quieres comparar ofertas y ahorrar en tu factura, visita InvoiceDown.
.nvmrc → 22.20.0)npm install
npm run dev # http://localhost:5173
| Script | Descripción |
|---|---|
npm run dev | Servidor de desarrollo (Vite) |
npm run build | Typecheck + build de producción a dist/ |
npm run preview | Sirve el build de producción |
npm test | Tests (Vitest) |
npm run typecheck | Comprobación de tipos sin emitir |
npm run format | Formatea con Prettier |
npm run validate | format:check + typecheck + test + MCP |
npm run build:mcp | Compila el servidor MCP a mcp/dist |
npm run test:mcp | Typecheck + tests del servidor MCP |
src/
├── lib/cnmc/ # Extracción y cálculo (lógica CNMC propia)
│ ├── extraction/ # scan/pdf (agnósticos) + extractor (navegador) + validadores
│ ├── parsing/ # parseo de parámetros del QR
│ ├── types/ # QrParameters + enums
│ ├── content/ # vocabulario y explicaciones en español
│ ├── format/ # formateo de números en es-ES
│ ├── utils/ # cálculo de costes y análisis de potencia
│ └── __tests__/ # tests de lógica pura
├── styles/ # Tailwind v4 + design tokens
├── App.tsx
└── main.tsx
mcp/ # servidor MCP (paquete npm factura-luz-mcp)
src/lib/cnmc/ es compartido: la web y el servidor MCP calculan con el mismo código.
Solo extraction/extractor.ts depende del navegador; extraction/scan.ts y
extraction/pdf.ts no tocan el DOM y se reutilizan en Node.
Push a main despliega automáticamente a GitHub Pages
(.github/workflows/deploy.yml), disponible en
https://ilopezluna.github.io/entiende-tu-factura/. El base de Vite es
relativo (./), por lo que funciona tanto en usuario.github.io/<repo>/ como en un
dominio propio.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y factura-luz-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-ilopezluna-factura-luz": {
"command": "npx",
"args": [
"-y",
"factura-luz-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencefactura-luz-mcpnpmio.github.ilopezluna/factura-luz works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.