Background
Germany is making electronic invoicing (E-Rechnung) mandatory:
- Jan 2025: All businesses must be able to RECEIVE e-invoices
- Jan 2027: Businesses with >800K EUR revenue must SEND e-invoices
- Jan 2028: ALL businesses must send e-invoices
The two accepted formats are XRechnung (UBL 2.1 XML) and ZUGFeRD (CII XML embedded in PDF/A-3).
What I built
I created an MCP server called einvoice-mcp that handles XRechnung and ZUGFeRD creation, validation, and conversion. While it’s primarily designed for AI agents (Claude, GPT, etc.), it can also be used programmatically in any Node.js project – including n8n.
6 Tools:
- validate_invoice – Check if XML/PDF is a valid e-invoice (syntax, schema, business rules)
- create_xrechnung – Generate XRechnung 3.0.2 XML from structured data
- create_zugferd – Generate ZUGFeRD 2.3 PDF (CII XML embedded in PDF/A-3)
- convert_format – Convert between UBL, CII, and JSON
- extract_data – Extract structured data from e-invoices (XML or ZUGFeRD PDF)
- get_format_info – Reference for required fields, tax categories, unit codes, deadlines
Validation includes 20 German business rules (BR-DE):
- BR-DE-01: Payment instructions required
- BR-DE-02: Bank account required for bank transfers
- BR-DE-07: Seller must have VAT ID or tax number
- BR-DE-13: Buyer Reference (BT-10) is mandatory
- BR-DE-18: IBAN format validation
- …and 15 more
Using it with n8n
You can call einvoice-mcp from n8n using the Execute Command node or via an HTTP endpoint if you run the server with a transport layer. Example workflow:
- Trigger: New invoice in your accounting tool
- Fetch invoice data
- Call einvoice-mcp to create XRechnung XML
- Validate the XML
- Send to the recipient or upload to a portal
Links
- npm: https://www.npmjs.com/package/einvoice-mcp
- GitHub: GitHub - makririch/einvoice-mcp: MCP Server for German e-invoicing: XRechnung (UBL 2.1) and ZUGFeRD (CII/Factur-X). EN 16931 compliant. · GitHub
- License: MIT
If you’re in Germany and worried about the 2027 deadline – this might help. The XRechnung format is well-documented but painful to implement manually. This tool handles the XML generation, validation, and the 20 most important German business rules.
Feedback and questions welcome!