关于 invapi-mcp
invapi-mcp 是面向电子发票处理流程的 Invapi E-Invoicing API MCP 服务。它通过一组发票工具整合格式转换、标准校验和数据提取。
主要功能
- 01转换 JSON、UBL 和 CII 发票
- 02生成 ZUGFeRD PDF 和 Excel 文件
- 03校验 UBL、CII 和 XML
- 04从 PDF 或图像提取发票数据
- 05提取二维码数据
- 06单次批量转换最多 100 项
适用场景
- 01在 JSON 与 UBL 或 CII 之间转换发票
- 02按 XRechnung 3.0.2 校验 XML
- 03从发票扫描件提取结构化数据
- 04在一次请求中处理多项转换
MCP 相关
它将 Invapi E-Invoicing API 的转换、校验、提取和账户信息操作作为 MCP 工具提供。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
14收录的工具列表 · 更新于 3 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| invoice | object | 是 | |
| invoice.id | string | 否 | |
| invoice.buyer | object | 是 | 接收发票的一方 |
| invoice.buyer.name | any | 是 | |
| invoice.buyer.contact | any | 是 | |
| invoice.buyer.postal_address | any | 是 | |
| invoice.buyer.vat_identifier | any | 否 | |
| invoice.items | array | 是 | 发票行项目(至少 1 项) |
| invoice.seller | object | 是 | 开具发票的一方 |
| invoice.seller.name | string | 是 | 当事方的正式全名 |
| invoice.seller.contact | object | 是 | |
| invoice.seller.contact.email_address | string | 否 | 邮箱地址 |
| invoice.seller.contact.telephone_number | string | 否 | 电话号码 |
| invoice.seller.postal_address | object | 是 | |
| invoice.seller.postal_address.city | string | 是 | 城市名称 |
| invoice.seller.postal_address.post_code | string | 是 | 邮政编码 |
| invoice.seller.postal_address.country_code | string | 是 | ISO 3166-1 alpha-2 国家/地区代码,例如 'DE'、'US'、'FR' |
| invoice.seller.postal_address.address_line_1 | string | 是 | 街道地址第 1 行 |
| invoice.seller.postal_address.address_line_2 | string | 否 | 街道地址第 2 行 |
| invoice.seller.postal_address.address_line_3 | string | 否 | 街道地址第 3 行 |
| invoice.seller.postal_address.country_subdivision | string | 否 | 州/省/地区 |
| invoice.seller.vat_identifier | string | 否 | 增值税识别号 |
| invoice.totals | object | 是 | |
| invoice.totals.paid_amount | number | 是 | 已支付金额 |
| invoice.totals.sum_of_charges | number | 否 | |
| invoice.totals.rounding_amount | number | 否 | |
| invoice.totals.total_vat_amount | number | 是 | 增值税总额 |
| invoice.totals.sum_of_allowances | number | 否 | |
| invoice.totals.total_amount_with_vat | number | 是 | 含增值税的所有行项目金额总和 |
| invoice.totals.amount_due_for_payment | number | 是 | 应付金额 |
| invoice.totals.total_amount_without_vat | number | 是 | 不含增值税的所有行项目金额总和 |
| invoice.totals.invoice_total_without_vat | number | 否 | |
| invoice.category | string | 否 | 发票类别 |
| invoice.invoice_date | string | 是 | 开具日期,格式为 YYYY-MM-DD |
| invoice.invoice_note | string | 否 | |
| invoice.invoice_type | enum | 是 | 'incoming' = 从供应商处收到;'outgoing' = 发送给客户incoming | outgoing |
| invoice.invoice_number | string | 是 | 唯一的发票标识符,例如 'INV-2025-001' |
| invoice.additional_data | object | 否 | |
| invoice.additional_data.project | string | 否 | 项目参考信息 |
| invoice.additional_data.order_id | string | 否 | |
| invoice.additional_data.leitweg_id | string | 否 | 德国政府发票的 Leitweg-ID |
| invoice.additional_data.customer_id | string | 否 | |
| invoice.additional_data.delivery_id | string | 否 | |
| invoice.additional_data.reverse_charge | boolean | 否 | 如果适用增值税反向征收,则为 True |
| invoice.additional_data.invoicing_period | object | 否 | |
| invoice.additional_data.invoicing_period.end | string | 是 | 期间结束日期(YYYY-MM-DD) |
| invoice.additional_data.invoicing_period.start | string | 是 | 期间开始日期(YYYY-MM-DD) |
| invoice.additional_data.preceeding_invoice_number | string | 否 | |
| invoice.invoice_description | string | 是 | 发票的简短说明 |
| invoice.payment_information | object | 是 | |
| invoice.payment_information.payment_type | enum | 否 | 付款方式credit_card | credit_transfer | cash | online_payment_service |
| invoice.payment_information.payment_terms | string | 否 | |
| invoice.payment_information.credit_card_type | string | 否 | |
| invoice.payment_information.payment_due_date | string | 否 | 截止日期(YYYY-MM-DD) |
| invoice.payment_information.payment_reference | string | 否 | |
| invoice.payment_information.credit_card_number | string | 否 | |
| invoice.payment_information.payment_payed_date | string | 否 | 付款日期(YYYY-MM-DD) |
| invoice.payment_information.payment_instructions | string | 否 | |
| invoice.payment_information.payment_account_number | string | 否 | IBAN 或账号 |
| invoice.delivery_information | object | 否 | |
| invoice.delivery_information.deliver_to | string | 否 | 收货方名称 |
| invoice.delivery_information.delivery_date | string | 否 | 交付日期(YYYY-MM-DD) |
| invoice.delivery_information.delivery_method | string | 否 | |
| invoice.delivery_information.deliver_to_address | object | 否 | |
| invoice.delivery_information.deliver_to_address.city | string | 是 | |
| invoice.delivery_information.deliver_to_address.post_code | string | 是 | |
| invoice.delivery_information.deliver_to_address.country_code | string | 是 | |
| invoice.delivery_information.deliver_to_address.address_line_1 | string | 是 | 街道地址第 1 行 |
| invoice.delivery_information.deliver_to_address.address_line_2 | string | 否 | |
| invoice.delivery_information.deliver_to_address.address_line_3 | string | 否 | |
| invoice.delivery_information.deliver_to_address.country_subdivision | string | 否 | |
| invoice.delivery_information.delivery_instructions | string | 否 | |
| invoice.invoice_currency_code | string | 是 | ISO 4217 货币代码,例如 'EUR'、'USD'、'GBP' |
| output_path | string | 否 | 用于保存 UBL XML 输出的文件路径。如果省略,则以内联形式返回 XML。 |
详细介绍
@invapi/mcp-server
适用于 Invapi 电子发票 API 的 MCP 服务,可转换、验证和提取 UBL、CII、ZUGFeRD、Excel 等格式的发票。
快速开始
npm install -g @invapi/mcp-server
设置你的 API 密钥(可在 invapi.org 获取):
export INVAPI_API_KEY=your-api-key
用法
Claude Desktop
添加到 claude_desktop_config.json:
{
"mcpServers": {
"invapi": {
"command": "npx",
"args": ["-y", "@invapi/mcp-server"],
"env": {
"INVAPI_API_KEY": "your-api-key"
}
}
}
}
Claude Code
claude mcp add -e INVAPI_API_KEY=xxx invapi -- npx @invapi/mcp-server
工具
转换
| 工具 | 说明 |
|---|---|
invapi_convert_json_to_ubl | JSON 发票 → UBL XML |
invapi_convert_json_to_cii | JSON 发票 → CII XML |
invapi_convert_ubl_to_json | UBL XML → JSON 发票 |
invapi_convert_cii_to_json | CII XML → JSON 发票 |
invapi_convert_json_to_xlsx | JSON 发票 → Excel 文件 |
invapi_create_zugferd_pdf | PDF + JSON 发票 → ZUGFeRD PDF |
invapi_convert_zugferd_to_json | ZUGFeRD PDF → JSON 发票 |
验证
| 工具 | 说明 |
|---|---|
invapi_validate_ubl | 根据 XRechnung 3.0.2(EN 16931)验证 UBL XML |
invapi_validate_cii | 根据 XRechnung 3.0.2(EN 16931)验证 CII XML |
invapi_validate_xml | 自动检测格式并验证 XML |
提取
| 工具 | 说明 |
|---|---|
invapi_extract_invoice | 从 PDF 或图像中提取结构化发票数据 |
invapi_extract_qr | 从图像中提取二维码数据 |
用户
| 工具 | 说明 |
|---|---|
invapi_get_user | 获取账户信息和剩余 API 额度 |
批量处理
| 工具 | 说明 |
|---|---|
invapi_batch_convert | 在单个请求中运行最多 100 项转换操作 |
开发
git clone https://github.com/invapi/invapi-mcp.git
cd invapi-mcp
npm install
npm run dev
许可证
MIT
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。