mcp-einvoicing-core
mcp-einvoicing-core
English | Francais | Deutsch | Italiano | Espanol | Portugues (Brasil) | العربية
Topics: mcp mcp-server e-invoicing electronic-invoicing python fastmcp peppol en16931 ubl fatturapa xp-z12-013 nfe xml base-library
Base package for electronic invoicing MCP servers.
Provides shared Pydantic models, EN 16931 invoice tree, UBL/CII wire format serializers, an OAuth2 HTTP client, Peppol SMP lookup, digital signature primitives, and a compliance audit framework so country-specific packages share a common foundation without duplicating code.
What this package provides
Module | Contents |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Compliance audit framework: |
Related MCP server: mcp-facture-electronique-fr
Country packages
Country | Package | Standard | Scope | Coverage status |
🇧🇪 Belgium | Peppol BIS 3.0 / PINT-BE | B2B, 1 January 2026 | Live; Peppol-specific overlay rules not checked (EN 16931 base only) | |
🇧🇷 Brazil | NF-e / NFC-e (modelo 55/65, schema 4.00) / NFS-e Nacional | B2B (NF-e) + B2C (NFC-e), both mandatory since 2008 | Live; IBS/CBS tax reform rollout ongoing through 2033 | |
🇫🇷 France | NF XP Z12-012 / NF XP Z12-013 / Factur-X / UBL 2.1 / CII | B2B, phased rollout from 1 September 2026 | Live | |
🇩🇪 Germany | ZUGFeRD 2.x / XRechnung 3.x | B2B, phased 2025 to 2028 | Live | |
🇮🇳 India | GST e-invoicing / FORM GST INV-01 schema v1.1 / IRP-IRN (INV + CRN + DBN) | B2B + B2G, mandatory under CGST Rule 48(4) for taxpayers with AATO above ₹5 crore, since 1 August 2023 | Pre-release (v0.1.0, unpublished); Phase A only (build + offline validation + QR rendering) — live IRP submission pending the NIC API spec | |
🇮🇹 Italy | FatturaPA / SDI | B2G + B2B + B2C, mandatory since 2019 (B2G since 2014) | Live | |
🇲🇽 Mexico | CFDI 4.0 / Complemento de Pagos 2.0 | B2B + B2G, mandatory nationwide | Live; PAC submission transport pending | |
🇵🇱 Poland | KSeF FA(3) / FA(2) / Peppol BIS 3.0 | B2B, phased February 2026 to January 2027 | Live; batch session flow not implemented | |
🇸🇬 Singapore | PINT-SG v1.4.1 / SG Peppol BIS Billing 3.0 | B2B, mandatory for GST-registered businesses from April 2026 | Live; validation scope limited to IRAS C5 acceptance checks, PINT-SG jurisdiction Schematron and EN 16931 base validation not yet wired | |
🇪🇸 Spain | Factura-e / VeriFactu / SII / FACe | Pending Orden Ministerial, targeted 2026-10-01 | Live for VeriFactu/SII; B2B format wiring blocked on pending Orden Ministerial | |
🇦🇪 United Arab Emirates | PINT AE (billing + self-billing) / Peppol AE TDD | B2B + B2G, voluntary pilot from July 2026, mandatory for large taxpayers from January 2027 | Live; validates CEN EN16931 base Schematron only, PINT AE jurisdiction overlay and TDD validation not yet available |
Installation
pip install mcp-einvoicing-coreFor the compliance audit framework (used by country package CI):
pip install mcp-einvoicing-core[audit]For XSLT 2.0/3.0 Schematron validation (SaxonSchematronValidator — needed for Schematron
rule sets using XPath 2.0+ constructs, e.g. FNFE-MPE Factur-X 1.08 / ZUGFeRD):
pip install mcp-einvoicing-core[xslt2]Configuration
Variable | Used by | Purpose |
|
| Local directory containing your own copy of the OpenPeppol eDEC Code Lists. Not bundled with this package: the eDEC Code Lists carry no confirmed redistribution grant from OpenPeppol, so core ships only the parser and lookup tools, never the data itself. Download the "as GeneriCode" export for each artifact (Document Types, Participant Identifier Schemes, Processes, Transport Profiles, SPIS Use Case) from docs.peppol.eu/edelivery/codelists and point this variable at the directory containing them. Filenames are matched by prefix, so a version bump (e.g. v9.7 to v9.8) needs no code change. Without this set, the codelist tools return a |
|
| Local directory containing your own copy of the CEF EN 16931 semantic code lists (country, currency, ICD, UNCL1001/1153/4461/5305, allowance/item/charge reason, MIME, EAS, VATEX). Not bundled, same posture as the eDEC lists above — download the "as GeneriCode" export bundle from the CEF EN 16931 code lists page. Filenames match exactly ( |
|
| Local directory with |
|
| Comma-separated hostname suffixes to extend the built-in Peppol Access Point allowlist used when validating a resolved SMP hostname. |
|
| Comma-separated |
Architecture
Country packages subclass the core abstractions and register their tools on a shared or standalone MCP server:
mcp-einvoicing-core
├── EN16931Invoice / InvoiceDocument ← canonical invoice models
├── EN16931CreditNote ← credit note (type codes 381/383/384/385)
├── EN16931UBL/CII Serializer/Parser ← wire format round-trip
├── convert_wire_format ← CII ↔ UBL conversion
├── BaseDocumentGenerator/Validator/Parser/LifecycleManager
├── BaseEInvoicingClient ← async HTTP (OAuth2/mTLS/bearer/API key/JWS)
├── PeppolSMPClient ← participant lookup via SMP/SML
├── PeppolTransmitter ← AS4 outbound transmission
├── BaseDocumentSigner ← XAdES-EPES / XMLDSig
├── BaseEnvironmentEndpoints ← sandbox/production URL routing
├── RoutingIdentifier ← country-specific routing ID validation
├── EInvoicingMCPServer ← plugin registry wrapping FastMCP
└── Audit framework ← per-package compliance checksVendor neutrality
Every server in this family implements the standard itself. It builds, validates and signs the document locally, and the signing keys stay in your infrastructure. None of these packages is a client for a commercial invoicing platform, and no vendor account is needed to run one.
What differs between countries is the last mile: who, if anyone, must stand between you and
the tax authority. mcp-einvoicing-core supports all three arrangements, and each country
package implements exactly the one its jurisdiction uses:
Direct to the authority. No intermediary is legally required; the package talks to the government endpoint with your own accreditation. (Italy, Poland, Brazil, Spain)
Substitutable intermediary. An intermediary is required, but its API is standardized, so changing provider is a configuration change, not a code change. (France's PDP under XP Z12-013; Peppol access points for Belgium, Singapore, the UAE)
Adapter-per-vendor intermediary. An intermediary is required and each vendor's API differs. The document and the keys still stay yours; only the transport adapter is vendor-specific. (Mexico's PAC, India's GSP)
In all three, the compliance logic and the private keys stay with you.
Plugin registration pattern
Country packages register their tools on a shared or standalone FastMCP instance:
# Standalone
from fastmcp import FastMCP
mcp = FastMCP(name="mcp-fattura-elettronica-it", instructions="...")
register_header_tools(mcp)
register_body_tools(mcp)
register_global_tools(mcp)
# Multi-country (optional EInvoicingMCPServer)
from mcp_einvoicing_core import EInvoicingMCPServer
server = EInvoicingMCPServer(name="mcp-einvoicing-eu", instructions="...")
server.register_plugin(register_header_tools, "it-header")
server.register_plugin(register_flow_tools, "fr-flow")
server.run()Core also ships its own mountable Peppol tool plugin so country packages stop reimplementing
SMP lookup and AS4 send. Supply a national identifier adapter (a small function that normalizes
a bare national number, e.g. a VAT number, into a Peppol "<scheme>:<value>" participant ID):
from mcp_einvoicing_core.peppol.tools import register_peppol_tools
def be_id_adapter(identifier: str) -> str:
if ":" in identifier:
return identifier
return f"0208:{normalize_vat_be(identifier)[2:]}" # KBO/BCE scheme
server.register_plugin(
lambda m: register_peppol_tools(m, id_adapter=be_id_adapter), "peppol"
)This registers peppol_lookup_participant, peppol_get_service_endpoint, resolve_peppol_dns,
peppol_send, peppol_directory_search, and 8 OpenPeppol eDEC code list tools (see Configuration
above for EINVOICING_PEPPOL_CODELIST_DIR, required for the code list tools). Separate mountable
plugins cover the EN 16931 semantic code lists (en16931_codelist_tools.register_en16931_codelist_tools),
Peppol reporting (peppol.reporting_tools.register_peppol_reporting_tools), and MLS
(peppol.mls_tools.register_peppol_mls_tools).
Claude Desktop / Cursor / Kiro compatibility
Existing configurations for country packages require no changes: tool names,
signatures, environment variables, and entry points (server:main) are fully preserved.
License
Apache 2.0 -- see LICENSE.
Maintenance
Related MCP Connectors
MCP server for Codat — companies, connections, invoices, bills and financial statements.
Generate & validate EN 16931 e-invoices (Factur-X, ZUGFeRD, XRechnung); verification certificates
XRechnung and ZUGFeRD e-invoicing (EN 16931): create, validate, check Leitweg-IDs, German VAT.
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
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.630 npm2MIT
- AlicenseAqualityAmaintenanceModel 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.234Apache 2.0
- AlicenseAqualityAmaintenanceModel 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.4355 PyPI1Apache 2.0
- AlicenseAqualityAmaintenanceModel 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.5044 PyPIApache 2.0