mcp-einvoicing-core
mcp-einvoicing-core
主题: mcp mcp-server e-invoicing electronic-invoicing european-invoicing python fastmcp peppol en16931 ubl fatturapa xp-z12-013 xml base-library
用于欧洲电子发票 MCP 服务器的基础包。
提供抽象基类、共享 Pydantic 模型、XML 工具以及 HTTP 客户端,以便特定国家的包(如 mcp-facture-electronique-fr、mcp-fattura-elettronica-it 等)共享通用基础,而无需重复代码。
本包提供的功能
模块 | 内容 | 使用方 |
|
| IT(结构化发票生成),未来 BE/PL/DE/ES |
|
| 所有国家适配器 |
|
| IT(原样提取),未来基于 XML 的格式 |
|
| FR(原样提取),未来基于 API 的国家 |
|
| 所有国家适配器 |
|
| 所有国家适配器 |
Related MCP server: mcp-facture-electronique-fr
安装
pip install mcp-einvoicing-core本包没有特定国家的依赖项。lxml(IT 及未来国家进行 XSD 验证所需)由每个国家的包单独声明。
架构
mcp-einvoicing-core ← this package
├── BaseDocumentGenerator ← abstract: generate(InvoiceDocument) → str
├── BaseDocumentValidator ← abstract: validate(xml) → DocumentValidationResult
├── BaseDocumentParser ← abstract: parse(xml) → dict
├── BaseLifecycleManager ← abstract: submit/search/get_status (async HTTP)
├── BasePartyValidator ← abstract: validate_seller/buyer/tax_id
├── BaseEInvoicingClient ← concrete: async HTTP + OAuth2/no-auth/token
├── InvoiceDocument (Pydantic) ← shared data model
└── EInvoicingMCPServer ← plugin registry wrapping FastMCP
mcp-facture-electronique-fr ← country adapter (FR)
├── PAConfig(OAuthConfig)
├── FlowClient(BaseEInvoicingClient) ← OAuth2, XP Z12-013 Annex A
├── DirectoryClient(BaseEInvoicingClient) ← OAuth2, XP Z12-013 Annex B
└── FrLifecycleManager(BaseLifecycleManager)
mcp-fattura-elettronica-it ← country adapter (IT)
├── ItalyPartyValidator(BasePartyValidator) ← Partita IVA modulo-10
├── FatturaGenerator(BaseDocumentGenerator) ← FatturaPA XML v1.6.1
├── FatturaValidator(BaseDocumentValidator) ← lxml XSD v1.6.1
└── FatturaParser(BaseDocumentParser) ← lxml xpath插件注册模式
国家包在共享或独立的 FastMCP 实例上注册其工具:
# Standalone (existing server.py — no changes required)
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()Claude Desktop / Cursor / Kiro 兼容性
mcp-facture-electronique-fr 和 mcp-fattura-elettronica-it 的现有配置无需更改:工具名称、签名、环境变量和入口点(server:main)均完全保留。
路线图兼容性
国家 | 状态 | 标准 | 传输 | 继承 | 覆盖 | 已知差距 |
✅ 已完成 | XP Z12-013 | 混合 / PPF 中心 |
|
| 无 | |
✅ 已完成 | FatturaPA v1.6.1 | 直接 / SDI |
| 所有抽象方法 |
| |
✅ 已完成 | Peppol BIS 3.0 | AS4 / Peppol | 所有基类 |
| 无 | |
🇵🇱 PL | 🔄 进行中 | KSeF FA(2) | 直接 API |
| KSeF 会话认证流程 |
|
🇩🇪 DE | 🔄 进行中 | ZUGFeRD / XRechnung | AS4 / Peppol | 所有基类 |
|
|
🇪🇸 ES | 🔄 进行中 | FACeB2B / FacturaE | 直接 API | 所有基类 | mTLS 认证 |
|
🇷🇴 RO | 📋 待办 | RO-UBL (EN 16931) | 直接 API / 清算 |
| ANAF 清算流程 | 需要 |
🇬🇷 GR | 📋 待办 | myDATA XML | 直接 API / 报告 |
| myDATA 认证 + 报告流程 | myDATA API 客户端尚未设计 |
🇳🇱🇸🇪🇩🇰🇳🇴 北欧/荷兰 | 📋 待办 | Peppol BIS 3.0 / UBL | AS4 / Peppol | 所有基类 |
| 复用 BE AS4 传输层 |
🇵🇹 PT | 📋 待办 | CIUS-PT + 二维码 | 签名 / 直接 |
| 合格签名 + 二维码注入 | 合格签名集成尚未设计 |
架构说明
传输接口
随着适配器数量的增加,核心库中的 TransportInterface 抽象将防止在共享相同传输层的国家之间出现重复:
传输 | 国家 |
直接 API (清算 / 报告) | FR, RO, GR, HU |
AS4 / Peppol 网络 | BE, DE, 北欧/荷兰 |
混合 / 中心 | FR (PPF/PDP 双路径) |
德国:80% 复用自法国
德国的授权(自 2025 年 1 月起对 B2B 接收生效)非常倾向于 ZUGFeRD/Factur-X —— 与法国 Factur-X 配置文件中嵌入 XML 的 PDF 模型相同。mcp-facture-electronique-fr 的 XML 生成和验证逻辑可以以最小的改动进行复用,使 DE 成为继 BE 之后工作量最小的下一个适配器。
ViDA / DRR (2030)
到 2030 年 7 月,所有国家系统必须符合欧盟跨境交易数字报告要求。在本核心包中使用 EN 16931 作为内部 InvoiceDocument 数据模型,已经为项目提供了面向未来的保障:国家适配器将 EN 16931 转换为本地格式,而不是反向转换。
许可证
Apache 2.0 — 参见 LICENSE。
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.6562MIT
- AlicenseAqualityCmaintenanceModel 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.271Apache 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.7Apache 2.0
Related MCP Connectors
Brazilian fiscal MCP server - issue NF-e, NFC-e, NFS-e, CT-e, MDF-e and DC-e via SEFAZ.
Create, validate, convert & extract compliant e-invoices (UBL, Factur-X, ZUGFeRD, XRechnung)
Workflow diagnostics, capability routing, and x402 settlement for MCP-compatible agents.
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-core'
If you have feedback or need assistance with the MCP directory API, please join our Discord server