mcp-einvoicing-de
This server handles the full lifecycle of German electronic invoices (ZUGFeRD 2.x and XRechnung 3.x), compliant with EN 16931 and German B2B e-invoicing mandates.
Create Invoices (
invoice_create): Generate ZUGFeRD or XRechnung invoices in CII or UBL XML format, supporting all ZUGFeRD profiles (MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED) and XRechnung 3.x.Validate Invoices (
invoice_validate): Validate invoice XML against EN 16931 rules and German KoSIT Schematron business rules (BR-DE-*), with auto-detection of profile/syntax, optional strict mode, and optional remote KoSIT validator integration.Parse Invoices (
invoice_parse): Extract structured JSON data from ZUGFeRD or XRechnung files provided as raw XML, base64-encoded XML, or base64-encoded PDF (ZUGFeRD hybrid PDF/A-3).Convert Invoices (
invoice_convert): Convert between ZUGFeRD profiles (upgrades/downgrades), between ZUGFeRD and XRechnung, and between CII and UBL syntax (XRechnung only).Check Peppol Registration (
peppol_check): Verify if a German company is registered on the Peppol network via live DNS + SMP lookup, returning registration status, supported document types, and AS4 endpoint URL.Query German VAT Rules (
tax_rules): Look up VAT rates (19%, 7%), VAT category codes, reverse charge rules (ยง13b UStG), zero-rate/exemption provisions (ยง4 UStG), intra-community supply rules, and VATEX exemption reason codes.
mcp-einvoicing-de ๐ฉ๐ช
MCP server (Model Context Protocol) in Python for German electronic invoicing in ZUGFeRD 2.x and XRechnung 3.x formats (EN 16931, FeRD, KoSIT). Enables AI agents (Claude, IDEs) to create, validate, parse, and convert e-invoices that are fully compliant with the German B2B e-invoicing mandate (effective from 2025, phased enforcement through 2027 to 2028) and the European standard EN 16931.
๐๏ธ Built on
This package is built on mcp-einvoicing-core, a shared base library for European e-invoicing MCP servers. It provides shared models, validation abstractions, XML utilities, and the exception hierarchy.
mcp-einvoicing-core is automatically installed as a transitive dependency, no additional step required.
For developers:
pip install -e ".[dev]"installs the base package automatically from PyPI.
Related MCP server: mcp-facture-electronique-fr
๐๏ธ Architecture
mcp-einvoicing-de (this package, standalone MCP server)
โโโ ZUGFeRDInvoice / XRechnungInvoice โ Pydantic models (all profiles)
โโโ SchematronValidator โ EN 16931 + KoSIT BR-DE-* rules
โโโ KoSITValidator โ Remote validation tool (optional)
โโโ Tools: create / validate / parse / convert / peppol_check / tax_rules
โ extends
mcp-einvoicing-core (shared base, installed as dependency)
โโโ BaseDocumentGenerator / Validator / Parser
โโโ BaseInvoice, BaseParty โฆ (Pydantic)
โโโ xml_utils, exceptions
โโโ EInvoicingMCPServer๐ Installation
Via PyPI (recommended)
pip install mcp-einvoicing-deWithout prior installation, using uvx:
uvx mcp-einvoicing-deFrom source
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]"Optional extras
Extra | Purpose | Install |
| Saxon-HE backend for XSLT 2.0 Schematron stylesheets (FeRD Factur-X 1.08 and KoSIT XRechnung 3.0.2). Required for local Schematron validation; lxml supports XSLT 1.0 only. |
|
| PDF/A-3 hybrid invoice generation and embedded XML extraction (uses |
|
| Alternative PDF engine (uses |
|
| Development tools (pytest, ruff, pre-commit). |
|
โ๏ธ Configuration
The server does not require external credentials. Available environment variables:
Variable | Description | Default |
| Log level ( |
|
| URL of a self-hosted KoSIT validation tool REST endpoint (optional, enables remote validation when set) |
๐ค Claude Desktop integration
Add the following entry to claude_desktop_config.json:
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}โจ๏ธ Cursor integration
Configuration file (~/.cursor/mcp.json or .cursor/mcp.json in the project directory):
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}๐ช Kiro integration
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"],
"disabled": false,
"autoApprove": []
}
}
}๐งฐ Available MCP tools
Tool | Description |
| Generate ZUGFeRD or XRechnung XML (CII or UBL). Enforces the ยง14 Abs. 2 UStG B2B mandate: non-XML output is rejected for DE-prefixed VAT buyers unless |
| Validate an invoice against EN 16931 and KoSIT Schematron rules (BR-DE-*). XSLT 2.0 FeRD and KoSIT stylesheets execute via Saxon-HE when the |
| Extract structured data from ZUGFeRD or XRechnung XML, or from a PDF/A-3 hybrid invoice with embedded |
| Convert between ZUGFeRD profiles or swap ZUGFeRD CII and XRechnung CII headers. Cross-syntax CII to UBL transformation is rejected pending v0.4.0. |
| Check Peppol participant registration of a German company. Lookup only; AS4 outbound transmission is tracked as DE-PEPPOL-1 for v0.5.0. |
| Query German VAT rules (rates, ยง13b UStG reverse charge codes, ยง19 UStG Kleinunternehmer thresholds at JStG 2024 values of โฌ25,000 preceding year / โฌ100,000 current year, exemptions). |
Usage examples
Example 1: Validate an invoice
1. invoice_validate(
xml_base64="...", # Base64-encoded ZUGFeRD XML
strict=True
)
โ {
"is_valid": true,
"profile": "EN_16931",
"syntax": "CII",
"error_count": 0,
"warning_count": 2,
"errors": [],
"warnings": [...],
"validator_used": "local_schematron"
}Example 2: Query German tax rules
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": "..."
}Example 3: Check Peppol registration
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"
}Example 4: Parse invoice data
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"
}๐ Supported standards
Standard | Version | Profiles / Syntax |
ZUGFeRD | 2.3.2 | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED |
XRechnung | 3.0.2 | CII (Cross Industry Invoice), UBL (Universal Business Language) |
EN 16931 | 2017 | European core data model for electronic invoicing |
Peppol BIS | 3.0 | Billing 3.0 (EN 16931-compliant) |
Note: ZUGFeRD 2.x and XRechnung 3.x share the same CII XML syntax at the EN 16931 profile level. Conversion between both formats is therefore possible without data loss. The EXTENDED profile is specific to ZUGFeRD and has no XRechnung equivalent.
Resource | Link |
FeRD ZUGFeRD specification | |
KoSIT XRechnung | |
KoSIT validation tool | |
EN 16931-1:2017 | |
Peppol BIS Billing 3.0 |
๐งช Tests
# Install development dependencies
pip install -e ".[dev]"
# Run the full test suite
pytest tests/ -v
# With coverage report
pytest --cov=mcp_einvoicing_de --cov-report=term-missing
# Model tests only
pytest tests/test_models.py -vRoadmap
Current version: v0.3.1. Upcoming releases:
Version | Features |
v0.4.0 | Full ISO 19005-3 level B in |
v0.5.0 | Peppol AS4 outbound transmission (DE-PEPPOL-1); DATEV import format export (DE-DATEV-1) |
v1.0.0 | Production-ready: full EN 16931 coverage, KoSIT cloud canary corpus, performance benchmarks, 95% line coverage with mutation tests, end-to-end integration test against the cloud validator |
For the history of past releases, see RELEASE.md.
Contributing
Contributions are welcome. Please open an issue before submitting a pull request for significant changes.
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
pip install -e ".[dev]"
pytest
make auditOther e-invoicing MCP servers
Country | Server |
๐ Global | |
๐ง๐ช Belgium | |
๐ง๐ท Brazil | |
๐ซ๐ท France | |
๐ฉ๐ช Germany | |
๐ฎ๐น Italy | |
๐ต๐ฑ Poland | |
๐ช๐ธ Spain |
๐ License
This project is licensed under the Apache 2.0 License.
See the LICENSE file for details.
Copyright 2026 cmendezs
Project maintained by cmendezs. For questions about the ZUGFeRD or XRechnung specification implementation, please open an issue.
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-einvoicing-de'
If you have feedback or need assistance with the MCP directory API, please join our Discord server