mcp-einvoicing-de 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_einvoicing_de-0.1.0/.github/workflows/publish.yml +138 -0
- mcp_einvoicing_de-0.1.0/.gitignore +74 -0
- mcp_einvoicing_de-0.1.0/Makefile +47 -0
- mcp_einvoicing_de-0.1.0/PKG-INFO +345 -0
- mcp_einvoicing_de-0.1.0/README.md +304 -0
- mcp_einvoicing_de-0.1.0/audit/__init__.py +1 -0
- mcp_einvoicing_de-0.1.0/audit/audit_vs_core.py +857 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/__init__.py +9 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/download_rules.py +134 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/models/__init__.py +27 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/models/xrechnung.py +53 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/models/zugferd.py +285 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/server.py +88 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/__init__.py +1 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/invoice_convert.py +132 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/invoice_create.py +142 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/invoice_parse.py +180 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/invoice_validate.py +310 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/peppol_check.py +166 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/tools/tax_rules.py +236 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/utils/__init__.py +11 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/utils/pdf.py +111 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/utils/xml_utils.py +75 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/validators/__init__.py +6 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/validators/kosit.py +101 -0
- mcp_einvoicing_de-0.1.0/mcp_einvoicing_de/validators/schematron.py +69 -0
- mcp_einvoicing_de-0.1.0/pyproject.toml +91 -0
- mcp_einvoicing_de-0.1.0/server.json +34 -0
- mcp_einvoicing_de-0.1.0/tests/__init__.py +1 -0
- mcp_einvoicing_de-0.1.0/tests/conftest.py +101 -0
- mcp_einvoicing_de-0.1.0/tests/test_invoice_validate.py +138 -0
- mcp_einvoicing_de-0.1.0/tests/test_models.py +71 -0
- mcp_einvoicing_de-0.1.0/tests/test_tax_rules.py +70 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
name: CI / Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# ── 1. Tests ───────────────────────────────────────────────────────────────
|
|
16
|
+
test:
|
|
17
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
cache: pip
|
|
32
|
+
|
|
33
|
+
- name: Install package + dev dependencies
|
|
34
|
+
run: pip install -e ".[dev]"
|
|
35
|
+
|
|
36
|
+
- name: Lint with ruff
|
|
37
|
+
run: ruff check mcp_einvoicing_de/ tests/ audit/
|
|
38
|
+
|
|
39
|
+
- name: Type-check with mypy
|
|
40
|
+
run: mypy mcp_einvoicing_de/
|
|
41
|
+
continue-on-error: true # Non-blocking until type stubs are complete
|
|
42
|
+
|
|
43
|
+
- name: Run tests
|
|
44
|
+
run: pytest --tb=short
|
|
45
|
+
|
|
46
|
+
- name: Upload coverage report
|
|
47
|
+
if: matrix.python-version == '3.11'
|
|
48
|
+
uses: actions/upload-artifact@v4
|
|
49
|
+
with:
|
|
50
|
+
name: coverage-report
|
|
51
|
+
path: htmlcov/
|
|
52
|
+
|
|
53
|
+
# ── 2. Pre-publish audit ───────────────────────────────────────────────────
|
|
54
|
+
audit:
|
|
55
|
+
name: Pre-publish audit vs mcp-einvoicing-core
|
|
56
|
+
needs: test
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@v4
|
|
61
|
+
|
|
62
|
+
- name: Set up Python
|
|
63
|
+
uses: actions/setup-python@v5
|
|
64
|
+
with:
|
|
65
|
+
python-version: "3.11"
|
|
66
|
+
cache: pip
|
|
67
|
+
|
|
68
|
+
- name: Install package + core
|
|
69
|
+
run: pip install -e ".[dev]"
|
|
70
|
+
|
|
71
|
+
- name: Run pre-publish audit
|
|
72
|
+
# Exit code 2 = blocking failures → job fails → publish is blocked
|
|
73
|
+
# Exit code 1 = warnings only → job passes (informational)
|
|
74
|
+
run: python audit/audit_vs_core.py --output audit/report.json --fail-on blocking
|
|
75
|
+
|
|
76
|
+
- name: Upload audit report
|
|
77
|
+
if: always() # Upload even on failure so the report is inspectable
|
|
78
|
+
uses: actions/upload-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: audit-report
|
|
81
|
+
path: audit/report.json
|
|
82
|
+
|
|
83
|
+
# ── 3. Build distribution ──────────────────────────────────────────────────
|
|
84
|
+
build:
|
|
85
|
+
name: Build distribution packages
|
|
86
|
+
needs: audit
|
|
87
|
+
runs-on: ubuntu-latest
|
|
88
|
+
# Only build on tag pushes
|
|
89
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
90
|
+
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/checkout@v4
|
|
93
|
+
|
|
94
|
+
- name: Set up Python
|
|
95
|
+
uses: actions/setup-python@v5
|
|
96
|
+
with:
|
|
97
|
+
python-version: "3.11"
|
|
98
|
+
cache: pip
|
|
99
|
+
|
|
100
|
+
- name: Install build tools
|
|
101
|
+
run: pip install build
|
|
102
|
+
|
|
103
|
+
- name: Build wheel and sdist
|
|
104
|
+
run: python -m build
|
|
105
|
+
|
|
106
|
+
- name: Upload distribution packages
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: dist-packages
|
|
110
|
+
path: dist/
|
|
111
|
+
|
|
112
|
+
# ── 4. Publish to PyPI ─────────────────────────────────────────────────────
|
|
113
|
+
publish:
|
|
114
|
+
name: Publish to PyPI
|
|
115
|
+
needs: build
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
# Only publish on tag pushes; audit must have passed (via the needs chain)
|
|
118
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
119
|
+
|
|
120
|
+
environment:
|
|
121
|
+
name: pypi
|
|
122
|
+
url: https://pypi.org/p/mcp-einvoicing-de
|
|
123
|
+
|
|
124
|
+
permissions:
|
|
125
|
+
id-token: write # Required for OIDC trusted publisher
|
|
126
|
+
|
|
127
|
+
steps:
|
|
128
|
+
- name: Download distribution packages
|
|
129
|
+
uses: actions/download-artifact@v4
|
|
130
|
+
with:
|
|
131
|
+
name: dist-packages
|
|
132
|
+
path: dist/
|
|
133
|
+
|
|
134
|
+
- name: Publish to PyPI via trusted publisher (OIDC)
|
|
135
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
136
|
+
# No API token needed — uses GitHub OIDC trusted publisher.
|
|
137
|
+
# Configure the trusted publisher at:
|
|
138
|
+
# https://pypi.org/manage/project/mcp-einvoicing-de/settings/publishing/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# macOS
|
|
2
|
+
.DS_Store
|
|
3
|
+
.AppleDouble
|
|
4
|
+
.LSOverride
|
|
5
|
+
*.DS_Store
|
|
6
|
+
Icon?
|
|
7
|
+
._*
|
|
8
|
+
.Spotlight-V100
|
|
9
|
+
.Trashes
|
|
10
|
+
|
|
11
|
+
# Credentials & sensitive files
|
|
12
|
+
*.env
|
|
13
|
+
*.key
|
|
14
|
+
*.pem
|
|
15
|
+
cookie.file
|
|
16
|
+
secrets/
|
|
17
|
+
.secret
|
|
18
|
+
*.secret
|
|
19
|
+
wp-config.php
|
|
20
|
+
config.php
|
|
21
|
+
*.credentials
|
|
22
|
+
*.token
|
|
23
|
+
|
|
24
|
+
# Logs
|
|
25
|
+
*.log
|
|
26
|
+
logs/
|
|
27
|
+
|
|
28
|
+
# Node
|
|
29
|
+
node_modules/
|
|
30
|
+
npm-debug.log*
|
|
31
|
+
|
|
32
|
+
# Python
|
|
33
|
+
__pycache__/
|
|
34
|
+
*.py[cod]
|
|
35
|
+
*$py.class
|
|
36
|
+
.venv/
|
|
37
|
+
venv/
|
|
38
|
+
env/
|
|
39
|
+
dist/
|
|
40
|
+
build/
|
|
41
|
+
*.egg-info/
|
|
42
|
+
.hatch/
|
|
43
|
+
*.whl
|
|
44
|
+
|
|
45
|
+
# Environnement local (secrets)
|
|
46
|
+
.env
|
|
47
|
+
.env.local
|
|
48
|
+
.env.*.local
|
|
49
|
+
|
|
50
|
+
# Tests et couverture
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
.coverage
|
|
53
|
+
htmlcov/
|
|
54
|
+
.tox/
|
|
55
|
+
coverage.xml
|
|
56
|
+
|
|
57
|
+
# Fichiers de factures de test sensibles
|
|
58
|
+
tests/fixtures/*.xml
|
|
59
|
+
tests/fixtures/*.pdf
|
|
60
|
+
|
|
61
|
+
# IDE
|
|
62
|
+
.vscode/
|
|
63
|
+
.idea/
|
|
64
|
+
*.swp
|
|
65
|
+
*.swo
|
|
66
|
+
|
|
67
|
+
# Claude Code (local settings, memory, session data)
|
|
68
|
+
.claude/
|
|
69
|
+
|
|
70
|
+
# Pre-publish audit output (generated artefacts)
|
|
71
|
+
audit/report.json
|
|
72
|
+
|
|
73
|
+
# Schematron XSLT resources (downloaded at runtime, not committed)
|
|
74
|
+
mcp_einvoicing_de/resources/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.PHONY: install dev-install test lint typecheck audit clean build help
|
|
2
|
+
|
|
3
|
+
PYTHON := python3
|
|
4
|
+
PKG := mcp_einvoicing_de
|
|
5
|
+
AUDIT_OUT := audit/report.json
|
|
6
|
+
|
|
7
|
+
help: ## Show this help message
|
|
8
|
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
|
|
9
|
+
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
|
|
10
|
+
|
|
11
|
+
install: ## Install the package (production deps only)
|
|
12
|
+
pip install -e .
|
|
13
|
+
|
|
14
|
+
dev-install: ## Install the package with all dev dependencies
|
|
15
|
+
pip install -e ".[dev]"
|
|
16
|
+
|
|
17
|
+
test: ## Run the test suite with coverage
|
|
18
|
+
pytest --tb=short
|
|
19
|
+
|
|
20
|
+
lint: ## Run ruff linter
|
|
21
|
+
ruff check $(PKG)/ tests/ audit/
|
|
22
|
+
|
|
23
|
+
lint-fix: ## Run ruff with auto-fix
|
|
24
|
+
ruff check --fix $(PKG)/ tests/ audit/
|
|
25
|
+
|
|
26
|
+
typecheck: ## Run mypy type checker
|
|
27
|
+
mypy $(PKG)/
|
|
28
|
+
|
|
29
|
+
audit: ## Run pre-publish audit against mcp-einvoicing-core
|
|
30
|
+
$(PYTHON) audit/audit_vs_core.py --output $(AUDIT_OUT)
|
|
31
|
+
|
|
32
|
+
audit-strict: ## Run audit; exit non-zero on any warning
|
|
33
|
+
$(PYTHON) audit/audit_vs_core.py --output $(AUDIT_OUT) --fail-on warnings
|
|
34
|
+
|
|
35
|
+
audit-ci: ## Run audit in CI mode (blocking failures only)
|
|
36
|
+
$(PYTHON) audit/audit_vs_core.py --output $(AUDIT_OUT) --fail-on blocking
|
|
37
|
+
|
|
38
|
+
build: ## Build wheel and sdist
|
|
39
|
+
$(PYTHON) -m build
|
|
40
|
+
|
|
41
|
+
clean: ## Remove build artefacts and caches
|
|
42
|
+
rm -rf dist/ build/ *.egg-info/ .pytest_cache/ htmlcov/ .coverage coverage.xml
|
|
43
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
44
|
+
find . -name "*.pyc" -delete
|
|
45
|
+
|
|
46
|
+
run: ## Start the MCP server (stdio transport)
|
|
47
|
+
mcp-einvoicing-de
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-einvoicing-de
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for German electronic invoicing (ZUGFeRD 2.x, XRechnung 3.x, EN 16931)
|
|
5
|
+
Project-URL: Homepage, https://github.com/cmendezs/mcp-einvoicing-de
|
|
6
|
+
Project-URL: Repository, https://github.com/cmendezs/mcp-einvoicing-de
|
|
7
|
+
Project-URL: Issues, https://github.com/cmendezs/mcp-einvoicing-de/issues
|
|
8
|
+
Author: cmendezs
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
Keywords: cii,e-invoicing,einvoicing,en16931,germany,mcp,peppol,ubl,xrechnung,zugferd
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: lxml>=5.0.0
|
|
23
|
+
Requires-Dist: mcp-einvoicing-core<1.0.0,>=0.3.0
|
|
24
|
+
Requires-Dist: pydantic>=2.0.0
|
|
25
|
+
Requires-Dist: python-dateutil>=2.9.0
|
|
26
|
+
Requires-Dist: reportlab>=4.0.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: lxml-stubs>=0.5.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: types-python-dateutil>=2.9.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: types-reportlab>=0.1.0; extra == 'dev'
|
|
36
|
+
Provides-Extra: pdf
|
|
37
|
+
Requires-Dist: pikepdf>=8.0.0; extra == 'pdf'
|
|
38
|
+
Provides-Extra: pymupdf
|
|
39
|
+
Requires-Dist: pymupdf>=1.24.0; extra == 'pymupdf'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# mcp-einvoicing-de 🇩🇪
|
|
43
|
+
<!-- mcp-name: io.github.cmendezs/mcp-einvoicing-de -->
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
[](https://pypi.org/project/mcp-einvoicing-de/)
|
|
47
|
+
[](https://pypi.org/project/mcp-einvoicing-de/)
|
|
48
|
+
[](https://glama.ai/mcp/servers/cmendezs/mcp-einvoicing-de)
|
|
49
|
+
|
|
50
|
+
MCP-Server (Model Context Protocol) in Python für die **deutsche elektronische Rechnung** in den Formaten **ZUGFeRD 2.x** und **XRechnung 3.x** (EN 16931, FeRD, KoSIT). Ermöglicht KI-Agenten (Claude, IDEs) das Erstellen, Validieren, Parsen und Konvertieren von E-Rechnungen, die vollständig dem deutschen B2B-E-Rechnungsmandat (gültig ab 2025, schrittweise Durchsetzung bis 2027–2028) und der europäischen Norm EN 16931 entsprechen.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## English summary
|
|
55
|
+
|
|
56
|
+
This is a **Model Context Protocol (MCP)** server for **German electronic invoicing**. It exposes **6 tools** covering the full lifecycle of a ZUGFeRD or XRechnung invoice: creation (CII/UBL XML), validation against EN 16931 and KoSIT Schematron rules (BR-DE-*), parsing of existing invoice files, profile and syntax conversion, Peppol participant registration lookup (AS4), and German VAT rules (Steuerklassen, §13b UStG reverse charge, exemptions). Supports all ZUGFeRD 2.x profiles (MINIMUM through EXTENDED) and XRechnung 3.x (CII and UBL syntax). Licensed under **MIT**.
|
|
57
|
+
|
|
58
|
+
## Aufgebaut auf
|
|
59
|
+
|
|
60
|
+
Dieses Paket basiert auf [**mcp-einvoicing-core**](https://github.com/cmendezs/mcp-einvoicing-core), einer gemeinsamen Basisbibliothek für europäische E-Rechnungs-MCP-Server. Sie stellt gemeinsame Modelle, Validierungsabstraktionen, XML-Hilfsfunktionen und die Ausnahmehierarchie bereit.
|
|
61
|
+
|
|
62
|
+
`mcp-einvoicing-core` wird automatisch als transitive Abhängigkeit installiert — kein zusätzlicher Schritt erforderlich.
|
|
63
|
+
|
|
64
|
+
> **Für Entwickler:** `pip install -e ".[dev]"` installiert das Basispaket automatisch aus PyPI.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 🏗️ Architektur
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
mcp-einvoicing-de (dieses Paket — eigenständiger MCP-Server)
|
|
72
|
+
├── ZUGFeRDInvoice / XRechnungInvoice ← Pydantic-Modelle (alle Profile)
|
|
73
|
+
├── SchematronValidator ← EN 16931 + KoSIT BR-DE-* Regeln
|
|
74
|
+
├── KoSITValidator ← Remote-Validierungstool (optional)
|
|
75
|
+
└── Tools: create / validate / parse / convert / peppol_check / tax_rules
|
|
76
|
+
|
|
77
|
+
↑ erweitert
|
|
78
|
+
mcp-einvoicing-core (gemeinsame Basis, als Abhängigkeit installiert)
|
|
79
|
+
├── BaseDocumentGenerator / Validator / Parser
|
|
80
|
+
├── BaseInvoice, BaseParty … (Pydantic)
|
|
81
|
+
├── xml_utils, exceptions
|
|
82
|
+
└── EInvoicingMCPServer
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 🚀 Installation
|
|
88
|
+
|
|
89
|
+
### Über PyPI (empfohlen)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install mcp-einvoicing-de
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Ohne vorherige Installation mit `uvx`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
uvx mcp-einvoicing-de
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Aus den Quellen
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
|
|
105
|
+
cd mcp-einvoicing-de
|
|
106
|
+
|
|
107
|
+
python -m venv .venv
|
|
108
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
109
|
+
|
|
110
|
+
pip install -e ".[dev]"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## ⚙️ Konfiguration
|
|
116
|
+
|
|
117
|
+
Der Server benötigt in v0.1.0 keine externen Zugangsdaten. Verfügbare Umgebungsvariablen:
|
|
118
|
+
|
|
119
|
+
| Variable | Beschreibung | Standard |
|
|
120
|
+
|----------|-------------|---------|
|
|
121
|
+
| `EINVOICING_DE_LOG_LEVEL` | Protokollierungsgrad (`DEBUG`, `INFO`, `WARNING`, `ERROR`) | `INFO` |
|
|
122
|
+
| `EINVOICING_DE_KOSIT_VALIDATOR_URL` | URL des KoSIT-Validierungstools (optional, für Remote-Validierung) | — |
|
|
123
|
+
| `EINVOICING_DE_PEPPOL_SMP_URL` | Peppol-SMP-Lookup-URL (optional) | — |
|
|
124
|
+
| `EINVOICING_DE_PDF_ENGINE` | PDF-Generierungsmodul (`reportlab` oder `pymupdf`) | `reportlab` |
|
|
125
|
+
|
|
126
|
+
### 🤖 Integration Claude Desktop
|
|
127
|
+
|
|
128
|
+
Eintrag in die Datei `claude_desktop_config.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mcpServers": {
|
|
133
|
+
"einvoicing-de": {
|
|
134
|
+
"command": "uvx",
|
|
135
|
+
"args": ["mcp-einvoicing-de"]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### ⌨️ Integration Cursor
|
|
142
|
+
|
|
143
|
+
Konfigurationsdatei (`~/.cursor/mcp.json` oder `.cursor/mcp.json` im Projektverzeichnis):
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"mcpServers": {
|
|
148
|
+
"einvoicing-de": {
|
|
149
|
+
"command": "uvx",
|
|
150
|
+
"args": ["mcp-einvoicing-de"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 🪐 Integration Kiro
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"mcpServers": {
|
|
161
|
+
"einvoicing-de": {
|
|
162
|
+
"command": "uvx",
|
|
163
|
+
"args": ["mcp-einvoicing-de"],
|
|
164
|
+
"disabled": false,
|
|
165
|
+
"autoApprove": []
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 🧰 Verfügbare MCP-Werkzeuge
|
|
174
|
+
|
|
175
|
+
| Werkzeug | Beschreibung |
|
|
176
|
+
|----------|-------------|
|
|
177
|
+
| `invoice_create` | ZUGFeRD- oder XRechnung-XML (CII oder UBL) erzeugen; PDF/A-3-Hybrid geplant (v0.2.0) |
|
|
178
|
+
| `invoice_validate` | Rechnung gegen EN 16931 und KoSIT-Schematron-Regeln (BR-DE-\*) prüfen |
|
|
179
|
+
| `invoice_parse` | Strukturierte Daten aus einer bestehenden ZUGFeRD- oder XRechnung-Datei extrahieren |
|
|
180
|
+
| `invoice_convert` | Zwischen ZUGFeRD-Profilen oder ZUGFeRD ↔ XRechnung konvertieren |
|
|
181
|
+
| `peppol_check` | Peppol-Teilnehmerregistrierung eines deutschen Unternehmens prüfen (AS4) |
|
|
182
|
+
| `tax_rules` | Deutsche Umsatzsteuerregeln abfragen (Steuerklassen, §13b UStG, Befreiungen) |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Verwendungsbeispiele
|
|
187
|
+
|
|
188
|
+
### Beispiel 1 — Rechnung validieren
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
1. invoice_validate(
|
|
192
|
+
xml_base64="...", # Base64-kodiertes ZUGFeRD-XML
|
|
193
|
+
strict=True
|
|
194
|
+
)
|
|
195
|
+
→ {
|
|
196
|
+
"is_valid": true,
|
|
197
|
+
"profile": "EN_16931",
|
|
198
|
+
"syntax": "CII",
|
|
199
|
+
"error_count": 0,
|
|
200
|
+
"warning_count": 2,
|
|
201
|
+
"errors": [],
|
|
202
|
+
"warnings": [...],
|
|
203
|
+
"validator_used": "local_schematron"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Beispiel 2 — Deutsche Steuerregeln abfragen
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
2. tax_rules(query="reverse_charge", context="Bauleistungen")
|
|
211
|
+
→ {
|
|
212
|
+
"results": [
|
|
213
|
+
{
|
|
214
|
+
"paragraph": "§13b Abs. 2 Nr. 5 UStG",
|
|
215
|
+
"description_en": "Construction services (building contractor rule)",
|
|
216
|
+
"vatex_code": "VATEX-EU-AE",
|
|
217
|
+
"invoice_note": "Steuerschuldnerschaft des Leistungsempfängers (§13b UStG)"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"legal_disclaimer": "..."
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Beispiel 3 — Peppol-Registrierung prüfen
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
3. peppol_check(
|
|
228
|
+
participant_id="0204:991-1234512345-06",
|
|
229
|
+
environment="production"
|
|
230
|
+
)
|
|
231
|
+
→ {
|
|
232
|
+
"is_registered": true,
|
|
233
|
+
"participant_id": "0204:991-1234512345-06",
|
|
234
|
+
"document_type_supported": true,
|
|
235
|
+
"access_point_url": "https://ap.example.de/as4",
|
|
236
|
+
"transport_profile": "peppol-transport-as4-v2.0"
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Beispiel 4 — Rechnungsdaten parsen
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
4. invoice_parse(xml_base64="...", include_raw_xml=False)
|
|
244
|
+
→ {
|
|
245
|
+
"profile": "XRECHNUNG",
|
|
246
|
+
"syntax": "CII",
|
|
247
|
+
"invoice_number": "RE-2025-001",
|
|
248
|
+
"invoice_date": "2025-01-15",
|
|
249
|
+
"seller_name": "Muster GmbH",
|
|
250
|
+
"buyer_name": "Käufer AG",
|
|
251
|
+
"tax_inclusive_amount": "119.00",
|
|
252
|
+
"currency_code": "EUR"
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 📚 Unterstützte Standards
|
|
259
|
+
|
|
260
|
+
| Standard | Version | Profile / Syntax |
|
|
261
|
+
|----------|---------|-----------------|
|
|
262
|
+
| ZUGFeRD | 2.3 | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED |
|
|
263
|
+
| XRechnung | 3.x | CII (Cross Industry Invoice), UBL (Universal Business Language) |
|
|
264
|
+
| EN 16931 | — | Europäisches Kerndatenmodell für die elektronische Rechnung |
|
|
265
|
+
| Peppol BIS | 3.0 | Billing 3.0 (DE PINT) |
|
|
266
|
+
|
|
267
|
+
> **Hinweis:** ZUGFeRD 2.x und XRechnung 3.x teilen auf Profilebene EN 16931 dieselbe CII-XML-Syntax. Eine Konvertierung zwischen beiden Formaten ist daher ohne Datenverlust möglich. Das EXTENDED-Profil ist ZUGFeRD-spezifisch und hat kein XRechnung-Äquivalent.
|
|
268
|
+
|
|
269
|
+
| Ressource | Link |
|
|
270
|
+
|-----------|------|
|
|
271
|
+
| FeRD ZUGFeRD-Spezifikation | [ferd-net.de](https://www.ferd-net.de) |
|
|
272
|
+
| KoSIT XRechnung | [xeinkauf.de](https://xeinkauf.de/xrechnung/) |
|
|
273
|
+
| KoSIT Validierungstool | [github.com/itplr-kosit/validationtool](https://github.com/itplr-kosit/validationtool) |
|
|
274
|
+
| EN 16931-1:2017 | [CEN](https://www.cen.eu/) |
|
|
275
|
+
| Peppol BIS Billing 3.0 | [docs.peppol.eu](https://docs.peppol.eu/poacc/billing/3.0/) |
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 🧪 Tests
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Entwicklungsabhängigkeiten installieren
|
|
283
|
+
pip install -e ".[dev]"
|
|
284
|
+
|
|
285
|
+
# Gesamte Testsuite ausführen
|
|
286
|
+
pytest tests/ -v
|
|
287
|
+
|
|
288
|
+
# Mit Abdeckungsbericht
|
|
289
|
+
pytest --cov=mcp_einvoicing_de --cov-report=term-missing
|
|
290
|
+
|
|
291
|
+
# Nur Modell-Tests
|
|
292
|
+
pytest tests/test_models.py -v
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Roadmap
|
|
298
|
+
|
|
299
|
+
| Version | Funktionen |
|
|
300
|
+
|---------|-----------|
|
|
301
|
+
| **v0.1.0** (aktuell) | Werkzeuge: create, validate, parse, convert, peppol_check, tax_rules |
|
|
302
|
+
| **v0.2.0** | PDF/A-3-Einbettung (ZUGFeRD-Hybrid) via `reportlab` / `PyMuPDF` |
|
|
303
|
+
| **v0.3.0** | KoSIT-Online-Validator vollständig integriert |
|
|
304
|
+
| **v0.4.0** | Peppol AS4 Direktübermittlung |
|
|
305
|
+
| **v0.5.0** | DATEV-Exportformat |
|
|
306
|
+
| **v1.0.0** | Produktionsreif, vollständige EN 16931-Abdeckung |
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Mitwirken
|
|
311
|
+
|
|
312
|
+
Beiträge sind willkommen. Bitte öffnen Sie ein Issue, bevor Sie einen Pull Request für wesentliche Änderungen einreichen.
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
git clone https://github.com/cmendezs/mcp-einvoicing-de.git
|
|
316
|
+
cd mcp-einvoicing-de
|
|
317
|
+
pip install -e ".[dev]"
|
|
318
|
+
pytest
|
|
319
|
+
make audit
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Other e-invoicing MCP servers
|
|
325
|
+
|
|
326
|
+
| Country | Server |
|
|
327
|
+
|---------|--------|
|
|
328
|
+
| 🌍 Global | [mcp-einvoicing-core](https://github.com/cmendezs/mcp-einvoicing-core) |
|
|
329
|
+
| 🇧🇪 Belgium | [mcp-einvoicing-be](https://github.com/cmendezs/mcp-einvoicing-be) |
|
|
330
|
+
| 🇫🇷 France | [mcp-facture-electronique-fr](https://github.com/cmendezs/mcp-facture-electronique-fr) |
|
|
331
|
+
| 🇮🇹 Italy | [mcp-fattura-elettronica-it](https://github.com/cmendezs/mcp-fattura-elettronica-it) |
|
|
332
|
+
| 🇩🇪 Germany | [mcp-einvoicing-de](https://github.com/cmendezs/mcp-einvoicing-de) |
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 📄 Lizenz
|
|
337
|
+
|
|
338
|
+
Dieses Projekt steht unter der **MIT-Lizenz**.
|
|
339
|
+
Einzelheiten finden Sie in der Datei [LICENSE](LICENSE).
|
|
340
|
+
|
|
341
|
+
Copyright 2026 cmendezs
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
*Projekt gepflegt von [cmendezs](https://github.com/cmendezs). Für Fragen zur Implementierung der ZUGFeRD- oder XRechnung-Spezifikation bitte ein Issue eröffnen.*
|