mcp-einvoicing-de
mcp-einvoicing-de 🇩🇪
독일 전자 세금 계산서(ZUGFeRD 2.x 및 XRechnung 3.x 형식, EN 16931, FeRD, KoSIT 준수)를 위한 Python 기반 MCP(Model Context Protocol) 서버입니다. AI 에이전트(Claude, IDE 등)가 독일 B2B 전자 세금 계산서 의무화(2025년 시행, 2027~2028년까지 단계적 적용) 및 유럽 표준 EN 16931을 완벽하게 준수하는 전자 세금 계산서를 생성, 검증, 파싱 및 변환할 수 있도록 지원합니다.
영어 요약
이 서버는 독일 전자 세금 계산서를 위한 MCP(Model Context Protocol) 서버입니다. ZUGFeRD 또는 XRechnung 계산서의 전체 수명 주기를 다루는 6가지 도구를 제공합니다: 생성(CII/UBL XML), EN 16931 및 KoSIT Schematron 규칙(BR-DE-*)에 따른 검증, 기존 계산서 파일 파싱, 프로필 및 구문 변환, Peppol 참가자 등록 조회(AS4), 독일 부가가치세 규칙(세율 등급, §13b UStG 역과세, 면세) 확인. 모든 ZUGFeRD 2.x 프로필(MINIMUM ~ EXTENDED) 및 XRechnung 3.x(CII 및 UBL 구문)를 지원합니다. Apache 2.0 라이선스로 제공됩니다.
Related MCP server: mcp-facture-electronique-fr
기반 기술
이 패키지는 유럽 전자 세금 계산서 MCP 서버를 위한 공통 기반 라이브러리인 mcp-einvoicing-core를 기반으로 합니다. 이 라이브러리는 공통 모델, 검증 추상화, XML 도우미 함수 및 예외 계층 구조를 제공합니다.
mcp-einvoicing-core는 전이적 의존성으로 자동 설치되므로 별도의 추가 단계가 필요하지 않습니다.
개발자 참고:
pip install -e ".[dev]"명령어를 사용하면 PyPI에서 기본 패키지가 자동으로 설치됩니다.
🏗️ 아키텍처
mcp-einvoicing-de (dieses Paket — eigenständiger MCP-Server)
├── ZUGFeRDInvoice / XRechnungInvoice ← Pydantic-Modelle (alle Profile)
├── SchematronValidator ← EN 16931 + KoSIT BR-DE-* Regeln
├── KoSITValidator ← Remote-Validierungstool (optional)
└── Tools: create / validate / parse / convert / peppol_check / tax_rules
↑ erweitert
mcp-einvoicing-core (gemeinsame Basis, als Abhängigkeit installiert)
├── BaseDocumentGenerator / Validator / Parser
├── BaseInvoice, BaseParty … (Pydantic)
├── xml_utils, exceptions
└── EInvoicingMCPServer🚀 설치
PyPI를 통한 설치 (권장)
pip install mcp-einvoicing-deuvx를 사용하여 사전 설치 없이 실행:
uvx mcp-einvoicing-de소스 코드에서 설치
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"⚙️ 설정
v0.1.0 버전에서는 외부 자격 증명이 필요하지 않습니다. 사용 가능한 환경 변수는 다음과 같습니다:
변수 | 설명 | 기본값 |
| 로그 수준 ( |
|
| KoSIT 검증 도구 URL (선택 사항, 원격 검증용) | — |
| Peppol-SMP 조회 URL (선택 사항) | — |
| PDF 생성 엔진 ( |
|
🤖 Claude Desktop 통합
claude_desktop_config.json 파일에 추가:
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}⌨️ Cursor 통합
설정 파일 (~/.cursor/mcp.json 또는 프로젝트 디렉토리의 .cursor/mcp.json):
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"]
}
}
}🪐 Kiro 통합
{
"mcpServers": {
"einvoicing-de": {
"command": "uvx",
"args": ["mcp-einvoicing-de"],
"disabled": false,
"autoApprove": []
}
}
}🧰 사용 가능한 MCP 도구
도구 | 설명 |
| ZUGFeRD 또는 XRechnung XML(CII 또는 UBL) 생성; PDF/A-3 하이브리드 지원 예정 (v0.2.0) |
| EN 16931 및 KoSIT Schematron 규칙(BR-DE-*)에 따라 계산서 검증 |
| 기존 ZUGFeRD 또는 XRechnung 파일에서 구조화된 데이터 추출 |
| ZUGFeRD 프로필 간 또는 ZUGFeRD ↔ XRechnung 간 변환 |
| 독일 기업의 Peppol 참가자 등록 확인 (AS4) |
| 독일 부가가치세 규칙 조회 (세율 등급, §13b UStG, 면세) |
사용 예시
예시 1 — 계산서 검증
1. invoice_validate(
xml_base64="...", # Base64-kodiertes ZUGFeRD-XML
strict=True
)
→ {
"is_valid": true,
"profile": "EN_16931",
"syntax": "CII",
"error_count": 0,
"warning_count": 2,
"errors": [],
"warnings": [...],
"validator_used": "local_schematron"
}예시 2 — 독일 세금 규칙 조회
2. tax_rules(query="reverse_charge", context="Bauleistungen")
→ {
"results": [
{
"paragraph": "§13b Abs. 2 Nr. 5 UStG",
"description_en": "Construction services (building contractor rule)",
"vatex_code": "VATEX-EU-AE",
"invoice_note": "Steuerschuldnerschaft des Leistungsempfängers (§13b UStG)"
}
],
"legal_disclaimer": "..."
}예시 3 — Peppol 등록 확인
3. peppol_check(
participant_id="0204:991-1234512345-06",
environment="production"
)
→ {
"is_registered": true,
"participant_id": "0204:991-1234512345-06",
"document_type_supported": true,
"access_point_url": "https://ap.example.de/as4",
"transport_profile": "peppol-transport-as4-v2.0"
}예시 4 — 계산서 데이터 파싱
4. invoice_parse(xml_base64="...", include_raw_xml=False)
→ {
"profile": "XRECHNUNG",
"syntax": "CII",
"invoice_number": "RE-2025-001",
"invoice_date": "2025-01-15",
"seller_name": "Muster GmbH",
"buyer_name": "Käufer AG",
"tax_inclusive_amount": "119.00",
"currency_code": "EUR"
}📚 지원 표준
표준 | 버전 | 프로필 / 구문 |
ZUGFeRD | 2.3 | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED |
XRechnung | 3.x | CII (Cross Industry Invoice), UBL (Universal Business Language) |
EN 16931 | — | 전자 세금 계산서를 위한 유럽 핵심 데이터 모델 |
Peppol BIS | 3.0 | Billing 3.0 (DE PINT) |
참고: ZUGFeRD 2.x와 XRechnung 3.x는 EN 16931 프로필 수준에서 동일한 CII-XML 구문을 공유합니다. 따라서 데이터 손실 없이 두 형식 간 변환이 가능합니다. EXTENDED 프로필은 ZUGFeRD 전용이며 XRechnung 대응 항목이 없습니다.
리소스 | 링크 |
FeRD ZUGFeRD 사양 | |
KoSIT XRechnung | |
KoSIT 검증 도구 | |
EN 16931-1:2017 | |
Peppol BIS Billing 3.0 |
🧪 테스트
# Entwicklungsabhängigkeiten installieren
pip install -e ".[dev]"
# Gesamte Testsuite ausführen
pytest tests/ -v
# Mit Abdeckungsbericht
pytest --cov=mcp_einvoicing_de --cov-report=term-missing
# Nur Modell-Tests
pytest tests/test_models.py -v로드맵
버전 | 기능 |
v0.1.0 (현재) | 도구: create, validate, parse, convert, peppol_check, tax_rules |
v0.2.0 |
|
v0.3.0 | KoSIT 온라인 검증기 통합 완료 |
v0.4.0 | Peppol AS4 직접 전송 |
v0.5.0 | DATEV 내보내기 형식 |
v1.0.0 | 프로덕션 준비 완료, EN 16931 전체 지원 |
기여하기
기여를 환영합니다. 중요한 변경 사항에 대한 Pull Request를 제출하기 전에 먼저 이슈를 열어주시기 바랍니다.
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
cd mcp-einvoicing-de
pip install -e ".[dev]"
pytest
make audit기타 전자 세금 계산서 MCP 서버
국가 | 서버 |
🌍 글로벌 | |
🇧🇪 벨기에 | |
🇫🇷 프랑스 | |
🇮🇹 이탈리아 | |
🇩🇪 독일 |
📄 라이선스
이 프로젝트는 Apache-2.0 라이선스를 따릅니다. 자세한 내용은 LICENSE 파일을 참조하십시오.
Copyright 2026 cmendezs
프로젝트 관리자: cmendezs. ZUGFeRD 또는 XRechnung 사양 구현과 관련된 질문은 이슈를 열어주시기 바랍니다.
Available Tools
50 toolsbuild_mls_messageBuild Mls MessageA
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.
Inputs: mls_id (required), issue_date (required), sender_value (required), response_code (required), +7 more. Returns: object
check_allowance_reason_codeCheck Allowance Reason CodeA
Check whether code is a recognized allowance reason code.
Inputs: code (required). Returns: object
check_charge_reason_codeCheck Charge Reason CodeA
Check whether code is a recognized charge reason code.
Inputs: code (required). Returns: object
check_country_codeCheck Country CodeA
Check whether code is a recognized ISO 3166-1 alpha-2 country code.
Inputs: code (required). Returns: object
check_currency_codeCheck Currency CodeA
Check whether code is a recognized ISO 4217 currency code.
Inputs: code (required). Returns: object
check_document_name_codeCheck Document Name CodeA
Check whether code is a recognized UNCL1001 document name code.
Inputs: code (required). Returns: object
check_document_type_id_in_codelistCheck Document Type Id In CodelistA
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.
Inputs: value (required), scheme (required). Returns: object
check_eas_codeCheck Eas CodeA
Check whether code is a recognized Electronic Address Scheme code.
Inputs: code (required). Returns: object
check_icd_codeCheck Icd CodeA
Check whether code is a recognized ISO 6523 ICD code.
Inputs: code (required). Returns: object
check_item_type_codeCheck Item Type CodeB
Check whether code is a recognized item type identification code.
Inputs: code (required). Returns: object
check_mime_codeCheck Mime CodeA
Check whether code is a recognized MIME type for embedded attachments.
Inputs: code (required). Returns: object
check_participant_id_scheme_in_codelistCheck Participant Id Scheme In CodelistA
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).
Inputs: icd (required). Returns: object
check_payment_means_codeCheck Payment Means CodeA
Check whether code is a recognized UNCL4461 payment means code.
Inputs: code (required). Returns: object
check_process_id_in_codelistCheck Process Id In CodelistA
Check whether a (scheme, value) pair is a recognized Peppol process identifier.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: value (required), scheme (required). Returns: object
check_reference_qualifier_codeCheck Reference Qualifier CodeA
Check whether code is a recognized UNCL1153 reference qualifier code.
Inputs: code (required). Returns: object
check_vat_category_codeCheck Vat Category CodeA
Check whether code is a recognized UNCL5305 VAT category code.
Inputs: code (required). Returns: object
check_vatex_codeCheck Vatex CodeA
Check whether code is a recognized VATEX VAT exemption reason code.
Inputs: code (required). Returns: object
datev_exportDatev ExportA
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.
Inputs: invoice (required), client_number, revenue_account, consultant_number, +2 more. Returns: object
get_en16931_codelist_versionGet En16931 Codelist VersionA
Report the CEF EN 16931 code-list release version(s) currently configured locally.
Inputs: no named parameters. Returns: object
get_peppol_codelist_versionGet Peppol Codelist VersionA
Report the OpenPeppol eDEC code list release version(s) currently configured locally.
Inputs: no named parameters. Returns: object
invoice_convertInvoice ConvertA
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.
Inputs: target_profile (required), xml_base64, xml_content, target_syntax, +1 more. Returns: object
invoice_createInvoice CreateA
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).
Inputs: invoice (required), syntax, pretty_print, output_format, +1 more. Returns: object
invoice_parseInvoice ParseA
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.
Inputs: pdf_base64, xml_base64, xml_content, include_raw_xml. Returns: object
invoice_validateInvoice ValidateA
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.
Inputs: strict, syntax, profile, xml_base64, +4 more. Returns: object
list_allowance_reason_codesList Allowance Reason CodesA
List allowance reason codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_charge_reason_codesList Charge Reason CodesA
List charge reason codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_country_codesList Country CodesA
List ISO 3166-1 alpha-2 country codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_currency_codesList Currency CodesA
List ISO 4217 currency codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_document_name_codesList Document Name CodesA
List UNCL1001 document name codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_document_type_idsList Document Type IdsA
List Peppol document type identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_eas_codesList Eas CodesA
List Electronic Address Scheme (EAS) codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_icd_codesList Icd CodesA
List ISO 6523 ICD codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_item_type_codesList Item Type CodesA
List item type identification codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_mime_codesList Mime CodesB
List recognized MIME types for embedded attachments.
Inputs: no named parameters. Returns: object
list_participant_id_schemesList Participant Id SchemesA
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).
Inputs: active_only. Returns: object
list_payment_means_codesList Payment Means CodesA
List UNCL4461 payment means codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_process_idsList Process IdsA
List Peppol process identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_reference_qualifier_codesList Reference Qualifier CodesA
List UNCL1153 reference qualifier codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_spis_use_case_idsList Spis Use Case IdsA
List Peppol SPIS use case identifiers from the OpenPeppol eDEC code list.
Requires EINVOICING_PEPPOL_CODELIST_DIR (see list_participant_id_schemes).
Inputs: active_only. Returns: object
list_vat_category_codesList Vat Category CodesA
List UNCL5305 VAT category codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
list_vatex_codesList Vatex CodesA
List VATEX (VAT exemption reason) codes from the CEF EN 16931 code list.
Inputs: no named parameters. Returns: object
peppol_directory_searchPeppol Directory SearchA
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.
Inputs: q, name, country, doctype, +4 more. Returns: object
peppol_get_service_endpointPeppol Get Service EndpointA
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).
Inputs: identifier (required), environment, document_type_id. Returns: object
peppol_lookup_participantPeppol Lookup ParticipantA
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.
Inputs: identifier (required), environment. Returns: object
peppol_sendPeppol SendA
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.
Inputs: sender_id (required), certificate_path (required), private_key_path (required), invoice_xml_base64 (required), +4 more. Returns: object
resolve_peppol_dnsResolve Peppol DnsA
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.
Inputs: identifier (required), environment. Returns: object
tax_rulesTax RulesA
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.
Inputs: query (required), context. Returns: object
validate_eusr_reportValidate Eusr ReportA
Validate a Peppol End User Statistics Report (EUSR) document.
Runs XSD structural validation, then Schematron business rules
(requires the [xslt2] optional extra).
Inputs: report_xml_base64 (required). Returns: object
validate_mls_messageValidate Mls MessageA
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.
Inputs: mls_xml_base64 (required). Returns: object
validate_tsr_reportValidate Tsr ReportA
Validate a Peppol Transaction Statistics Report (TSR) document.
Runs XSD structural validation, then Schematron business rules
(requires the [xslt2] optional extra).
Inputs: report_xml_base64 (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 50 tools
The tool set has many code list checking tools that follow a clear pattern (list_X_codes/check_X_code), which are distinct from the invoice processing tools. However, there are repeated tools (e.g., list_eas_codes appears twice in the provided list) and some closely related validation tools (TSR vs MLS vs EUSR) that could cause confusion.
Most tools follow consistent verb_noun patterns: check_, list_, get_, create_, validate_. There are minor deviations like `peppol_lookup_participant` and `resolve_peppol_dns` using different prefixes, but overall the naming is predictable and clear.
50+ tools is excessive, largely driven by repetitive list_x_codes/check_x_code pairs for each codelist. The core invoice functionality is only ~5 tools, while code-list helpers dominate the surface.
The invoice lifecycle is well covered with create/validate/convert/export, and Peppol lookup/send tools cover the main delivery flow. Missing operations like cancel or fetch invoice history are minor for the domain scope.
Maintenance
Related MCP Connectors
Validate, parse, fix and render e-invoices: XRechnung, ZUGFeRD, Peppol, KSeF, Facturae, MyInvois
Create ZUGFeRD e-invoices from JSON or PDF, verify Factur-X, check VAT IDs and Peppol.
Validate XRechnung, ZUGFeRD and Factur-X with the KoSIT validator and create valid e-invoices.
Create and validate XRechnung, ZUGFeRD and Peppol e-invoices (KoSIT); Peppol lookup, rule help.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for DACH e-invoicing. Create XRechnung (UBL) and ZUGFeRD 2.3 (Factur-X CII) invoices, validate against EN 16931 rules, extract data from XML, and convert between UBL, CII and JSON formats.650 npm2MIT
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for French Electronic Invoicing (NF XP Z12-013). Provide tools to validate, generate, and explore API specifications for PDP/OD interoperability.341Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Italian Electronic Invoicing (FatturaPA / SDI). Provide tools to validate, generate, and explore API specifications for Sistema di Interscambio (SDI) interoperability.4393 PyPI2Apache 2.0
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) server for Belgian Electronic Invoicing (Peppol BIS 3.0 / PINT-BE / Mercurius). Provides tools to validate, generate, and transform UBL 2.1 e-invoices, and look up BCE/KBO enterprise data and Peppol participants.50297 PyPIApache 2.0