
Gofact
io.github.kOlapsis由 GitHub 帳號 kOlapsis 發布v1.2.0更新於 Oct 27, 2026
Creates compliant French e-invoices locally: Factur-X PDF/A-3 with EN 16931 CII XML, legal numbering
概覽
本機 MCP 伺服器,讓助理依 HTML 與 JSON 產生合規的法國 Factur-X 電子發票,並可選擇提交至 PDP 平台。
- 可以做什麼
- 管理開立發票的組織:列出、檢視、初始化與更新,每個組織各自擁有身分資料、編號登錄檔與稽核日誌
- 查詢客戶並讀取發票範本
- 預覽下一個合法發票編號並列出既有發票
- 依發票資料建立發票,經業務規則檢查後產生內嵌 EN 16931 CII XML 的 Factur-X PDF/A-3
- 將發票提交至法國電子發票平台並查詢其狀態
- 適用情境
- 適合需要開立 Factur-X 電子發票的法國自由工作者或小型企業,想在 Claude Desktop、Claude Code、LM Studio 等 MCP 用戶端中以對話方式產生發票,並由本機確保合法編號與 EN 16931 合規。
- 執行需求
- 以本機二進位檔透過 stdio 執行;HTML 轉 PDF 需要 Chrome、Edge、Brave 或 Chromium 等 Blink 瀏覽器,snap、flatpak 等沙箱套件會被略過。賣方身分、SIRET/SIREN、營業稅號、地址、IBAN 與 PDP 憑證來自環境變數或 .env 檔;除非發票資料含 seller 區塊,否則必須提供 GOFACT_SELLER_NAME。提交至 PDP 需要 SUPERPDP_CLIENT_ID、SUPERPDP_CLIENT_SECRET 與 SUPERPDP_BASE。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Gofact,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
gofact
Small Go binary that turns a print-ready HTML invoice into Factur-X: a compliant PDF/A-3 with the CII EN 16931 XML embedded, and optionally submits it to a French e-invoicing platform (PDP — plateforme de dématérialisation partenaire).
Built for the invoicing of a French freelancer or small business (the French
e-invoicing reform), and also shipped as a Claude Code plugin with the
creer-facture skill.
Pipeline
Verbatim embedding — important. The XML is embedded byte for byte. An assembler that re-serializes it through its own model loses extended fields, in particular the PDP electronic routing addresses (BT-34/BT-49). gofact never touches the XML it has produced.
System dependencies
A browser, and that's it.
- Chrome, Edge, Brave or Chromium — HTML → PDF rendering
Auto-detected on Linux, macOS and Windows (where Edge is preinstalled, so
nothing to do). Sandboxed packages — snap, flatpak — are skipped: they cannot
read the temporary files gofact hands them. To point at a specific executable:
GOFACT_CHROME or -chrome.
The PDF/A-3 assembly is done in Go (pdfcpu): no Ghostscript, no Java, no first-run download. The sRGB ICC profile is embedded in the binary.
Compliance
Two checks, at two different moments:
- EN 16931 business rules, applied on the model before producing
anything. gofact refuses to issue an invoice it knows to be non-compliant,
reporting the rule identifier (
BR-50,BR-CO-15…) and the field to fix. - PDF self-check, after writing: the file is re-read, the Factur-X
structures are verified (
/AF,/OutputIntents, XMP,/EmbeddedFiles) and the embedded XML is compared byte for byte with the one that was generated.
Deep PDF/A-3b compliance is verified by veraPDF, via Mustang, in continuous integration — never on the user's machine:
Build
Configuration
No identity and no secret is hard-coded. The invoice issuer, the payment IBAN and the PDP credentials come from the environment.
gofact loads, in order and without ever overwriting an already-defined
variable: the file passed to -env, otherwise ./.env, then
$XDG_CONFIG_HOME/gofact/.env (~/.config/gofact/.env by default). The .env
is git-ignored — never commit it.
With no seller configured, gofact fails explicitly rather than issuing an
incomplete invoice. Every value can still be overridden per invoice via the JSON.
MCP server — talk to your AI to invoice
gofact mcp exposes invoicing as a local MCP server (stdio): from Claude
Desktop, Claude Code, LM Studio or any MCP client, saying "make me an invoice
for ACME, 2 days at €600" is enough. The AI is the interface; gofact
guarantees the numbering (continuous legal sequence, locked and transactional
allocation), EN 16931 compliance and archiving — locally.
Tools: list_organizations, get_organization, init_organization,
update_organization,
search_client, get_invoice_template, preview_next_number, list_invoices,
create_invoice, send_invoice (the only destructive tool — PDP submission,
explicit confirmation required), get_invoice_status. Prompt: nouvelle-facture.
An organization (issuing entity) = a self-contained directory: identity in
its .env, numerotation.json registry, journal.ndjson audit log, invoice
template frozen at first issuance, and the invoices themselves. CLI
management: gofact org list | init | show. No secret ever leaves a tool
response.
Usage (CLI)
Exit code 0 if the Factur-X is generated (and compliant when -validate).
Sending to a PDP (SuperPDP)
gofact submits the Factur-X PDF to SuperPDP (OAuth2 client credentials).
The PDP requires that the invoice seller = the company of the authenticated account (legal identifier BT-30) and an electronic routing address (BT-34/BT-49, scheme
0225) for both the issuer and the recipient. Seeelectronic_addressbelow.-pollshows the lifecycle (fr:200submitted →fr:201issued →fr:202received).
JSON format (sidecar)
All amounts are in cents (integers). The seller, the IBAN, the VAT regime and the French legal mentions have default values (environment) — the JSON only carries what varies.
Optional fields: due_date (defaults to "on receipt" = issue date),
delivery_date (defaults to issue date), currency (defaults to EUR), vat
(defaults to 293 B exemption; set {"exempt": false, "rate_pct": "20.00"} for
standard VAT), seller, iban, title (the invoice subject, recorded in the
registry), notes.
Notes: the three French legal mentions — late-payment penalties (PMD),
recovery fee (PMT), discount (AAB) — are always emitted (BR-FR-05). notes
adds to them: a note without subject_code goes out as general information
(AAI); a note carrying PMD, PMT or AAB replaces the default mention with
that code. No spec can drop them: generation refuses.
PDP routing: seller/buyer accept electronic_address (BT-34/BT-49) and
electronic_address_scheme (e.g. "0225"). A PDP routes on these addresses,
not on the postal address. Without a declared address, each party is routed on
its SIREN (derived from the SIRET) with scheme 0225; the e-mail (EM) is
only used when no legal identifier is known — it is not in the directory, and
send_invoice then refuses the deposit. Example (seller override):
Installation
Precompiled binary (GitHub release, no toolchain required):
gofact install detects Claude Desktop, Claude Code, LM Studio and Cursor,
shows what it intends to write (dry-run by default), backs up every file before
modifying it and never overwrites a diverging entry without -force. Windows:
install.ps1.
Package managers — the cask and the manifest live in this repository, hence
the explicit URLs (Homebrew's short brew tap form requires a homebrew-*
repository name; Homebrew core and the main Scoop bucket both gate on a
popularity threshold gofact has not reached):
Claude Code plugin — the repository is also a plugin: creer-facture skill
- declared MCP server:
From source: go build -o gofact .
Organizations live in local directories (identity, registry, invoices) —
never versioned here: they contain real data. GOFACT_INVOICES_DIR is still
honored for compatibility with the historical skill.
Known limitations
- Rendering relies on a Blink browser; sandboxed packages (snap, flatpak) are
ignored because they cannot read outside
$HOME. - Single VAT rate. Multi-rate is not supported.
- Currency ≠ EUR: the VAT counter-value in EUR (BT-111) must be provided
upstream (
VATEurfield of the model); not exposed in the JSON yet. - Only one PDP implemented (SuperPDP).
License
GNU AGPL v3 or later — see LICENSE.
Copyright (C) 2026 Benjamin Touchard.
gofact is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of merchantability or fitness for a particular purpose.
來源:README.md,提交 6319619
工具
0版本歷史
1- v1.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分