Skip to main content
Glama
invoiceflow-mcp

invoiceflow-mcp

by automatiabcn

InvoiceFlow MCP

用于模型上下文协议 (MCP) 的 AI 驱动发票自动化工具

License: MIT TypeScript MCP

InvoiceFlow 可以创建专业的 PDF 发票,利用 AI 预测逾期付款风险,自动发送提醒,将收到的付款与发票进行匹配,并跟踪您的现金流——所有这些都通过 MCP 协议完成。


功能特性

  • 专业的 PDF 发票:包含明细项目、税费、折扣、多币种(10 种货币)

  • AI 风险预测 (0-100):基于发票金额、客户历史记录、到期日、提醒历史记录进行预测

  • 智能提醒:根据风险等级进行升级提醒

  • 付款核对:通过金额 + 付款人邮箱将收到的付款与发票进行匹配(平台无关——适用于手动输入或通过 Webhook 提供的付款数据)

  • 现金流报告:包含收款率、预计收入、客户明细

  • 客户管理:自动跟踪付款历史记录

  • 顺序发票编号 (INV-2026-0001, INV-2026-0002, ...)

  • 10 个 MCP 工具 + 4 个 MCP 资源,涵盖完整的发票生命周期


Related MCP server: Invoice Generator AI MCP

快速入门

从 MCPize 市场安装

  1. 在 mcpize.com 上搜索 InvoiceFlow MCP

  2. 点击 Install 并选择您的订阅等级

  3. 工具和资源将自动在任何兼容 MCP 的客户端中可用

从源码构建

git clone https://github.com/enzoemir1/invoiceflow-mcp.git
cd invoiceflow-mcp
npm ci
npm run build

添加到您的 MCP 客户端配置中:

{
  "mcpServers": {
    "invoiceflow": {
      "command": "node",
      "args": ["path/to/invoiceflow-mcp/dist/index.js"]
    }
  }
}

工具

client_manage

创建新客户。在创建发票之前必须执行此操作。

invoice_create

创建带有明细项目的发票。自动计算小计、税费、折扣和总额。生成顺序发票编号 (INV-YYYY-NNNN)。

invoice_send

通过电子邮件发送发票 PDF(需要 SENDGRID_API_KEY)。将状态更新为“已发送”。

invoice_list

按状态、客户、金额范围、日期范围或逾期状态筛选发票。支持分页。

invoice_mark_paid

将发票标记为已支付(全额或部分)。自动更新客户付款历史记录。

invoice_remind

发送付款提醒。增加提醒次数。支持自定义消息。

invoice_risk

AI 驱动的逾期付款风险预测 (0-100)。返回风险等级、因素分解、建议操作、下次提醒日期。

cashflow_report

生成现金流摘要:总开票金额、已收款、未收款、逾期款、收款率、30 天预测。

payment_reconcile

通过金额和付款人邮箱将收到的付款与发票匹配。自动标记为已支付。


资源

资源

描述

invoices://pending

所有未支付发票

invoices://overdue

已过期的发票

invoices://stats

月度现金流摘要

clients://list

所有带有付款历史的客户


风险预测引擎

使用 4 个加权因素对发票进行 0-100 分评分:

因素

权重

衡量内容

发票金额

20%

金额越高 = 风险越高

客户历史

35%

付款率、逾期付款、平均天数

到期日

30%

距离到期/逾期的天数

提醒次数

15%

已发送的提醒次数

风险等级: 低 (0-30), 中 (31-60), 高 (61-100)


配置

将 .env.example 复制到 .env 并设置您需要的变量:

cp .env.example .env

变量

必需

描述

SENDGRID_API_KEY

用于发送邮件

通过 SendGrid 发送发票和提醒

SendGrid 是可选的。InvoiceFlow 在发票创建、风险评分、现金流报告和核对方面完全支持离线工作。当您需要外发邮件投递时,请添加 SendGrid。

路线图:Stripe 和 PayPal 实时同步

payment_reconcile 工具目前将您提供的金额(来自 CSV、Webhook 或手动输入)与存储的发票进行匹配。计划在 v2.0 中实现带有 Webhook 监听器的 Stripe 和 PayPal API 直接集成——请查看 issues 了解进度。

使用示例

创建客户和发票

> Create a client "Acme Corp" with email billing@acme.com

✓ Client created: Acme Corp (id: 3f2a...)

> Create an invoice for Acme Corp: 10 hours consulting at $150/hr, 20% tax

✓ Invoice INV-2026-0001 created
  Subtotal: $1,500.00 | Tax: $300.00 | Total: $1,800.00

评估付款风险

> What's the risk score for invoice INV-2026-0001?

Risk Score: 42/100 (Medium)
  - Invoice Amount: 25 (moderate amount)
  - Client History: 50 (new client)
  - Due Date: 15 (due in 28 days)
  - Reminders: 10 (none sent)
