mcp-einvoicing-de
v0.11.5German e-invoicing MCP server: ZUGFeRD 2.x, XRechnung 3.x, EN 16931, KoSIT validation, Peppol.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
invoice_create Invoice Create
Generate a ZUGFeRD 2.x or XRechnung 3.x invoice in XML (CII or UBL) format. Supports all ZUGFeRD profiles: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED. For XRechnung, set profile to XRECHNUNG and choose CII or UBL syntax. When the buyer is a German VAT-registered business (DE-prefixed VAT id), the Wachstumschancengesetz B2B mandate (effective 2025-01-01, §14 Abs. 2 UStG) requires a structured EN 16931 invoice. Non-XML output is rejected unless transitional_period_opt_in is set to True (allowed only 2025-2026 with the buyer's written consent).
| Parameter | Type | Description |
|---|---|---|
invoice * | object | Invoice data matching the ZUGFeRDInvoice schema. Set invoice.profile to XRECHNUNG to produce an XRechnung invoice. |
output_format | string | 'xml' (default) or 'pdf' (ZUGFeRD hybrid PDF/A-3). |
pretty_print | boolean | Pretty-print the XML output. |
syntax | string | XML syntax: 'CII' (default) or 'UBL' (XRechnung only). |
transitional_period_opt_in | boolean | Acknowledge the Wachstumschancengesetz transitional period (2025-2026) and explicitly permit non-XML output for a German VAT-registered buyer. Set to True only when the buyer has agreed in writing to… |
invoice_validate Invoice Validate
Validate a ZUGFeRD 2.x or XRechnung 3.x invoice XML. Checks against EN 16931 rules and German KoSIT Schematron rules (BR-DE-* business rules). Returns a structured validation report with errors and warnings. Supports all ZUGFeRD profiles (MINIMUM through EXTENDED) and XRechnung (CII and UBL syntax). Profile and syntax are auto-detected if not specified. By default this validator runs entirely locally (Schematron only). Set cloud_validate=True (or EINVOICING_DE_KOSIT_ENABLE=1) to opt in to sending the invoice XML to a remote KoSIT endpoint. Doing so egresses the full invoice payload.
| Parameter | Type | Description |
|---|---|---|
cloud_validate | boolean | Opt in to sending the invoice XML to a remote KoSIT endpoint (egresses the full invoice payload). Local Schematron only by default. |
kosit_strict | boolean | If True, fail hard when the KoSIT cloud validator is unreachable instead of falling back to local Schematron. |
profile | Override profile detection. One of: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED, XRECHNUNG. If omitted, auto-detected from the XML GuidelineID. | |
strict | boolean | If True, warnings are also reported. If False, only errors are returned. |
syntax | Override syntax detection. One of: CII, UBL. If omitted, auto-detected from the XML root element namespace. | |
use_local_only | [Deprecated] Use cloud_validate instead. use_local_only=True is equivalent to cloud_validate=False, which is now the default; this alias is retained for one release and will be removed. | |
xml_base64 | Base64-encoded XML bytes of the invoice. | |
xml_content | Raw XML string of the invoice to validate. Provide either xml_content or xml_base64, not both. |
invoice_parse Invoice Parse
Extract structured data from a ZUGFeRD 2.x or XRechnung 3.x invoice. Accepts raw XML (CII or UBL), base64-encoded XML, or base64-encoded PDF (ZUGFeRD hybrid — the XML is extracted from the PDF/A-3 attachment). Returns a structured JSON object matching the invoice data model.
| Parameter | Type | Description |
|---|---|---|
include_raw_xml | boolean | Include the raw XML string in the response. |
pdf_base64 | Base64-encoded PDF bytes. The tool will extract the embedded XML attachment (ZUGFeRD hybrid PDF/A-3). | |
xml_base64 | Base64-encoded XML bytes. | |
xml_content | Raw XML string. |
invoice_convert Invoice Convert
Convert a ZUGFeRD or XRechnung invoice to a different profile or syntax. Supports ZUGFeRD profile upgrades and downgrades, ZUGFeRD <-> XRechnung conversion, and cross-syntax CII <-> UBL transformation. Profile downgrades may result in data loss; set allow_data_loss=True to permit this.
| Parameter | Type | Description |
|---|---|---|
target_profile * | string | One of: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED, XRECHNUNG. |
allow_data_loss | boolean | If True, allow profile downgrades that discard data. Discarded fields are listed in the output. If False and data loss would occur, the conversion is rejected. |
target_syntax | string | Target syntax: 'CII' or 'UBL'. UBL is only valid for XRECHNUNG. |
xml_base64 | Base64-encoded XML bytes. | |
xml_content | Raw XML string of the source invoice. |
datev_export Datev Export
Export a ZUGFeRD invoice to DATEV CSV format (EXTF 700, Buchungsstapel). Produces a CSV file importable by DATEV Belegtransfer or DATEV Rechnungswesen. Maps invoice line items to DATEV booking records with configurable accounts.
| Parameter | Type | Description |
|---|---|---|
invoice * | object | ZUGFeRDInvoice data to export. |
client_number | string | DATEV Mandantennummer (client number). |
consultant_number | string | DATEV Beraternummer (consultant number). |
fiscal_year_start | string | Fiscal year start date (YYYYMMDD). Defaults to Jan 1 of invoice year. |
receivable_account | string | DATEV receivable account number (Debitorenkonto). Default: 10000. |
revenue_account | string | DATEV revenue account number (Erloskonto). Default: 8400 (SKR 03, 19% USt). |
tax_rules Tax Rules
Query German VAT rules for e-invoicing. Returns structured information about VAT rates (19%, 7%), VAT category codes, reverse charge rules under §13b UStG, zero-rate and exemption provisions (§4 UStG), intra-community supply rules, and VATEX exemption reason codes. For use when building invoice creation logic or validating VAT treatment.
| Parameter | Type | Description |
|---|---|---|
query * | string | What to look up. Examples: 'reverse_charge', 'rates', 'exemptions', 'kleinunternehmer', '13b', 'zero_rate', 'vatex_codes', or a free-text question about German VAT. |
context | Optional context about the transaction, e.g. 'construction services' or 'intra-community supply'. Used to filter relevant rules. |
peppol_lookup_participant Peppol Lookup Participant
Check whether a business is registered on the Peppol network. Performs a DNS-over-HTTPS U-NAPTR lookup followed by an SMP service-group request to determine registration status and the list of supported document type identifiers.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID ("<scheme>:<value>") or a bare national identifier this server knows how to adapt (e.g. a VAT number, if a national identifier adapter is configured). |
environment | string | "production" or "test". |
peppol_get_service_endpoint Peppol Get Service Endpoint
Fetch the AS4 endpoint for a Peppol participant's document type. Resolves the SMP hostname via DNS, then fetches service metadata for *document_type_id*. If the SMP returns a redirect, the result's `redirect_url` is set and `endpoint_url` is None; callers must not follow more than one redirect hop (SMP 1.4.0 §3.2).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID or adaptable national identifier. |
document_type_id | string | Peppol document type identifier URN (default: BIS Billing 3.0 invoice). |
environment | string | "production" or "test". |
resolve_peppol_dns Resolve Peppol Dns
Resolve the SMP hostname for a Peppol participant via DNS only. Performs the raw U-NAPTR (SML) lookup without fetching the SMP service group, useful for diagnosing whether a participant is registered in the SML independently of SMP reachability.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID or adaptable national identifier. |
environment | string | "production" or "test". |
peppol_send Peppol Send
Send a UBL/CII invoice to a Peppol participant via AS4. Looks up the recipient's AS4 endpoint (SMP), builds the ebMS3/AS4 envelope, and transmits it using the supplied signing credentials.
| Parameter | Type | Description |
|---|---|---|
certificate_path * | string | Path to the PEM-encoded signing certificate. |
invoice_xml_base64 * | string | Base64-encoded UBL or CII invoice XML. |
private_key_path * | string | Path to the PEM-encoded private key. |
recipient_identifier * | string | Peppol participant ID or adaptable national identifier of the receiver. |
sender_id * | string | Peppol AP identifier of the sender. |
document_type_id | string | Peppol document type identifier URN (default: BIS Billing 3.0 invoice). |
environment | string | "production" or "test". |
private_key_password | string | Optional password for the private key. |
list_participant_id_schemes List Participant Id Schemes
List Peppol participant identifier (ICD) schemes from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR to point at a local copy of the eDEC "Participant Identifier Schemes" GeneriCode export (not bundled with this package, no confirmed redistribution rights, see `mcp_einvoicing_core.peppol.codelists` module docstring).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_document_type_ids List Document Type Ids
List Peppol document type identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_process_ids List Process Ids
List Peppol process identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_spis_use_case_ids List Spis Use Case Ids
List Peppol SPIS use case identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
check_document_type_id_in_codelist Check Document Type Id In Codelist
Check whether a (scheme, value) pair is a recognized Peppol document type identifier. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`). Searches all entries regardless of state, so a historical (deprecated or removed) document type is still reported as found.
| Parameter | Type | Description |
|---|---|---|
scheme * | string | |
value * | string |
check_process_id_in_codelist Check Process Id In Codelist
Check whether a (scheme, value) pair is a recognized Peppol process identifier. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
scheme * | string | |
value * | string |
check_participant_id_scheme_in_codelist Check Participant Id Scheme In Codelist
Check whether a 4-digit ISO 6523 ICD code (e.g. "0208") is a recognized Peppol scheme. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
icd * | string |
get_peppol_codelist_version Get Peppol Codelist Version
Report the OpenPeppol eDEC code list release version(s) currently configured locally.
peppol_directory_search Peppol Directory Search
Search the Peppol Directory for registered participants. Public, unauthenticated search (no relation to SMP lookup). At least one of q/participant/name/country/doctype must be supplied.
| Parameter | Type | Description |
|---|---|---|
country | Exact match on ISO 3166-2 country code. | |
doctype | Exact match on a full document type identifier URN. | |
environment | string | "production" or "test". |
name | Partial match on business entity name (min. 3 characters). | |
participant | Exact match on a scheme-qualified participant ID (e.g. "iso6523-actorid-upis::0208:0123456789"). | |
q | General purpose query term, matched across all fields. | |
result_page_count | integer | Results per page. |
result_page_index | integer | 0-based result page index. |
validate_eusr_report Validate Eusr Report
Validate a Peppol End User Statistics Report (EUSR) document. Runs XSD structural validation, then Schematron business rules (requires the ``[xslt2]`` optional extra).
| Parameter | Type | Description |
|---|---|---|
report_xml_base64 * | string | Base64-encoded EUSR XML document. |
validate_tsr_report Validate Tsr Report
Validate a Peppol Transaction Statistics Report (TSR) document. Runs XSD structural validation, then Schematron business rules (requires the ``[xslt2]`` optional extra).
| Parameter | Type | Description |
|---|---|---|
report_xml_base64 * | string | Base64-encoded TSR XML document. |
validate_mls_message Validate Mls Message
Validate a Peppol Message Level Status (MLS) document. Runs the bundled MLS Schematron rules (requires the ``[xslt2]`` optional extra). No bespoke MLS XSD exists — full UBL 2.1 XSD validation is out of scope.
| Parameter | Type | Description |
|---|---|---|
mls_xml_base64 * | string | Base64-encoded MLS (UBL ApplicationResponse-2) XML. |
build_mls_message Build Mls Message
Build a document-level MLS response and return it base64-encoded. For per-line responses, build the document directly with `mcp_einvoicing_core.peppol.mls.build_mls`.
| Parameter | Type | Description |
|---|---|---|
document_reference_id * | string | The SBDH ``InstanceIdentifier`` of the source message this MLS reports on. |
issue_date * | string | ISO date string, e.g. "2026-08-23". |
mls_id * | string | The ``cbc:ID`` of this MLS document. |
receiver_scheme_id * | string | ICD scheme of the receiving endpoint (normally the original message's SBDH ``MLS_TO`` scheme). |
receiver_value * | string | Receiving endpoint value. |
response_code * | string | "AB" (Acknowledged), "AP" (Accepted), or "RE" (Rejected). |
sender_scheme_id * | string | ICD scheme of the sending Access Point's endpoint. |
sender_value * | string | Sending Access Point's endpoint value. |
description | string | Optional human-readable response text. |
issue_time | string | Optional ISO time string, e.g. "12:00:00Z". |
status_reason_code | string | Optional: "SV", "BV", "BW", or "FD" (required by the Schematron when response_code is "RE"). |
list_country_codes List Country Codes
List ISO 3166-1 alpha-2 country codes from the CEF EN 16931 code list.
check_country_code Check Country Code
Check whether *code* is a recognized ISO 3166-1 alpha-2 country code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_currency_codes List Currency Codes
List ISO 4217 currency codes from the CEF EN 16931 code list.
check_currency_code Check Currency Code
Check whether *code* is a recognized ISO 4217 currency code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_icd_codes List Icd Codes
List ISO 6523 ICD codes from the CEF EN 16931 code list.
check_icd_code Check Icd Code
Check whether *code* is a recognized ISO 6523 ICD code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_document_name_codes List Document Name Codes
List UNCL1001 document name codes from the CEF EN 16931 code list.
check_document_name_code Check Document Name Code
Check whether *code* is a recognized UNCL1001 document name code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_reference_qualifier_codes List Reference Qualifier Codes
List UNCL1153 reference qualifier codes from the CEF EN 16931 code list.
check_reference_qualifier_code Check Reference Qualifier Code
Check whether *code* is a recognized UNCL1153 reference qualifier code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_payment_means_codes List Payment Means Codes
List UNCL4461 payment means codes from the CEF EN 16931 code list.
check_payment_means_code Check Payment Means Code
Check whether *code* is a recognized UNCL4461 payment means code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_vat_category_codes List Vat Category Codes
List UNCL5305 VAT category codes from the CEF EN 16931 code list.
check_vat_category_code Check Vat Category Code
Check whether *code* is a recognized UNCL5305 VAT category code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_allowance_reason_codes List Allowance Reason Codes
List allowance reason codes from the CEF EN 16931 code list.
check_allowance_reason_code Check Allowance Reason Code
Check whether *code* is a recognized allowance reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_item_type_codes List Item Type Codes
List item type identification codes from the CEF EN 16931 code list.
check_item_type_code Check Item Type Code
Check whether *code* is a recognized item type identification code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_charge_reason_codes List Charge Reason Codes
List charge reason codes from the CEF EN 16931 code list.
check_charge_reason_code Check Charge Reason Code
Check whether *code* is a recognized charge reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_mime_codes List Mime Codes
List recognized MIME types for embedded attachments.
check_mime_code Check Mime Code
Check whether *code* is a recognized MIME type for embedded attachments.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_eas_codes List Eas Codes
List Electronic Address Scheme (EAS) codes from the CEF EN 16931 code list.
check_eas_code Check Eas Code
Check whether *code* is a recognized Electronic Address Scheme code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_vatex_codes List Vatex Codes
List VATEX (VAT exemption reason) codes from the CEF EN 16931 code list.
check_vatex_code Check Vatex Code
Check whether *code* is a recognized VATEX VAT exemption reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
get_en16931_codelist_version Get En16931 Codelist Version
Report the CEF EN 16931 code-list release version(s) currently configured locally.