Skip to main content
Glama
einvoice-mcp

einvoice-mcp

E-Invoice MCP Server

MCP Server for e-invoices in the DACH region — create, validate, and extract data from XRechnung. Directly from Claude, Cursor, or any MCP client.

npm version License: MIT

What is this?

E-Invoice MCP is a Model Context Protocol server for creating and validating e-invoices according to the German XRechnung standard. Starting in 2027, all companies in Germany must be able to send e-invoices — this tool ensures you are prepared.

You simply tell Claude: "Create an invoice for Example GmbH for 10 hours of consulting" — and you receive a valid XRechnung as UBL 2.1 XML.

Related MCP server: mcp-facturacion-electronica-es

Features

  • Create XRechnung — Valid UBL 2.1 XML from structured data (EN 16931 + XRechnung 3.0.2)

  • Validate e-invoice — Check syntax, mandatory fields, and German business rules (BR-DE)

  • Extract data — Read structured data from UBL or CII XML

  • Format info — Reference guide for mandatory fields, tax categories, unit codes, and deadlines

  • Automatic calculation — Net, gross, and tax amounts are calculated automatically

  • Plugin-ready — Can run standalone OR be integrated into the BuchPilot MCP server

  • No external services — Everything runs locally, no API keys required

  • No native dependencies — Runs on any system with Node.js

Date

What happens

01.01.2025

All companies must be able to receive e-invoices

31.12.2026

PDF invoices only allowed with recipient consent

01.01.2027

Companies with >800,000 EUR revenue must send e-invoices

01.01.2028

ALL companies must send e-invoices

Incorrect e-invoices can lead to the loss of input tax deduction (+ 6% interest).

Installation

Prerequisites

  • Node.js >= 18

npm (global)

npm install -g einvoice-mcp

From source

git clone https://github.com/makririch/einvoice-mcp.git
cd einvoice-mcp
npm install
npm run build

Configuration

This MCP server requires no configuration. No API keys or external services are needed — everything runs locally.

Usage

Start server (standalone)

# Nach npm install -g:
einvoice-mcp

# Oder von Source:
npm start

# Entwicklung mit Auto-Reload:
npm run dev

The server runs via stdio and waits for MCP messages.

Use in Claude Desktop

See Claude Desktop Setup Guide for detailed instructions.

Short version — add to claude_desktop_config.json:

{
  "mcpServers": {
    "einvoice": {
      "command": "npx",
      "args": ["-y", "einvoice-mcp"]
    }
  }
}

Examples (natural language in Claude)

After configuring the server, you can ask Claude, for example:

  • "Create an XRechnung for Example GmbH for 10 hours of consulting at 150 EUR"

  • "Is this XML file a valid XRechnung?"

  • "Extract the invoice data from this XML"

  • "What mandatory fields do I need for an XRechnung?"

  • "What tax categories exist and what do they mean?"

  • "By when must my company be able to send e-invoices?"

Quickstart

A step-by-step guide "Create your first XRechnung in 5 minutes" can be found in docs/quickstart.md.

Tool Reference

A complete reference of all 4 tools with parameters, example inputs, and example outputs can be found in docs/tool-reference.md.

Quick Overview

Tool

Description

create_xrechnung

Create XRechnung (UBL 2.1 XML) from structured data

validate_invoice

Validate e-invoice XML (syntax + BR-DE business rules)

extract_data

Extract structured data from UBL or CII XML

get_format_info

Reference guide for formats, mandatory fields, codes, and deadlines

BuchPilot Integration

E-Invoice MCP can be integrated as a plugin into the BuchPilot MCP Server:

import { registerEInvoiceTools } from "einvoice-mcp";
registerEInvoiceTools(server);

Combination: BuchPilot creates an invoice in Lexoffice -> extract data -> generate XRechnung -> finished e-invoice.

Supported Standards

Standard

Version

Status

XRechnung

3.0.2

Create + Validate

EN 16931

—

Basis for XRechnung

UBL 2.1

—

XML syntax for XRechnung

CII (Cross Industry Invoice)

—

Extract (Read)

ZUGFeRD / Factur-X

2.3

Extract (Read), Creation planned

FAQ / Troubleshooting

"XML could not be parsed"

  • Is the XML well-formed? (Are all tags closed correctly?)

  • Is it actually a UBL or CII invoice? (Root element must be <Invoice> or <CrossIndustryInvoice>)

  • Is the encoding UTF-8?

Validation shows error "BR-DE-13: Buyer Reference is mandatory"

The buyer reference (BT-10) is mandatory in XRechnung. For invoices to public authorities, this is the Leitweg-ID. For B2B invoices, it can be any reference (e.g., purchase order number).

