
Kontor MCP
io.github.DashankaNadeeshanDeSilva由 GitHub 帳號 DashankaNadeeshanDeSilva 發布v1.0.4更新於 Oct 27, 2026
Offline e-invoice tools for AI agents: validate, audit, convert and generate XRechnung/ZUGFeRD.
概覽
離線 MCP 伺服器,讓助理解析、驗證、稽核、產生並轉換德國/歐盟電子發票(XRechnung、ZUGFeRD/Factur-X)。
- 可以做什麼
- 解析與檢視發票:辨識 UBL/CII、XRechnung 版本與 ZUGFeRD 設定檔,回傳 EN 16931 語意模型
- 驗證與稽核:XSD 加上官方 EN 16931/XRechnung Schematron 規則,提供附說明的發現與接受/複核/拒絕建議
- 產生與轉換:產生 XRechnung 3.0 UBL 或 ZUGFeRD PDF/A-3,將 PDF 轉為 XML、UBL 與 CII 互轉並附損失報告
- 解釋規則與義務:查詢 BR-* 規則原文與修正提示,德國電子發票強制規定的決策樹
- 列出能力資訊,瀏覽內建範例、規則與代碼表資源,並使用稽核、拒收草稿、建立發票等提示範本
- 適用情境
- 適合需要檢查供應商進項電子發票、解釋驗證錯誤、產生合規的 XRechnung 或 ZUGFeRD 檔案,或回答德國電子發票合規義務問題,同時希望發票資料留在本機的情境。
- 執行需求
- 以 stdio 方式在本機執行,通常透過 npx 啟動,需要 Node 20 或更新版本。另提供 Docker 映像供 Streamable HTTP 模式使用,該模式必須提供至少 16 個字元的 KONTOR_AUTH_TOKEN 權杖。選用設定:KONTOR_LANG_DEFAULT(de 或 en)與 KONTOR_MAX_FILE_MB。執行時不需 API 金鑰或網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Kontor MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Kontor MCP
The sovereign e-invoice toolkit for AI agents. Official XRechnung / EN 16931 validation, ZUGFeRD in and out, 100 % offline, zero API keys.
[CI] [Conformance] [PDF/A-3] [License] [npm] [MCP Registry] [Website]
Kontor MCP is a local, offline toolbox that lets AI assistants (Claude Desktop, Claude Code, any MCP client) handle German/EU e-invoices: XRechnung and ZUGFeRD/Factur-X under EN 16931. It can read an invoice (bare XML or XML embedded in a PDF), check it against the official KoSIT / EN 16931 rulebooks, explain cryptic errors in German or English, create valid new invoices (XML or ZUGFeRD PDF/A-3), convert between formats, and tell a business which legal obligations apply. The key promise is sovereignty: no cloud, no API keys, no network calls, no Java at runtime — proven by tests.
Why it matters: since 2025 every German business must be able to receive e-invoices, and from 2027/2028 must issue them. An e-invoice is validated XML, not a PDF, and a failed rule can cost the input-VAT deduction. Invoices carry personal and bank data, so they should be checked where they live — on your machine — with the same rule sets the public-sector receivers use.
[Kontor MCP in Claude Desktop: validate a broken XRechnung, parse a ZUGFeRD PDF, explain BR-DE-18]
Claude Desktop with the kontor server: validate → BR-DE-15 (missing Leitweg-ID) with fix hint · parse a ZUGFeRD PDF · explain BR-DE-18. MP4
v1.0 — 8 tools · 4 resource families · 3 prompts · KoSIT conformance 89/89 enforced as a CI gate · ZUGFeRD PDF/A-3 output verified by veraPDF and Mustang · stdio and Streamable HTTP (bearer auth) · Docker image (amd64/arm64) · kontor-agent reference client · listed in the Official MCP Registry. Install with npx, Docker, or from source.
Why
- Official rules, not approximations. The KoSIT XRechnung Schematron and the CEN EN 16931 rules run unmodified (compiled to XSLT/SEF, executed with Saxon-JS) with the KoSIT scenario model — the same verdicts the public-sector receivers produce, proven file-by-file against the official validator.
- Sovereign by construction. Pure TypeScript/WASM, no Java at runtime, no network calls, nothing stored, nothing logged. Runs where the invoices are.
- Agent-native. Every tool returns structured content and a readable summary; findings carry DE/EN explanations, affected business terms and fix hints; generation is fail-honest (
validis the real verdict, never assumed). - ZUGFeRD both ways. Read the embedded XML out of any ZUGFeRD/Factur-X PDF; write PDF/A-3 invoices with
factur-x.xmlthat pass veraPDF and Mustang.
Five-minute quickstart
Requires Node ≥ 20. Everything — rules, schemas, code lists, fonts — ships inside the npm package; no downloads at runtime, no Java.
Claude Desktop — Settings → Developer → Edit Config, then quit (⌘Q) and reopen:
(From a source checkout use "command": "node", "args": ["/absolute/path/to/kontor-mcp/packages/server/dist/bin.js"] instead.)
Now audit a sample invoice. Ask Claude:
Audit
/absolute/path/to/kontor-mcp/packages/server/samples/broken-missing-buyer-reference.xml— is it valid?
You get a verdict (invalid), the finding BR-DE-15 (missing buyer reference / Leitweg-ID) with an explanation and fix hint, the recomputed totals and VAT breakdown, and a reject recommendation with its rationale. Then try a ZUGFeRD PDF:
What is in
/absolute/path/to/kontor-mcp/packages/server/samples/generated-zugferd-en16931.pdf?
(Attach XML files directly if you prefer; PDFs must be referenced by local path — Claude Desktop does not hand PDF bytes to MCP servers.)
Without a chat client, the MCP Inspector works headless:
kontor-agent CLI — the reference client; audit needs no LLM and returns 0/1/2 for accept/review/reject, chat is an Anthropic agent loop that prints every tool call (needs ANTHROPIC_API_KEY):
Docker / Streamable HTTP — the same server over HTTP for remote agents and containers (token required, loopback-published port, TLS is your reverse proxy's job):
Or cp .env.example .env && docker compose up -d (read-only root FS, ./invoices mounted at /data). Config surface and the security posture: packages/server/README.md, SECURITY.md.
Tools
Resources: kontor://samples/{name}, kontor://reference/rules, kontor://reference/codelists/{list}, kontor://reference/cheatsheet. Prompts: audit-incoming-invoice, draft-supplier-rejection, create-invoice-interview. Full reference with inputs and conventions: packages/server/README.md.
Sovereignty — and how we prove it
Architecture
The validation pipeline: Layer 1 XSD (xmllint-wasm) → Layer 2 official Schematron (Saxon-JS, KoSIT scenario selection and severity overrides) → Layer 3 Kontor plausibility (KONTOR-PLAUS-*: decimal recomputation, VAT rates, IBAN/BIC, Leitweg-ID check digits, dates, duplicates — never changes the official verdict). Money math is decimal.js only; every XML parse has DTD/external entities disabled.
Conformance
Details, commands and recorded reports: docs/CONFORMANCE.md.
Packages
FAQ
Is this legal or tax advice? No. Kontor reports formal and technical checks against the published standards and the legal timeline with its sources; decisions remain yours. Every answer carries that disclaimer.
Does it support XRechnung 3.0.2 / the 2025 rules? Yes: XRechnung 3.0.2, Schematron 2.5.0, validator configuration 2026-01-31, EN 16931 1.3.16. Versions are pinned and listed by list_capabilities.
Which ZUGFeRD profiles can it read and write? Read: MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED, XRECHNUNG (profile from the XMP). Write: EN 16931 (default), BASIC, EXTENDED — see D-042 for what BASIC drops.
Can I send it a PDF from Claude Desktop? Reference it by local path. Desktop does not pass attached PDF bytes to MCP servers; XML attachments work either way.
Why no Java when KoSIT's validator is Java? Sovereignty and installability: Schematron is compiled once at build time and executed in TypeScript (Saxon-JS). The Java tools are used only as oracles in CI to prove parity.
Windows? Yes — CI runs the full test suite on Ubuntu, macOS and Windows with Node 20 and 22.
Development
Read CONTRIBUTING.md before opening a PR; security issues go through SECURITY.md.
Docs
- Product Requirements · Implementation Plan · Decision log
- Conformance · Business-term coverage · Artefact provenance
- v0.1 Claude Desktop verification
License
Apache-2.0 — see LICENSE and NOTICE for bundled third-party components (KoSIT artefacts Apache-2.0, EN 16931 artefacts EUPL-1.2, Liberation Fonts OFL 1.1, ICC sRGB profile).
來源:README.md,提交 d957490
工具
0版本歷史
1- v1.0.4最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分