Recommended: Send an early reminder with a polite tone.

生成现金流报告

> Show me the cash flow report

April 2026:
  Total Invoiced: $12,400.00
  Collected: $8,200.00 (66.1%)
  Outstanding: $4,200.00
  Overdue: $1,800.00
  Projected (30d): $2,400.00

支持的货币

USD, EUR, GBP, CAD, AUD, JPY, CHF, TRY, BRL, INR


定价

等级

价格

每月发票数

功能

免费

$0

5

基础 PDF 发票

专业版

$12/月

100

AI 风险评分、智能提醒、核对

商业版

$29/月

500

多币种、现金流报告、优先支持

可在 MCPize Marketplace 获取。


开发

npm run dev        # Hot reload
npm run build      # Production build
npm test           # Run tests
npm run inspect    # MCP Inspector

测试

测试涵盖了核心业务逻辑:

  • 存储 — CRUD 操作、筛选、顺序发票编号

  • 风险模型 — 具有 4 个加权因素的 AI 评分引擎、风险分类

  • 现金流 — 报告生成、收款率、预测、客户明细

npm test           # Run all tests
npx vitest --watch # Watch mode

专业版许可证

InvoiceFlow 以 免费模式 发布 — invoice_demo_seed、client_manage、invoice_create、invoice_list、invoice_mark_paid 和 invoice_remind 是开放的。以下工具需要 专业版许可证:

  • invoice_send — 生成 PDF + SendGrid 邮件投递

  • invoice_risk — 逾期付款风险预测

  • payment_reconcile — 将 Stripe/PayPal/银行付款与发票匹配

  • cashflow_report — 全组合现金流 + 30 天预测

购买专业版许可证(€12,终身,3 台机器): https://automatiabcn.lemonsqueezy.com/buy/2d439c05-f463-4137-8883-950e8ee1112d

或者获取 Indie MCP Stack Bundle(€69,包含所有 4 个服务器)。

export LEMONSQUEEZY_LICENSE_KEY=YOUR-KEY-HERE

或者在您的 MCP 客户端配置中:

{
  "mcpServers": {
    "invoiceflow-mcp": {
      "command": "npx",
      "args": ["-y", "invoiceflow-mcp-server"],
      "env": { "LEMONSQUEEZY_LICENSE_KEY": "YOUR-KEY-HERE" }
    }
  }
}

验证信息在本地缓存 24 小时——首次运行后完全支持离线使用。


许可证

MIT 许可证。详情请参阅 LICENSE。

由 Automatia BCN 构建。

Available Tools

10 tools
cashflow_reportCash Flow ReportA
Read-onlyIdempotent

Generate a portfolio-wide cash flow summary across all invoices. Returns {period, total_invoiced, total_collected, total_outstanding, total_overdue, collection_rate (percent), avg_days_to_payment (or null if no paid history), projected_income_30d (forecast based on due dates and historical pay rate), breakdown_by_status, breakdown_by_client}. Takes no input — always reports on the current full dataset. Ideal for dashboards and monthly close.

Inputs: no named parameters.

client_manageManage ClientA
Idempotent

Create or upsert a client record used by invoice_create. Accepts name, email, company, address, city, country, tax_id, phone, default_currency ("USD"|"EUR"|"GBP"|...) and notes. Returns the stored client object including the generated id (UUID), an empty payment_history (populated as invoices are paid), and timestamps. Safe to call repeatedly: if a client with the same email already exists, the existing record is returned unchanged.

Inputs: name (required), email (required), city, notes, +6 more.

invoice_createCreate InvoiceA
Idempotent