{
  "buyerReference": "04011000-12345-67"
}

This is just a warning, not an error. The invoice is still valid. For best compatibility, however, you should provide a phone number for the seller.

What tax categories exist?

Code

Name

Description

Tax rates

S

Standard

Normal tax rate

19%, 7%

Z

Zero rate

0% (e.g., intra-community with VAT exemption)

0%

E

Tax exempt

e.g., small business according to Section 19 UStG

0%

AE

Reverse Charge

Tax liability of the recipient (Section 13b UStG)

0%

K

Intra-community

Tax-free intra-community delivery

0%

What unit codes exist?

Code

Name

Description

H87

Piece

Single unit (default)

HUR

Hour

Working hour

DAY

Day

Working day

MON

Month

Calendar month

KGM

Kilogram

Weight

MTR

Meter

Length

LTR

Liter

Volume

MTK

Square meter

Area

SET

Set/Package

Assembly

C62

Unit (generic)

General quantity unit

Server starts, but Claude does not recognize the tools

  • Check if claude_desktop_config.json is correct

  • Restart Claude Desktop after configuration changes

  • Check the logs: ~/Library/Logs/Claude/mcp.log (macOS)

License

MIT — Free to use, including commercially.

Author

MaKri — GitHub

Available Tools

6 tools
convert_formatA

Konvertiert E-Rechnungen zwischen UBL (XRechnung), CII (ZUGFeRD) und JSON. Converts e-invoices between formats: ubl_to_cii, cii_to_ubl, ubl_to_json, cii_to_json, json_to_ubl, json_to_cii.

Inputs: direction (required), input (required), validate_output.

create_xrechnungC

Erstellt eine XRechnung (UBL 2.1 XML) aus strukturierten Daten. Konform zu EN 16931 + XRechnung 3.0.2. Creates a valid XRechnung XML from structured data.

Inputs: invoiceNumber (required), issueDate (required), seller (required), buyer (required), +11 more.

create_zugferdB

Erstellt ZUGFeRD 2.3 CII XML (Factur-X). Returns CII XML for embedding into PDF/A-3. Creates ZUGFeRD-compatible e-invoice XML in CII format.

Inputs: invoiceNumber (required), issueDate (required), seller (required), buyer (required), +9 more.

extract_dataC

Extrahiert strukturierte Daten aus einer E-Rechnung (UBL-XML oder CII-XML). Extracts structured data from an e-invoice XML.

Inputs: xml, base64.

get_format_infoB

Gibt Informationen ueber E-Rechnungs-Formate, Pflichtfelder, Steuer-Kategorien, Einheiten-Codes und gesetzliche Fristen zurueck. Useful reference for creating valid invoices.

Inputs: format, topic.

validate_invoiceC

Prueft ob XML eine gueltige E-Rechnung (XRechnung/ZUGFeRD) ist. Validiert Syntax, Pflichtfelder und deutsche Business-Regeln (BR-DE). Validates e-invoice XML.

Inputs: xml, base64, level.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: convert_format handles format conversion, create_xrechnung and create_zugferd create specific invoice types, extract_data extracts data from invoices, get_format_info provides reference information, and validate_invoice validates invoices. The descriptions reinforce these distinct roles, making tool selection unambiguous.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case: convert_format, create_xrechnung, create_zugferd, extract_data, get_format_info, and validate_invoice. This uniformity makes the tool set predictable and easy to navigate for an agent.

    Tool Count5/5

    With 6 tools, the server is well-scoped for e-invoice processing, covering creation, conversion, validation, data extraction, and reference information. Each tool earns its place without bloat, fitting typical expectations for a domain-specific server.

    Completeness4/5

    The tool set provides strong coverage for e-invoice workflows, including creation (XRechnung and ZUGFeRD), conversion between formats, validation, data extraction, and reference info. A minor gap is the lack of update or delete operations for invoices, but this is reasonable as invoices are typically immutable once created, and agents can work around this by recreating or modifying data externally.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      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.
      50
      46 PyPI
      2
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Model Context Protocol (MCP) server for Spanish Electronic Invoicing. Provides tools to generate, validate, and submit invoices across VERI\*FACTU, Facturae/FACe, SII, TicketBAI, and Crea y Crece B2B.
      20
      36 PyPI
      3
      Apache 2.0
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for German e-invoice compliance (XRechnung 3.0 & ZUGFeRD 2.x) enabling AI agents to validate, generate, parse, and check compliance of electronic invoices per EN 16931.
      6
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      MCP server for German e-invoicing with tools to generate and validate XRechnung CII XML locally, supporting German VAT rates and § 19 UStG.
      -