mcp-einvoicing-be
This server provides tools for Belgian electronic invoicing, covering validation, generation, transformation, and lookup operations.
Validate Belgian E-Invoices (
validate_invoice_be): Validate a UBL 2.1 XML invoice against Belgian business rules (EN 16931) with a choice of profile overlays — Peppol BIS Billing 3.0, PINT-BE, or Mercurius — returning structured per-rule errors and warnings.Validate Against PINT-BE Rules (
validate_pint_be): Validate an invoice specifically against PINT-BE rules published by the National Bank of Belgium (NBB), which adds Belgian-specific mandatory elements on top of EN 16931.Generate Belgian E-Invoice XML (
generate_invoice_be): Generate a fully compliant UBL 2.1 Belgian e-invoice XML from structured data, applying the correctcustomizationIDandprofileIDfor Peppol BIS 3.0 or PINT-BE profiles.Transform JSON to UBL XML (
transform_to_ubl): Convert a structured JSON invoice payload to UBL 2.1 XML without validation — useful as a conversion step before separate validation or platform submission.Look Up Belgian VAT/Enterprise Numbers (
lookup_vat_be): Query the BCE/KBO public database for a Belgian enterprise number to retrieve legal name, address, legal form, status, and NACE activity codes.Check Peppol Participant Registration (
check_peppol_participant_be): Verify whether a Belgian company is registered as a Peppol participant via SMP/SML, returning registration status, supported document types, and the SMP access point URL.List Supported Invoice Document Types (
get_invoice_types_be): Retrieve supported Belgian e-invoice document types (invoice, credit note, debit note) with their UBLcustomizationIDandprofileIDvalues for each profile.
mcp-einvoicing-be 🇧🇪
English | Francais | Nederlands
Introduction
mcp-einvoicing-be is an MCP (Model Context Protocol) server that exposes tools for Belgian electronic invoicing. It covers the full Belgian e-invoicing ecosystem: Peppol BIS Billing 3.0, UBL 2.1, and the Mercurius network for public-sector invoicing. The server is part of the mcp-einvoicing-* family of country-specific servers, all built on top of mcp-einvoicing-core, which provides the shared validation engine, UBL abstractions, and Peppol network utilities.
Related MCP server: mcp-facture-electronique-fr
Installation
Requirements
Python ≥ 3.11
mcp-einvoicing-core(installed automatically as a dependency)
Using uv (recommended)
uv add mcp-einvoicing-beUsing pip
pip install mcp-einvoicing-beFrom source
git clone https://github.com/cmendezs/mcp-einvoicing-be.git
cd mcp-einvoicing-be
uv sync --all-extrasConfiguration
Add the server to your MCP client configuration. For Claude Desktop, edit claude_desktop_config.json:
{
"mcpServers": {
"einvoicing-be": {
"command": "uvx",
"args": ["mcp-einvoicing-be"]
}
}
}For a local development install:
{
"mcpServers": {
"einvoicing-be": {
"command": "uv",
"args": ["run", "mcp-einvoicing-be"],
"cwd": "/path/to/mcp-einvoicing-be"
}
}
}Environment variables
Variable | Description | Default |
| API key for the Belgian BCE/KBO enterprise database | — |
| Peppol environment: |
|
| Override the SML lookup URL | (auto) |
| Local directory containing your own copy of the OpenPeppol eDEC Code Lists, required by the codelist tools (not bundled with this package; see | — |
| Local directory containing your own copy of the CEF "Digital Building Blocks" EN 16931 semantic code lists, required by the EN 16931 codelist tools (not bundled; see | — |
| Logging level: |
|
The EUSR/TSR reporting and MLS tools additionally require the [xslt2] extra (pip install "mcp-einvoicing-be[xslt2]") for Schematron validation.
Available Tools
validate_invoice_be
Validates a UBL 2.1 XML invoice. The peppol-bis-3/pint-eu profiles run real Schematron validation against the CEN EN 16931 base rules (~50 BR-* structural/arithmetic rules, via mcp-einvoicing-core's bundled base Schematron — see CHANGELOG.md v0.8.0). This does not check the Peppol-specific overlay rules (no confirmed OpenPeppol redistribution rights); results carry an explicit en16931-base-only scope warning and should not be read as full Peppol BIS3 conformance. The mercurius profile runs the Mercurius-specific overlay (endpoint scheme, PO reference) but does not check base EN 16931/Peppol BIS 3.0 compliance.
Parameter | Type | Required | Description |
|
| yes | Raw UBL 2.1 XML content |
|
| no |
|
Returns a ValidationResult with valid, errors, and warnings (each carrying the failed rule ID and a human-readable message).
generate_invoice_be
Generates a valid UBL 2.1 Belgian e-invoice XML document from structured data.
Parameter | Type | Required | Description |
|
| yes | Invoice fields (see |
|
| no |
|
The InvoiceInput object supports:
{
"invoice_number": "INV-2024-001",
"issue_date": "2024-01-15",
"due_date": "2024-02-14",
"currency_code": "EUR",
"supplier": { "name": "...", "vat_number": "BE0428759497", "address": {...} },
"customer": { "name": "...", "vat_number": "BE0403170701", "address": {...} },
"lines": [{ "description": "...", "quantity": 1, "unit_price": 100.00, "vat_rate": 21.0 }]
}Returns a UBL 2.1 XML string.
transform_to_ubl
Converts a structured JSON invoice payload to UBL 2.1 XML without full validation. Useful as a first step before validation.
Parameter | Type | Required | Description |
|
| yes | Source invoice data (same shape as |
lookup_vat_be
Looks up a Belgian enterprise number (VAT number) against the BCE/KBO public database.
Parameter | Type | Required | Description |
|
| yes | Belgian VAT/enterprise number, e.g. |
Returns enterprise name, registered address, legal status, and NACE activity codes.
Peppol network tools
Peppol participant lookup, service-endpoint lookup, a DNS-only diagnostic, AS4 send, Peppol Directory search, and the OpenPeppol eDEC codelist tools are provided by the shared core Peppol tool plugin (mcp_einvoicing_core.peppol.tools.register_peppol_tools), mounted in server.py with a BE-specific identifier adapter: a bare Belgian VAT number (e.g. 0428759497 or BE0428759497) is normalized to the 0208:<digits> Peppol scheme (KBO/BCE enterprise number); an already scheme-qualified identifier (e.g. 0208:0428759497) passes through unchanged.
peppol_send signs outbound messages with a real wsse:Security signature as of mcp-einvoicing-core v1.20.0 (previously computed and discarded — see CHANGELOG.md v0.10.0).
Tool | Description |
| Check whether a business is registered on the Peppol network; returns registration status and supported document types |
| Fetch the AS4 endpoint for a participant's document type |
| DNS-only (SML) diagnostic, independent of SMP reachability |
| Transmit a UBL/CII invoice via AS4 |
| Search the public Peppol Directory by participant, name, country, or document type |
| OpenPeppol eDEC codelist lookups (require |
| OpenPeppol eDEC codelist checks and version reporting |
See the mcp-einvoicing-core README for full parameter documentation on these tools.
Peppol reporting and status tools
Added in v0.10.0 via three opt-in core plugins, mounted unconditionally in server.py. Each raises a clear error at call time (not at registration) if its extra or data directory is missing.
Tool | Plugin | Description |
|
| Validate an End User Statistics Report (XSD, then Schematron). Requires the |
|
| Validate a Transaction Statistics Report (XSD, then Schematron). Requires the |
|
| Validate a Message Level Status document (UBL |
|
| Build a document-level MLS response. Requires the |
13 |
| EN 16931 semantic code list lookups/checks (units, VAT categories, etc.). Require |
See the mcp-einvoicing-core README for full parameter documentation on these tools.
parse_ubl_invoice_be
Parses a UBL 2.1 XML invoice (Peppol BIS 3.0) into a structured dict. Satisfies the mandatory reception capability required by Art. 13quater of Royal Decree no. 1.
Parameter | Type | Required | Description |
|
| yes | Raw UBL 2.1 XML invoice content |
Returns {"success": true, "invoice": {...}, "warnings": []} on success, or {"success": false, "error": "..."} on parse failure.
get_invoice_types_be
Returns the list of supported Belgian e-invoice document types (invoice, credit note, debit note) with their UBL customizationID and profileID values for each profile.
No input parameters required.
B2G via Mercurius
Mercurius is the Belgian federal public-sector e-invoicing platform. It operates as a Peppol network receiver, not a separate API. B2G invoices are submitted through the standard Peppol network using the authority's participant ID in the 0208 scheme (KBO/BCE 10-digit enterprise number). The Access Point routes the invoice to Mercurius automatically. No Mercurius-specific submission endpoint or API key is required.
Architecture
mcp-einvoicing-be/
├── src/
│ └── mcp_einvoicing_be/
│ ├── __init__.py
│ ├── server.py # MCP server entry point & tool registration
│ ├── tools/
│ │ ├── __init__.py
│ │ ├── validation.py # validate_invoice_be
│ │ ├── generation.py # generate_invoice_be
│ │ ├── transformation.py # transform_to_ubl
│ │ ├── parsing.py # parse_ubl_invoice_be
│ │ └── lookup.py # lookup_vat_be, get_invoice_types_be
│ ├── models/
│ │ ├── __init__.py
│ │ ├── invoice.py # InvoiceInput, InvoiceLine, ValidationResult
│ │ └── party.py # Supplier, Customer, Address
│ ├── standards/
│ │ ├── __init__.py
│ │ ├── peppol_bis_3.py # Peppol BIS Billing 3.0 rules & customization IDs
│ │ ├── ubl.py # UBL 2.1 namespace constants & XML helpers
│ │ ├── pint_be.py # PINT-BE placeholder (removed in v0.4.0)
│ │ └── mercurius.py # Mercurius network config & overlay rules
│ └── utils/
│ ├── __init__.py
│ └── helpers.py # VAT number normalization, date formatting, etc.
├── tests/
│ ├── __init__.py
│ ├── conftest.py
│ ├── test_tools/
│ │ ├── __init__.py
│ │ ├── test_validation.py
│ │ ├── test_generation.py
│ │ └── test_transformation.py
│ └── fixtures/
│ ├── invoice_valid_peppol.xml
│ ├── invoice_valid_pint_be.xml
│ └── invoice_invalid.xml
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── publish.yml
├── pyproject.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
└── LICENSERelationship to mcp-einvoicing-core
mcp-einvoicing-core provides:
Shared UBL 2.1/2.3 XML parsing and serialization utilities
EN 16931 base validation rules (syntax + semantic)
Peppol network client (SMP lookup, SML resolution)
Common Pydantic base models (
BaseInvoice,BaseParty,BaseValidationResult)
mcp-einvoicing-be adds Belgium-specific logic on top:
Mercurius network overlay rule validation (XPath-based) for B2G invoicing
BCE/KBO enterprise database integration
Belgian VAT number normalization (BTW/TVA format) and OGM/VCS check-digit validation
UBL 2.1 invoice parsing for mandatory reception (Art. 13quater)
customizationIDandprofileIDvalues specific to the Belgian Peppol corner
Contributing
Contributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.
git clone https://github.com/cmendezs/mcp-einvoicing-be.git
cd mcp-einvoicing-be
uv sync --all-extras
uv run pytest
uv run ruff check src tests
uv run mypy srcAll pull requests must:
Pass the full test suite (
pytest)Pass linting (
ruff check)Pass type checking (
mypy)Include or update tests for any changed behaviour
Reference the relevant rule ID(s) when fixing a validation issue
See CONTRIBUTING.md for full guidelines.
Other e-invoicing MCP servers
Country | Server |
🌍 Global | |
🇧🇪 Belgium | |
🇧🇷 Brazil | |
🇫🇷 France | |
🇩🇪 Germany | |
🇮🇹 Italy | |
🇵🇱 Poland | |
🇪🇸 Spain |
License
This project is licensed under the Apache 2.0 — see LICENSE for details.
Changelog
See CHANGELOG.md for a full list of changes by version.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.6542MIT
- 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.34Apache 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.431Apache 2.0
- AlicenseAqualityAmaintenanceModel Context Protocol (MCP) server for German Electronic Invoicing (ZUGFeRD 2.x / XRechnung 3.x). Provides tools to validate, generate, parse, and convert invoices compliant with EN 16931 and KoSIT.81Apache 2.0
Related MCP Connectors
Create, validate, convert & extract compliant e-invoices (UBL, Factur-X, ZUGFeRD, XRechnung)
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmendezs/mcp-einvoicing-be'
If you have feedback or need assistance with the MCP directory API, please join our Discord server