# gofact

A local MCP server that turns a print-ready HTML invoice into Factur-X: PDF/A-3 with embedded EN 16931 XML. Built for French freelancers and small firms.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 5
- Author: kOlapsis
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/kOlapsis/gofact
- Updated: 2026-10-06
- HTML: https://affpapa.org/en/nevibecode/mcp/gofact

## What it does

gofact is a small Go binary. It takes an HTML invoice meant for printing and assembles Factur-X from it: a PDF/A-3 file carrying CII XML under EN 16931. Optionally the invoice goes to a French PDP platform.

There are two checks. First the EN 16931 business rules run against the model before anything is produced, so a non-compliant invoice is refused with the rule identifier (`BR-50`, `BR-CO-15`…) and the field to fix. Then the written PDF is read back: Factur-X structures (`/AF`, `/OutputIntents`, XMP, `/EmbeddedFiles`) are verified and the embedded XML is compared with the generated one byte by byte. The XML goes in untouched — re-serializing it through an assembler's own model would drop extended fields, including the PDP electronic routing addresses.

The only system dependency is a browser: Chrome, Edge, Brave or Chromium for HTML-to-PDF rendering. Sandboxed packages such as snap and flatpak are skipped because they cannot read the temporary files gofact hands them. PDF/A-3 assembly happens in Go via pdfcpu, and the sRGB ICC profile sits inside the binary. Seller details, IBAN and PDP credentials come from the environment; with no seller configured gofact fails explicitly instead of issuing an incomplete invoice.

## Requirements
- Needs: a prebuilt binary from the repository releases

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- build a Factur-X file from an HTML template and order data
- check an invoice against EN 16931 rules before issuing it
- submit a finished invoice to a French PDP platform
- keep a continuous legal invoice numbering sequence
- verify the embedded XML against the generated one

## Example prompts
- Show the next invoice number and build Factur-X from `facture.html`
- Send `2026011 - Client.pdf` to the PDP and show its status

## Similar
- [Kema Invoice](https://affpapa.org/en/nevibecode/mcp/kema-invoice.md) — MCP server
- [InvoiceXML](https://affpapa.org/en/nevibecode/mcp/invoicexml.md) — MCP server · ★ 5
- [QuickBooks Automation](https://affpapa.org/en/nevibecode/skills/quickbooks-automation.md) — skill · 4700 installs
- [popbill](https://affpapa.org/en/nevibecode/skills/popbill.md) — skill · 4400 installs
- [plan-payroll](https://affpapa.org/en/nevibecode/skills/plan-payroll.md) — skill · 1800 installs
- [xero](https://affpapa.org/en/nevibecode/skills/xero.md) — skill · 346 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
