mcp-einvoicing-de
Model Context Protocol (MCP) server for German Electronic Invoicing (ZUGFeRD 2.x / XRechnung 3.x). Provides tools to validate, generate, parse, and convert invoices compliant with EN 16931 and KoSIT.
README
mcp-einvoicing-de đ©đȘ
<!-- mcp-name: io.github.cmendezs/mcp-einvoicing-de -->
MCP-Server (Model Context Protocol) in Python fĂŒr die deutsche elektronische Rechnung in den Formaten ZUGFeRD 2.x und XRechnung 3.x (EN 16931, FeRD, KoSIT). Ermöglicht KI-Agenten (Claude, IDEs) das Erstellen, Validieren, Parsen und Konvertieren von E-Rechnungen, die vollstĂ€ndig dem deutschen B2B-E-Rechnungsmandat (gĂŒltig ab 2025, schrittweise Durchsetzung bis 2027â2028) und der europĂ€ischen Norm EN 16931 entsprechen.
English summary
This is a Model Context Protocol (MCP) server for German electronic invoicing. It exposes 6 tools covering the full lifecycle of a ZUGFeRD or XRechnung invoice: creation (CII/UBL XML), validation against EN 16931 and KoSIT Schematron rules (BR-DE-*), parsing of existing invoice files, profile and syntax conversion, Peppol participant registration lookup (AS4), and German VAT rules (Steuerklassen, §13b UStG reverse charge, exemptions). Supports all ZUGFeRD 2.x profiles (MINIMUM through EXTENDED) and XRechnung 3.x (CII and UBL syntax). Licensed under Apache 2.0.
Aufgebaut auf
Dieses Paket basiert auf mcp-einvoicing-core, einer gemeinsamen Basisbibliothek fĂŒr europĂ€ische E-Rechnungs-MCP-Server. Sie stellt gemeinsame Modelle, Validierungsabstraktionen, XML-Hilfsfunktionen und die Ausnahmehierarchie bereit.
mcp-einvoicing-core wird automatisch als transitive AbhĂ€ngigkeit installiert â kein zusĂ€tzlicher Schritt erforderlich.
FĂŒr Entwickler:
pip install -e ".[dev]"installiert das Basispaket automatisch aus PyPI.
đïž Architektur
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
đ Installation
Ăber PyPI (empfohlen)
pip install mcp-einvoicing-de
Ohne vorherige Installation mit uvx:
uvx mcp-einvoicing-de
Aus den Quellen
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]"
âïž Konfiguration
Der Server benötigt in v0.1.0 keine externen Zugangsdaten. VerfĂŒgbare Umgebungsvariablen:
| Variable | Beschreibung | Standard |
|---|---|---|
EINVOICING_DE_LOG_LEVEL |
Protokollierungsgrad (DEBUG, INFO, WARNING, ERROR) |
INFO |
EINVOICING_DE_KOSIT_VALIDATOR_URL |
URL des KoSIT-Validierungstools (optional, fĂŒr Remote-Validierung) | â |
EINVOICING_DE_PEPPOL_SMP_URL |
Peppol-SMP-Lookup-URL (optional) | â |
EINVOICING_DE_PDF_ENGINE |
PDF-Generierungsmodul (reportlab oder pymupdf) |
reportlab |
đ€ Integration Claude Desktop
Eintrag in die Datei claude_desktop_config.json:
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}
âšïž Integration Cursor
Konfigurationsdatei (~/.cursor/mcp.json oder .cursor/mcp.json im Projektverzeichnis):
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}
đȘ Integration Kiro
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"],
"disabled": false,
"autoApprove": []
}
}
}
đ§° VerfĂŒgbare MCP-Werkzeuge
| Werkzeug | Beschreibung |
|---|---|
invoice_create |
ZUGFeRD- oder XRechnung-XML (CII oder UBL) erzeugen; PDF/A-3-Hybrid geplant (v0.2.0) |
invoice_validate |
Rechnung gegen EN 16931 und KoSIT-Schematron-Regeln (BR-DE-*) prĂŒfen |
invoice_parse |
Strukturierte Daten aus einer bestehenden ZUGFeRD- oder XRechnung-Datei extrahieren |
invoice_convert |
Zwischen ZUGFeRD-Profilen oder ZUGFeRD â XRechnung konvertieren |
peppol_check |
Peppol-Teilnehmerregistrierung eines deutschen Unternehmens prĂŒfen (AS4) |
tax_rules |
Deutsche Umsatzsteuerregeln abfragen (Steuerklassen, §13b UStG, Befreiungen) |
Verwendungsbeispiele
Beispiel 1 â Rechnung validieren
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"
}
Beispiel 2 â Deutsche Steuerregeln abfragen
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": "..."
}
Beispiel 3 â Peppol-Registrierung prĂŒfen
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"
}
Beispiel 4 â Rechnungsdaten parsen
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"
}
đ UnterstĂŒtzte Standards
| Standard | Version | Profile / Syntax |
|---|---|---|
| ZUGFeRD | 2.3 | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED |
| XRechnung | 3.x | CII (Cross Industry Invoice), UBL (Universal Business Language) |
| EN 16931 | â | EuropĂ€isches Kerndatenmodell fĂŒr die elektronische Rechnung |
| Peppol BIS | 3.0 | Billing 3.0 (DE PINT) |
Hinweis: ZUGFeRD 2.x und XRechnung 3.x teilen auf Profilebene EN 16931 dieselbe CII-XML-Syntax. Eine Konvertierung zwischen beiden Formaten ist daher ohne Datenverlust möglich. Das EXTENDED-Profil ist ZUGFeRD-spezifisch und hat kein XRechnung-Ăquivalent.
| Ressource | Link |
|---|---|
| FeRD ZUGFeRD-Spezifikation | ferd-net.de |
| KoSIT XRechnung | xeinkauf.de |
| KoSIT Validierungstool | github.com/itplr-kosit/validationtool |
| EN 16931-1:2017 | CEN |
| Peppol BIS Billing 3.0 | docs.peppol.eu |
đ§Ș Tests
# 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
Roadmap
| Version | Funktionen |
|---|---|
| v0.1.0 (aktuell) | Werkzeuge: create, validate, parse, convert, peppol_check, tax_rules |
| v0.2.0 | PDF/A-3-Einbettung (ZUGFeRD-Hybrid) via reportlab / PyMuPDF |
| v0.3.0 | KoSIT-Online-Validator vollstÀndig integriert |
| v0.4.0 | Peppol AS4 DirektĂŒbermittlung |
| v0.5.0 | DATEV-Exportformat |
| v1.0.0 | Produktionsreif, vollstÀndige EN 16931-Abdeckung |
Mitwirken
BeitrĂ€ge sind willkommen. Bitte öffnen Sie ein Issue, bevor Sie einen Pull Request fĂŒr wesentliche Ănderungen einreichen.
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
pip install -e ".[dev]"
pytest
make audit
Other e-invoicing MCP servers
| Country | Server |
|---|---|
| đ Global | mcp-einvoicing-core |
| đ§đȘ Belgium | mcp-einvoicing-be |
| đ«đ· France | mcp-facture-electronique-fr |
| đ©đȘ Germany | mcp-einvoicing-de |
| đźđč Italy | mcp-fattura-elettronica-it |
đ Lizenz
Dieses Projekt steht unter der Apache-2.0-Lizenz.
Einzelheiten finden Sie in der Datei LICENSE.
Copyright 2026 cmendezs
Projekt gepflegt von cmendezs. FĂŒr Fragen zur Implementierung der ZUGFeRD- oder XRechnung-Spezifikation bitte ein Issue eröffnen.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.