XRechnung/ZUGFeRD with n8n -- E-Invoice automation for Germany (2027 deadline)

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:

  1. validate_invoice – Check if XML/PDF is a valid e-invoice (syntax, schema, business rules)
  2. create_xrechnung – Generate XRechnung 3.0.2 XML from structured data
  3. create_zugferd – Generate ZUGFeRD 2.3 PDF (CII XML embedded in PDF/A-3)
  4. convert_format – Convert between UBL, CII, and JSON
  5. extract_data – Extract structured data from e-invoices (XML or ZUGFeRD PDF)
  6. 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:

  1. Trigger: New invoice in your accounting tool
  2. Fetch invoice data
  3. Call einvoice-mcp to create XRechnung XML
  4. Validate the XML
  5. Send to the recipient or upload to a portal

Links

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!

Worth adding to this thread: if you want to skip building the XML pipeline and PDF/A-3 embedding yourself, SealDoc has native n8n nodes (npm i n8n-nodes-sealdoc) that handle the full Factur-X/ZUGFeRD generation including profile selection and validation in one node. Also covers XRechnung-DE for German federal buyers. The nodes include Document·Generate, Invoice·Generate, Validator·Check and Peppol·Check. Might save a few hours vs rolling your own CII XML.

please check the following urls for more info:

Hope it helps!