mcp-einvoicing-de

v0.11.5
io.github.cmendezs/mcp-einvoicing-de Checked 3 days ago Published 12 days ago

German 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).

ParameterTypeDescription
invoice *objectInvoice data matching the ZUGFeRDInvoice schema. Set invoice.profile to XRECHNUNG to produce an XRechnung invoice.
output_formatstring'xml' (default) or 'pdf' (ZUGFeRD hybrid PDF/A-3).
pretty_printbooleanPretty-print the XML output.
syntaxstringXML syntax: 'CII' (default) or 'UBL' (XRechnung only).
transitional_period_opt_inbooleanAcknowledge 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.

ParameterTypeDescription
cloud_validatebooleanOpt in to sending the invoice XML to a remote KoSIT endpoint (egresses the full invoice payload). Local Schematron only by default.
kosit_strictbooleanIf True, fail hard when the KoSIT cloud validator is unreachable instead of falling back to local Schematron.
profileOverride profile detection. One of: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED, XRECHNUNG. If omitted, auto-detected from the XML GuidelineID.
strictbooleanIf True, warnings are also reported. If False, only errors are returned.
syntaxOverride 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_base64Base64-encoded XML bytes of the invoice.
xml_contentRaw 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.

ParameterTypeDescription
include_raw_xmlbooleanInclude the raw XML string in the response.
pdf_base64Base64-encoded PDF bytes. The tool will extract the embedded XML attachment (ZUGFeRD hybrid PDF/A-3).
xml_base64Base64-encoded XML bytes.
xml_contentRaw 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.

ParameterTypeDescription
target_profile *stringOne of: MINIMUM, BASIC_WL, BASIC, EN_16931, EXTENDED, XRECHNUNG.
allow_data_lossbooleanIf 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_syntaxstringTarget syntax: 'CII' or 'UBL'. UBL is only valid for XRECHNUNG.
xml_base64Base64-encoded XML bytes.
xml_contentRaw 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.

ParameterTypeDescription
invoice *objectZUGFeRDInvoice data to export.
client_numberstringDATEV Mandantennummer (client number).
consultant_numberstringDATEV Beraternummer (consultant number).
fiscal_year_startstringFiscal year start date (YYYYMMDD). Defaults to Jan 1 of invoice year.
receivable_accountstringDATEV receivable account number (Debitorenkonto). Default: 10000.
revenue_accountstringDATEV 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.

ParameterTypeDescription
query *stringWhat to look up. Examples: 'reverse_charge', 'rates', 'exemptions', 'kleinunternehmer', '13b', 'zero_rate', 'vatex_codes', or a free-text question about German VAT.
contextOptional 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.

ParameterTypeDescription
identifier *stringPeppol 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).
environmentstring"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).

ParameterTypeDescription
identifier *stringPeppol participant ID or adaptable national identifier.
document_type_idstringPeppol document type identifier URN (default: BIS Billing 3.0 invoice).
environmentstring"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.

ParameterTypeDescription
identifier *stringPeppol participant ID or adaptable national identifier.
environmentstring"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.

ParameterTypeDescription
certificate_path *stringPath to the PEM-encoded signing certificate.
invoice_xml_base64 *stringBase64-encoded UBL or CII invoice XML.
private_key_path *stringPath to the PEM-encoded private key.
recipient_identifier *stringPeppol participant ID or adaptable national identifier of the receiver.
sender_id *stringPeppol AP identifier of the sender.
document_type_idstringPeppol document type identifier URN (default: BIS Billing 3.0 invoice).
environmentstring"production" or "test".
private_key_passwordstringOptional 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).

ParameterTypeDescription
active_onlybooleanWhen 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`).

ParameterTypeDescription
active_onlybooleanWhen 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`).

ParameterTypeDescription
active_onlybooleanWhen 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`).

ParameterTypeDescription
active_onlybooleanWhen 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.

ParameterTypeDescription
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`).

ParameterTypeDescription
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`).

ParameterTypeDescription
icd *string

get_peppol_codelist_version Get Peppol Codelist Version

Report the OpenPeppol eDEC code list release version(s) currently configured locally.

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).

ParameterTypeDescription
report_xml_base64 *stringBase64-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).

ParameterTypeDescription
report_xml_base64 *stringBase64-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.

ParameterTypeDescription
mls_xml_base64 *stringBase64-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`.

ParameterTypeDescription
document_reference_id *stringThe SBDH ``InstanceIdentifier`` of the source message this MLS reports on.
issue_date *stringISO date string, e.g. "2026-08-23".
mls_id *stringThe ``cbc:ID`` of this MLS document.
receiver_scheme_id *stringICD scheme of the receiving endpoint (normally the original message's SBDH ``MLS_TO`` scheme).
receiver_value *stringReceiving endpoint value.
response_code *string"AB" (Acknowledged), "AP" (Accepted), or "RE" (Rejected).
sender_scheme_id *stringICD scheme of the sending Access Point's endpoint.
sender_value *stringSending Access Point's endpoint value.
descriptionstringOptional human-readable response text.
issue_timestringOptional ISO time string, e.g. "12:00:00Z".
status_reason_codestringOptional: "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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
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.

ParameterTypeDescription
code *string

get_en16931_codelist_version Get En16931 Codelist Version

Report the CEF EN 16931 code-list release version(s) currently configured locally.