Create a new invoice for an existing client. Required: client_id (UUID) and line_items (non-empty array of {description, quantity, unit_price, tax_rate?, discount_percent?} — tax and discount are per-line). Optional: currency (defaults to the client's default_currency then USD), issue_date (YYYY-MM-DD or full ISO, defaults to today), due_date (same format, defaults to issue_date + 30 days), notes, and terms. Auto-calculates subtotal, discount_total, tax_total, and total; generates a sequential invoice_number in format INV-YYYY-NNNN; sets status="draft". Returns the full invoice object ready for invoice_send.

Inputs: client_id (required), line_items (required), notes, terms, +3 more.

invoice_demo_seedSeed Demo DataA

Populate the store with a realistic demo dataset: 8 clients across 5 archetypes (on-time, late-payer, high-value, new, chronic-late) and 25-45 invoices spanning the last 6 months (paid, sent, and overdue). Every invoice has line items, tax, payment history, and reminder metadata. Use this to evaluate InvoiceFlow via MCP Inspector without real Stripe, SendGrid, or PayPal credentials — invoice_list, cashflow_report, invoice_risk, and payment_reconcile all return meaningful results against the returned ids. Safe to call multiple times; each call appends a fresh batch with unique UUIDs. Returns counts plus sample_invoice_ids you can feed straight into invoice_risk or invoice_mark_paid.

Inputs: no named parameters.

invoice_listList InvoicesA
Read-onlyIdempotent

Search and filter invoices. Optional filters: status ("draft"|"sent"|"viewed"|"paid"|"overdue"|"cancelled"|"refunded"), client_id, min_amount, max_amount, date_from/date_to (ISO dates), overdue_only (boolean). Pagination via limit (default 50, max 200) and offset. Returns {total, invoices[]} where each invoice includes full line_items and payment state. Use this to build dashboards or drive invoice_remind/invoice_risk workflows.

Inputs: limit, offset, status, to_date, +5 more.

invoice_mark_paidMark Invoice PaidA

Record a full or partial payment against an invoice. Updates amount_paid and amount_due; sets status="paid" only when the outstanding balance reaches zero. As a side effect, a fully-paid invoice updates the client payment_history (total_revenue, paid_invoices, avg_days_to_payment, late_payment_count) which invoice_risk then uses for future predictions. Returns a confirmation with the paid amount and remaining balance.

Inputs: invoice_id (required), amount, payment_method.

invoice_remindRecord Payment ReminderA

Record that a payment reminder has been issued for an unpaid invoice. Increments reminder_count, sets last_reminder_at, and advances draft → sent. Returns the generated reminder message (custom or default) so the caller can relay it through their preferred channel — this tool itself does not send email; use invoice_send for actual delivery. Safely refuses to remind on already-paid invoices.

Inputs: invoice_id (required), message.

invoice_riskAssess Payment RiskA
Read-onlyIdempotent

Predict late-payment risk for a specific invoice on a 0-100 scale. The model combines invoice amount (relative to client average), client payment history (avg_days_to_payment, late_payment_count), days remaining until due date, and prior reminder_count. Returns {risk_score (0-100), risk_level ("low"|"medium"|"high"|"critical"), factors (array of {factor, impact, detail}), recommended_action (string), next_reminder_date (ISO string or null)}. Use for prioritizing collection effort on high-value invoices.

Inputs: invoice_id (required).

invoice_sendSend InvoiceA

Generate the invoice PDF and deliver it to the client. Always generates the PDF and marks the invoice status="sent". Email delivery via SendGrid is attempted automatically when the SENDGRID_API_KEY environment variable is set; without it the PDF is still generated and the status still advances so the caller can handle delivery out-of-band. Returns a confirmation message with the PDF size.

Inputs: invoice_id (required), message.

payment_reconcileReconcile PaymentA

Match an incoming external payment (e.g. Stripe webhook, PayPal IPN, bank transfer) to an open invoice. Matching rule: the payer_email must equal the invoice client_email (case-insensitive) AND the payment_amount must equal the invoice amount_due within one cent. On match the invoice is marked paid, amount_paid/amount_due are updated, and client payment_history is recomputed exactly like invoice_mark_paid. Returns a reconciliation message on match or a "no match" message otherwise (no error). If multiple invoices match, the first one is reconciled.

Inputs: payer_email (required), payment_amount (required), reference, payment_method.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a distinct purpose: portfolio summary, client management, invoice creation, demo seeding, invoice listing, payment recording, reminder tracking, risk prediction, PDF generation/delivery, and external payment reconciliation. No functional overlap exists.

    Naming Consistency3/5

    Most tools follow a noun_verb pattern (e.g., invoice_create, invoice_list), but invoice_risk and invoice_demo_seed deviate (noun_noun and noun_noun_verb), and cashflow_report could be interpreted as compound noun. Inconsistent imperative style.

    Tool Count5/5

    10 tools is well-scoped for an invoicing system, covering core workflows (client, invoice, payment, report, risk) without unnecessary bloat.

    Completeness3/5

    Missing client listing/deletion and invoice update/deletion; lacks refund handling. Demo seeding and risk tools add value, but CRUD gaps may cause agent failures in some workflows.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Turn Claude, Cursor, and your AI agents into an autonomous CFO. Manage invoicing, expenses, real-time bank reconciliation, cash flow, and tax compliance in plain language — backed by Frihet ERP.
      100
      505 npm
      13
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables MCP clients to search and inspect an invoice ledger, generate VAT summaries, run OCR on local documents, and use reusable prompts for chasing overdue invoices and reconciling entries.
      2
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and finance teams to extract structured fields from messy invoices and audit them before payment, applying seven evidence-backed risk rules that catch total/tax mismatches, duplicate invoices, missing fields, future dates, and round amounts, then returning a 0–100 score with a payment link. Exposes four MCP tools over stdio and Streamable HTTP (spec 2025-11-25) plus a web UI, backed by an optional AWS Bedrock or OpenAI-compatible extraction brain that degrades gracefully to a zero-dependency offline engine.
      MIT