mcp-einvoicing-de
mcp-einvoicing-de 🇩🇪
ドイツの電子請求書(ZUGFeRD 2.xおよびXRechnung 3.x形式、EN 16931、FeRD、KoSIT準拠)のためのPython製MCP(Model Context Protocol)サーバーです。AIエージェント(Claude、IDEなど)が、ドイツのB2B電子請求書義務化(2025年施行、2027〜2028年にかけて段階的に義務化)および欧州規格EN 16931に完全に準拠した電子請求書の作成、検証、解析、変換を行えるようにします。
英語の概要
これはドイツの電子請求書のためのモデルコンテキストプロトコル(MCP)サーバーです。ZUGFeRDまたはXRechnung請求書のライフサイクル全体をカバーする6つのツールを提供します:作成(CII/UBL XML)、EN 16931およびKoSIT Schematronルール(BR-DE-*)に基づく検証、既存の請求書ファイルの解析、プロファイルおよび構文変換、Peppol参加者登録ルックアップ(AS4)、およびドイツのVATルール(税区分、§13b UStGリバースチャージ、免税)の照会。すべてのZUGFeRD 2.xプロファイル(MINIMUMからEXTENDEDまで)およびXRechnung 3.x(CIIおよびUBL構文)をサポートしています。ライセンスはApache 2.0です。
Related MCP server: mcp-facture-electronique-fr
基盤
このパッケージは、欧州の電子請求書MCPサーバー用の共通基盤ライブラリであるmcp-einvoicing-coreに基づいています。共通モデル、検証の抽象化、XMLヘルパー関数、例外階層を提供します。
mcp-einvoicing-coreは推移的依存関係として自動的にインストールされるため、追加の手順は不要です。
開発者向け:
pip install -e ".[dev]"を実行すると、PyPIから基本パッケージが自動的にインストールされます。
🏗️ アーキテクチャ
mcp-einvoicing-de (dieses Paket — eigenständiger MCP-Server)
├── ZUGFeRDInvoice / XRechnungInvoice ← Pydantic-Modelle (alle Profile)
├── SchematronValidator ← EN 16931 + KoSIT BR-DE-* Regeln
├── KoSITValidator ← Remote-Validierungstool (optional)
└── Tools: create / validate / parse / convert / peppol_check / tax_rules
↑ erweitert
mcp-einvoicing-core (gemeinsame Basis, als Abhängigkeit installiert)
├── BaseDocumentGenerator / Validator / Parser
├── BaseInvoice, BaseParty … (Pydantic)
├── xml_utils, exceptions
└── EInvoicingMCPServer🚀 インストール
PyPI経由(推奨)
pip install mcp-einvoicing-deインストールせずに uvx を使用する場合:
uvx mcp-einvoicing-deソースから
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"⚙️ 設定
v0.1.0では、サーバーに外部の認証情報は必要ありません。利用可能な環境変数は以下の通りです:
変数 | 説明 | デフォルト |
| ログレベル ( |
|
| KoSIT検証ツールのURL(オプション、リモート検証用) | — |
| Peppol SMPルックアップURL(オプション) | — |
| PDF生成エンジン ( |
|
🤖 Claude Desktopへの統合
claude_desktop_config.json ファイルへの記述:
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}⌨️ Cursorへの統合
設定ファイル (~/.cursor/mcp.json またはプロジェクトディレクトリ内の .cursor/mcp.json):
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}🪐 Kiroへの統合
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"],
"disabled": false,
"autoApprove": []
}
}
}🧰 利用可能なMCPツール
ツール | 説明 |
| ZUGFeRDまたはXRechnung XML (CIIまたはUBL) を生成。PDF/A-3ハイブリッド対応を予定 (v0.2.0) |
| EN 16931およびKoSIT Schematronルール (BR-DE-*) に基づいて請求書をチェック |
| 既存のZUGFeRDまたはXRechnungファイルから構造化データを抽出 |
| ZUGFeRDプロファイル間、またはZUGFeRD ↔ XRechnung間の変換 |
| ドイツ企業のPeppol参加者登録を確認 (AS4) |
| ドイツの付加価値税ルール(税区分、§13b UStG、免税)を照会 |
使用例
例1 — 請求書の検証
1. invoice_validate(
xml_base64="...", # Base64-kodiertes ZUGFeRD-XML
strict=True
)
→ {
"is_valid": true,
"profile": "EN_16931",
"syntax": "CII",
"error_count": 0,
"warning_count": 2,
"errors": [],
"warnings": [...],
"validator_used": "local_schematron"
}例2 — ドイツの税ルールの照会
2. tax_rules(query="reverse_charge", context="Bauleistungen")
→ {
"results": [
{
"paragraph": "§13b Abs. 2 Nr. 5 UStG",
"description_en": "Construction services (building contractor rule)",
"vatex_code": "VATEX-EU-AE",
"invoice_note": "Steuerschuldnerschaft des Leistungsempfängers (§13b UStG)"
}
],
"legal_disclaimer": "..."
}例3 — Peppol登録の確認
3. peppol_check(
participant_id="0204:991-1234512345-06",
environment="production"
)
→ {
"is_registered": true,
"participant_id": "0204:991-1234512345-06",
"document_type_supported": true,
"access_point_url": "https://ap.example.de/as4",
"transport_profile": "peppol-transport-as4-v2.0"
}例4 — 請求書データの解析
4. invoice_parse(xml_base64="...", include_raw_xml=False)
→ {
"profile": "XRECHNUNG",
"syntax": "CII",
"invoice_number": "RE-2025-001",
"invoice_date": "2025-01-15",
"seller_name": "Muster GmbH",
"buyer_name": "Käufer AG",
"tax_inclusive_amount": "119.00",
"currency_code": "EUR"
}📚 サポートされている規格
規格 | バージョン | プロファイル / 構文 |
ZUGFeRD | 2.3 | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED |
XRechnung | 3.x | CII (Cross Industry Invoice), UBL (Universal Business Language) |
EN 16931 | — | 電子請求書のための欧州コアデータモデル |
Peppol BIS | 3.0 | Billing 3.0 (DE PINT) |
注意: ZUGFeRD 2.xとXRechnung 3.xは、EN 16931プロファイルレベルで同じCII XML構文を共有しています。そのため、データ損失なしで両形式間の変換が可能です。EXTENDEDプロファイルはZUGFeRD固有のものであり、XRechnungには相当するものがありません。
リソース | リンク |
FeRD ZUGFeRD仕様 | |
KoSIT XRechnung | |
KoSIT検証ツール | |
EN 16931-1:2017 | |
Peppol BIS Billing 3.0 |
🧪 テスト
# Entwicklungsabhängigkeiten installieren
pip install -e ".[dev]"
# Gesamte Testsuite ausführen
pytest tests/ -v
# Mit Abdeckungsbericht
pytest --cov=mcp_einvoicing_de --cov-report=term-missing
# Nur Modell-Tests
pytest tests/test_models.py -vロードマップ
バージョン | 機能 |
v0.1.0 (現在) | ツール: create, validate, parse, convert, peppol_check, tax_rules |
v0.2.0 |
|
v0.3.0 | KoSITオンラインバリデーターの完全統合 |
v0.4.0 | Peppol AS4直接送信 |
v0.5.0 | DATEVエクスポート形式 |
v1.0.0 | 本番環境対応、EN 16931の完全網羅 |
貢献
貢献を歓迎します。重要な変更のプルリクエストを送信する前に、Issueを作成してください。
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
pip install -e ".[dev]"
pytest
make auditその他の電子請求書MCPサーバー
国 | サーバー |
🌍 グローバル | |
🇧🇪 ベルギー | |
🇫🇷 フランス | |
🇮🇹 イタリア | |
🇩🇪 ドイツ |
📄 ライセンス
このプロジェクトは Apache-2.0ライセンス の下で提供されています。 詳細は LICENSE ファイルを参照してください。
Copyright 2026 cmendezs
プロジェクト管理: cmendezs。ZUGFeRDまたはXRechnung仕様の実装に関する質問は、Issueを作成してください。
Available Tools
50 toolsbuild_mls_messageBuild Mls MessageA
Build a document-level MLS response and return it base64-encoded.
For per-line responses, build the document directly with
mcp_einvoicing_core.peppol.mls.build_mls.
Inputs: mls_id (required), issue_date (required), sender_value (required), response_code (required), +7 more. Returns: object
check_allowance_reason_codeCheck Allowance Reason CodeA
Check whether code is a recognized allowance reason code.
Inputs: code (required). Returns: object
check_charge_reason_codeCheck Charge Reason CodeA
Check whether code is a recognized charge reason code.
Inputs: code (required). Returns: object
check_country_codeCheck Country CodeA
Check whether code is a recognized ISO 3166-1 alpha-2 country code.
Inputs: code (required). Returns: object
check_currency_codeCheck Currency CodeA
Check whether code is a recognized ISO 4217 currency code.
Inputs: code (required). Returns: object
check_document_name_codeCheck Document Name CodeA
Check whether code is a recognized UNCL1001 document name code.
Inputs: code (required). Returns: object
check_document_type_id_in_codelistCheck Document Type Id In CodelistA
Check whether a (scheme, value) pair is a recognized Peppol document type identifier.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Searches all entries regardless of state, so a historical (deprecated
or removed) document type is still reported as found.
Inputs: value (required), scheme (required). Returns: object
check_eas_codeCheck Eas CodeA
Check whether code is a recognized Electronic Address Scheme code.
Inputs: code (required). Returns: object
check_icd_codeCheck Icd CodeA
Check whether code is a recognized ISO 6523 ICD code.
Inputs: code (required). Returns: object
check_item_type_codeCheck Item Type CodeB
Check whether code is a recognized item type identification code.
Inputs: code (required). Returns: object
check_mime_codeCheck Mime CodeA
Check whether code is a recognized MIME type for embedded attachments.
Inputs: code (required). Returns: object
check_participant_id_scheme_in_codelistCheck Participant Id Scheme In CodelistA
Check whether a 4-digit ISO 6523 ICD code (e.g. "0208") is a recognized Peppol scheme.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: icd (required). Returns: object
check_payment_means_codeCheck Payment Means CodeA
Check whether code is a recognized UNCL4461 payment means code.
Inputs: code (required). Returns: object
check_process_id_in_codelistCheck Process Id In CodelistA
Check whether a (scheme, value) pair is a recognized Peppol process identifier.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: value (required), scheme (required). Returns: object
check_reference_qualifier_codeCheck Reference Qualifier CodeA
Check whether code is a recognized UNCL1153 reference qualifier code.
Inputs: code (required). Returns: object
check_vat_category_codeCheck Vat Category CodeA
Check whether code is a recognized UNCL5305 VAT category code.
Inputs: code (required). Returns: object
check_vatex_codeCheck Vatex CodeA
Check whether code is a recognized VATEX VAT exemption reason code.
Inputs: code (required). Returns: object
datev_exportDatev ExportA
Export a ZUGFeRD invoice to DATEV CSV format (EXTF 700, Buchungsstapel).
Produces a CSV file importable by DATEV Belegtransfer or DATEV Rechnungswesen. Maps invoice line items to DATEV booking records with configurable accounts.
Inputs: invoice (required), client_number, revenue_account, consultant_number, +2 more. Returns: object
get_en16931_codelist_versionGet En16931 Codelist VersionA
Report the CEF EN 16931 code-list release version(s) currently configured locally.
Inputs: no named parameters. Returns: object
get_peppol_codelist_versionGet Peppol Codelist VersionA
Report the OpenPeppol eDEC code list release version(s) currently configured locally.
Inputs: no named parameters. Returns: object
invoice_convertInvoice ConvertA
Convert a ZUGFeRD or XRechnung invoice to a different profile or syntax.
Supports ZUGFeRD profile upgrades and downgrades, ZUGFeRD <-> XRechnung conversion, and cross-syntax CII <-> UBL transformation. Profile downgrades may result in data loss; set allow_data_loss=True to permit this.
Inputs: target_profile (required), xml_base64, xml_content, target_syntax, +1 more. Returns: object
invoice_createInvoice CreateA
Generate a ZUGFeRD 2.x or XRechnung 3.x invoice in XML (CII or UBL) format.
Supports all ZUGFeRD profiles: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED. For XRechnung, set profile to XRECHNUNG and choose CII or UBL syntax. When the buyer is a German VAT-registered business (DE-prefixed VAT id), the Wachstumschancengesetz B2B mandate (effective 2025-01-01, §14 Abs. 2 UStG) requires a structured EN 16931 invoice. Non-XML output is rejected unless transitional_period_opt_in is set to True (allowed only 2025-2026 with the buyer's written consent).
Inputs: invoice (required), syntax, pretty_print, output_format, +1 more. Returns: object
invoice_parseInvoice ParseA
Extract structured data from a ZUGFeRD 2.x or XRechnung 3.x invoice.
Accepts raw XML (CII or UBL), base64-encoded XML, or base64-encoded PDF (ZUGFeRD hybrid — the XML is extracted from the PDF/A-3 attachment). Returns a structured JSON object matching the invoice data model.
Inputs: pdf_base64, xml_base64, xml_content, include_raw_xml. Returns: object
invoice_validateInvoice ValidateA
Validate a ZUGFeRD 2.x or XRechnung 3.x invoice XML.
Checks against EN 16931 rules and German KoSIT Schematron rules (BR-DE-* business rules). Returns a structured validation report with errors and warnings. Supports all ZUGFeRD profiles (MINIMUM through EXTENDED) and XRechnung (CII and UBL syntax). Profile and syntax are auto-detected if not specified. By default this validator runs entirely locally (Schematron only). Set cloud_validate=True (or EINVOICING_DE_KOSIT_ENABLE=1) to opt in to sending the invoice XML to a remote KoSIT endpoint. Doing so egresses the full invoice payload.
Inputs: strict, syntax, profile, xml_base64, +4 more. Returns: object
list_allowance_reason_codesList Allowance Reason CodesA
List allowance reason codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_charge_reason_codesList Charge Reason CodesA
List charge reason codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_country_codesList Country CodesA
List ISO 3166-1 alpha-2 country codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_currency_codesList Currency CodesA
List ISO 4217 currency codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_document_name_codesList Document Name CodesA
List UNCL1001 document name codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_document_type_idsList Document Type IdsA
List Peppol document type identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_eas_codesList Eas CodesA
List Electronic Address Scheme (EAS) codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_icd_codesList Icd CodesA
List ISO 6523 ICD codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_item_type_codesList Item Type CodesA
List item type identification codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_mime_codesList Mime CodesB
List recognized MIME types for embedded attachments.
Inputs: no named parameters. Returns: object
list_participant_id_schemesList Participant Id SchemesA
List Peppol participant identifier (ICD) schemes from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR to point at a local copy of
the eDEC "Participant Identifier Schemes" GeneriCode export (not
bundled with this package, no confirmed redistribution rights, see
mcp_einvoicing_core.peppol.codelists module docstring).
Inputs: active_only. Returns: object
list_payment_means_codesList Payment Means CodesA
List UNCL4461 payment means codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_process_idsList Process IdsA
List Peppol process identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_reference_qualifier_codesList Reference Qualifier CodesA
List UNCL1153 reference qualifier codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_spis_use_case_idsList Spis Use Case IdsA
List Peppol SPIS use case identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_vat_category_codesList Vat Category CodesA
List UNCL5305 VAT category codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_vatex_codesList Vatex CodesA
List VATEX (VAT exemption reason) codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
peppol_directory_searchPeppol Directory SearchA
Search the Peppol Directory for registered participants.
Public, unauthenticated search (no relation to SMP lookup). At least one of q/participant/name/country/doctype must be supplied.
Inputs: q, name, country, doctype, +4 more. Returns: object
peppol_get_service_endpointPeppol Get Service EndpointA
Fetch the AS4 endpoint for a Peppol participant's document type.
Resolves the SMP hostname via DNS, then fetches service metadata for
document_type_id. If the SMP returns a redirect, the result's
redirect_url is set and endpoint_url is None; callers must not
follow more than one redirect hop (SMP 1.4.0 §3.2).
Inputs: identifier (required), environment, document_type_id. Returns: object
peppol_lookup_participantPeppol Lookup ParticipantA
Check whether a business is registered on the Peppol network.
Performs a DNS-over-HTTPS U-NAPTR lookup followed by an SMP service-group request to determine registration status and the list of supported document type identifiers.
Inputs: identifier (required), environment. Returns: object
peppol_sendPeppol SendA
Send a UBL/CII invoice to a Peppol participant via AS4.
Looks up the recipient's AS4 endpoint (SMP), builds the ebMS3/AS4 envelope, and transmits it using the supplied signing credentials.
Inputs: sender_id (required), certificate_path (required), private_key_path (required), invoice_xml_base64 (required), +4 more. Returns: object
resolve_peppol_dnsResolve Peppol DnsA
Resolve the SMP hostname for a Peppol participant via DNS only.
Performs the raw U-NAPTR (SML) lookup without fetching the SMP service group, useful for diagnosing whether a participant is registered in the SML independently of SMP reachability.
Inputs: identifier (required), environment. Returns: object
tax_rulesTax RulesA
Query German VAT rules for e-invoicing.
Returns structured information about VAT rates (19%, 7%), VAT category codes, reverse charge rules under §13b UStG, zero-rate and exemption provisions (§4 UStG), intra-community supply rules, and VATEX exemption reason codes. For use when building invoice creation logic or validating VAT treatment.
Inputs: query (required), context. Returns: object
validate_eusr_reportValidate Eusr ReportA
Validate a Peppol End User Statistics Report (EUSR) document.
Runs XSD structural validation, then Schematron business rules
(requires the [xslt2] optional extra).
Inputs: report_xml_base64 (required). Returns: object
validate_mls_messageValidate Mls MessageA
Validate a Peppol Message Level Status (MLS) document.
Runs the bundled MLS Schematron rules (requires the [xslt2]
optional extra). No bespoke MLS XSD exists — full UBL 2.1 XSD
validation is out of scope.
Inputs: mls_xml_base64 (required). Returns: object
validate_tsr_reportValidate Tsr ReportA
Validate a Peppol Transaction Statistics Report (TSR) document.
Runs XSD structural validation, then Schematron business rules
(requires the [xslt2] optional extra).
Inputs: report_xml_base64 (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
The tool set has many code list checking tools that follow a clear pattern (list_X_codes/check_X_code), which are distinct from the invoice processing tools. However, there are repeated tools (e.g., list_eas_codes appears twice in the provided list) and some closely related validation tools (TSR vs MLS vs EUSR) that could cause confusion.
Most tools follow consistent verb_noun patterns: check_, list_, get_, create_, validate_. There are minor deviations like `peppol_lookup_participant` and `resolve_peppol_dns` using different prefixes, but overall the naming is predictable and clear.
50+ tools is excessive, largely driven by repetitive list_x_codes/check_x_code pairs for each codelist. The core invoice functionality is only ~5 tools, while code-list helpers dominate the surface.
The invoice lifecycle is well covered with create/validate/convert/export, and Peppol lookup/send tools cover the main delivery flow. Missing operations like cancel or fetch invoice history are minor for the domain scope.
Maintenance
Related MCP Connectors
Validate, parse, fix and render e-invoices: XRechnung, ZUGFeRD, Peppol, KSeF, Facturae, MyInvois
Create ZUGFeRD e-invoices from JSON or PDF, verify Factur-X, check VAT IDs and Peppol.
Validate XRechnung, ZUGFeRD and Factur-X with the KoSIT validator and create valid e-invoices.
Create and validate XRechnung, ZUGFeRD and Peppol e-invoices (KoSIT); Peppol lookup, rule help.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for DACH e-invoicing. Create XRechnung (UBL) and ZUGFeRD 2.3 (Factur-X CII) invoices, validate against EN 16931 rules, extract data from XML, and convert between UBL, CII and JSON formats.650 npm2MIT
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for French Electronic Invoicing (NF XP Z12-013). Provide tools to validate, generate, and explore API specifications for PDP/OD interoperability.341Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Italian Electronic Invoicing (FatturaPA / SDI). Provide tools to validate, generate, and explore API specifications for Sistema di Interscambio (SDI) interoperability.4393 PyPI2Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Belgian Electronic Invoicing (Peppol BIS 3.0 / PINT-BE / Mercurius). Provides tools to validate, generate, and transform UBL 2.1 e-invoices, and look up BCE/KBO enterprise data and Peppol participants.50297 PyPIApache 2.0