
Mcp Einvoicing Be
io.github.cmendezs由 GitHub 账号 cmendezs 发布v0.10.2更新于 Oct 24, 2026
Belgian e-invoicing MCP server: Peppol BIS 3.0, UBL 2.1, EU PINT v1.0.1, Mercurius.
概览
面向比利时电子发票的本地 MCP 服务器,让助手生成、校验、解析并发送 UBL 2.1 / Peppol BIS 3.0 发票,并查询比利时增值税号信息。
- 可以做什么
- 生成与转换发票:根据结构化数据生成 UBL 2.1 比利时电子发票 XML,或将 JSON 数据转换为 UBL(不做完整校验),并列出支持的比利时单据类型及其配置标识。校验发票:对 UBL 2.1 XML 按 EN 16931 基础规则或 Mercurius 叠加规则执行 Schematron 校验,并校验 EUSR、TSR 与 MLS 报告文档。解析发票:将 UBL 2.1 Peppol BIS 3.0 发票读回结构化数据。查询企业:按比利时增值税号查询 BCE/KBO 公共数据库,返回名称、地址、法律状态与 NACE 行业代码。使用 Peppol 网络:查询参与者与服务端点、做 DNS/SML 诊断、搜索 Peppol 目录、通过 AS4 发送发票,以及查询 OpenPeppol 与 EN 16931 代码表。
- 适用场景
- 当你处理比利时 B2B 或 B2G 电子发票,希望助手起草、检查或读取 UBL 2.1 发票、核实比利时企业增值税信息,或在发送前查看 Peppol 注册情况时适用。它针对比利时 Peppol 体系与 Mercurius 公共部门规则,而非其他国家的格式。
- 运行要求
- 以 Python 包形式在本机运行(需 Python 3.11 或更高版本,可用 uv 或 pip 安装)。BCE_API_KEY 环境变量对增值税查询是可选的;PEPPOL_ENV 选择生产或测试环境。代码表工具需通过 EINVOICING_PEPPOL_CODELIST_DIR 与 EINVOICING_EN16931_CODELIST_DIR 提供本地代码表副本,报告与 MLS 工具需安装 xslt2 附加组件。发送发票需要 Peppol 接入点。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp Einvoicing Be,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mcp-einvoicing-be 🇧🇪
English | Francais | Nederlands
[PyPI version] [Python] [License] [mcp-einvoicing-be MCP server]
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.
Installation
Requirements
- Python ≥ 3.11
mcp-einvoicing-core(installed automatically as a dependency)
Using uv (recommended)
Using pip
From source
Configuration
Environment variables
The EUSR/TSR reporting and MLS tools additionally require the [xslt2] extra (pip install "mcp-einvoicing-be[xslt2]") for Schematron validation.
Claude Desktop integration
To use this server with Claude, add this configuration to your claude_desktop_config.json file:
For a local development install:
Cursor integration
Cursor supports MCP servers via stdio. Add the configuration in:
- Global (all projects):
~/.cursor/mcp.json - Project (this repository only):
.cursor/mcp.json
Reload the Cursor window (Ctrl+Shift+P then Reload Window) to apply the changes.
Kiro integration
Kiro supports MCP servers via its dedicated configuration file. Two levels are available:
- Global (all projects):
~/.kiro/settings/mcp.json - Workspace (this repository only):
.kiro/settings/mcp.json
The file is automatically reloaded on save. You can also open the config via the command palette (Cmd+Shift+P / Ctrl+Shift+P) then MCP.
Kiro security tip: rather than writing secrets in plain text, use the syntax
"BCE_API_KEY": "${BCE_API_KEY}", Kiro resolves shell environment variables at startup.
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.
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.
The InvoiceInput object supports:
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.
lookup_vat_be
Looks up a Belgian enterprise number (VAT number) against the BCE/KBO public database.
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).
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.
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.
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
Relationship 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
Vendor neutrality
This server implements the standard itself: it builds, validates, and signs the document locally. It is not a client for a commercial invoicing platform, and your signing keys and credentials never leave your own infrastructure.
A Peppol access point is required, but any accredited access point speaks the same AS4 profile, so switching providers is a configuration change, not a code change.
Contributing
Contributions are welcome. Please open an issue to discuss significant changes before submitting a pull request.
All 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
License
This project is licensed under the Apache 2.0 — see LICENSE for details. For the full version history, see CHANGELOG.md.
来源:README.md,提交 2cce240
工具
0版本历史
1- v0.10.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分