Skip to main content
Glama
knportal

Invoice Parser MCP

by knportal

Invoice Parser MCP

請求書、領収書、財務書類を構造化されたJSONに解析します — AIエージェントから直接利用可能です。

License: MIT Version MCP

掲載先: Glama · Smithery · mcp.so

Model Context Protocol向けに構築され、Claude Visionを搭載しています。

機能

PDF請求書、スキャンされた領収書、画像ファイルから構造化データを抽出します。テンプレートやOCRの設定は不要です。Claude Visionがドキュメントを読み取り、クリーンなJSONを返します。


Related MCP server: kelnix-receipt-mcp-api

ツール

ツール

説明

価格

parse_invoice

請求書の完全解析(ベンダー、明細、合計、支払期限)

$0.05/回

parse_receipt

小売領収書の解析(加盟店、品目、税金、支払方法)

$0.05/回

extract_line_items

明細リストのみを抽出

$0.01/回

extract_totals

小計、税金、合計、支払期限のみを抽出

$0.01/回

validate_invoice

数値検証 — 明細の合計が一致するか確認

$0.01/回

export_to_csv

複数ファイルのバッチ解析 → 要約CSV(最大20件)

$0.10/回


ツールリファレンス

parse_invoice

請求書の完全解析。ベンダー請求書からすべての構造化フィールドを抽出します。

パラメータ

パラメータ

必須

説明

file_path

string

はい

請求書PDFまたは画像(PNG, JPG, WEBP)への絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。plenitudo.aiで取得してください。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。api_keyの代わりに使用。

*api_keyまたはpayment_proofのいずれかが必要です。

入力例

{
  "file_path": "/Users/me/documents/invoice_acme_jan2025.pdf",
  "api_key": "ip_free_abc123"
}

出力例

{
  "ok": true,
  "document_type": "invoice",
  "vendor": {
    "name": "Acme Corp",
    "address": "123 Industrial Way, Austin TX 78701",
    "email": "billing@acme.com",
    "phone": "512-555-0100",
    "tax_id": "12-3456789"
  },
  "bill_to": {
    "name": "Jane Smith",
    "address": "456 Oak Ave, Boston MA 02101",
    "email": "jane@example.com"
  },
  "invoice_number": "INV-2025-0142",
  "invoice_date": "2025-01-15",
  "due_date": "2025-02-15",
  "payment_terms": "Net 30",
  "currency": "USD",
  "line_items": [
    {
      "description": "Software consulting — January",
      "quantity": 40,
      "unit_price": 175.0,
      "total": 7000.0,
      "tax_rate": 0.0
    }
  ],
  "subtotal": 7000.0,
  "discount": 0.0,
  "tax_amount": 560.0,
  "shipping": 0.0,
  "total": 7560.0,
  "amount_due": 7560.0,
  "notes": "Wire transfer preferred. See banking details on page 2.",
  "po_number": "PO-98765"
}

parse_receipt

小売または経費の領収書を解析します。POSレシート、レストランの請求書、経費精算書類向けに設計されています。

パラメータ

パラメータ

必須

説明

file_path

string

はい

領収書PDFまたは画像(PNG, JPG, WEBP)への絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。

入力例

{
  "file_path": "/Users/me/receipts/coffee_shop_march1.jpg",
  "api_key": "ip_free_abc123"
}

出力例

{
  "ok": true,
  "document_type": "receipt",
  "merchant": {
    "name": "Blue Bottle Coffee",
    "address": "300 Webster St, Oakland CA 94609",
    "phone": "510-555-0200",
    "website": "bluebottlecoffee.com"
  },
  "date": "2025-03-01",
  "time": "09:14",
  "receipt_number": "5541",
  "cashier": "Maria",
  "items": [
    { "name": "Latte (large)", "quantity": 1, "unit_price": 6.50, "total": 6.50, "sku": "", "category": "beverage" },
    { "name": "Croissant", "quantity": 1, "unit_price": 4.00, "total": 4.00, "sku": "", "category": "pastry" }
  ],
  "subtotal": 10.50,
  "discounts": 0.0,
  "tax": 0.84,
  "tip": 2.00,
  "total": 13.34,
  "currency": "USD",
  "payment_method": "Visa",
  "card_last_four": "4242",
  "transaction_id": "TXN-88821",
  "loyalty_points": null,
  "notes": ""
}

extract_line_items

明細リストのみを返す軽量な抽出機能です。明細のみが必要な場合、parse_invoiceよりも高速かつ安価です。

パラメータ

パラメータ

必須

説明

file_path

string

はい

請求書または領収書のPDFまたは画像への絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。

出力例

{
  "ok": true,
  "line_items": [
    { "description": "Widget A (x10)", "quantity": 10, "unit_price": 12.00, "total": 120.00 },
    { "description": "Widget B (x5)",  "quantity": 5,  "unit_price": 24.00, "total": 120.00 }
  ],
  "item_count": 2
}

extract_totals

明細やベンダー詳細を解析せず、財務サマリー(小計、税金、合計、支払期限)のみを抽出します。

パラメータ

パラメータ

必須

説明

file_path

string

はい

請求書または領収書のPDFまたは画像への絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。

出力例

{
  "ok": true,
  "currency": "USD",
  "subtotal": 240.00,
  "discount": 0.0,
  "tax_amount": 19.20,
  "tax_rate": 8.0,
  "shipping": 0.0,
  "tip": 0.0,
  "total": 259.20,
  "amount_due": 259.20,
  "invoice_date": "2025-01-15",
  "due_date": "2025-02-15"
}

validate_invoice

数値検証ツール。明細の合計が数量 × 単価と一致するか、小計が明細の合計と一致するか、税計算が整合しているか、最終合計が一致するかを確認します。±$0.02の端数誤差を許容します。

パラメータ

パラメータ

必須

説明

file_path

string

はい

請求書PDFまたは画像への絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。

出力例 — 有効な請求書

{
  "ok": true,
  "valid": true,
  "issues": [],
  "summary": {
    "line_items_checked": 3,
    "subtotal": 450.00,
    "tax": 36.00,
    "total": 486.00,
    "currency": "USD"
  }
}

出力例 — 無効な請求書

{
  "ok": true,
  "valid": false,
  "issues": [
    {
      "field": "line_item_2_total",
      "expected": 120.00,
      "found": 100.00,
      "description": "quantity (10) × unit_price (12.00) = 120.00, but stated total is 100.00"
    }
  ],
  "summary": {
    "line_items_checked": 3,
    "subtotal": 340.00,
    "tax": 27.20,
    "total": 367.20,
    "currency": "USD"
  }
}

export_to_csv

最大20件の請求書または領収書をバッチ解析し、要約CSVをエクスポートします。各行には、ファイル名、ドキュメントタイプ、ベンダー/加盟店、日付、番号、小計、税金、合計、通貨、支払期限、支払方法が含まれます。

パラメータ

パラメータ

必須

説明

file_paths

文字列の配列

はい

請求書/領収書のPDFまたは画像への絶対パスのリスト。最大20件。

output_path

string

はい

出力CSVファイルを保存する絶対パス。

api_key

string

いいえ*

InvoiceParser APIキー。

payment_proof

string

いいえ*

x402支払証明(Base USDCトランザクションハッシュ)。

入力例

{
  "file_paths": [
    "/Users/me/invoices/jan2025.pdf",
    "/Users/me/invoices/feb2025.pdf",
    "/Users/me/receipts/expense_march.jpg"
  ],
  "output_path": "/Users/me/exports/q1_summary.csv",
  "api_key": "ip_free_abc123"
}

出力例 (JSONレスポンス)

{
  "ok": true,
  "output_path": "/Users/me/exports/q1_summary.csv",
  "rows_written": 3,
  "errors": []
}

CSV列: filename, document_type, vendor_merchant, date, number, subtotal, tax, total, currency, due_date, payment_method


対応フォーマット

  • PDF(請求書、スキャンされた書類)

  • PNG, JPG, WEBP(領収書の写真、スクリーンショット)


認証

無料枠: APIキーを使用して月20回まで解析可能(plenitudo.aiで取得)

従量課金 (x402): アカウント不要。Base上のUSDCをウォレットアドレスに送信し、トランザクションハッシュをpayment_proofとして渡してください。

{
  "error": "Payment required",
  "x402": {
    "network": "base",
    "token": "USDC",
    "recipient": "0x9053FeDC90c1BCB4a8Cf708DdB426aB02430d6ad",
    "amount_usdc": 0.05
  }
}

使用方法 (Claude Desktop / MCPクライアント)

{
  "mcpServers": {
    "invoice-parser": {
      "url": "https://invoice-parser.plenitudo.ai/mcp?ref=readme"
    }
  }
}

アーキテクチャ

server.py          — MCP server (6 tools: parse_invoice, parse_receipt,
                     extract_line_items, extract_totals, validate_invoice,
                     export_to_csv)
auth.py            — API key validation + usage tracking (SQLite)
x402.py            — x402 micropayment verification (USDC on Base)
config.py          — Environment variable loading
worker.js          — Cloudflare Worker (remote proxy for MCP traffic)
data/keys.db       — API key store (created at runtime)
data/usage.db      — Monthly usage counters (created at runtime)
logs/              — Structured log files
tests/             — Unit tests (mock Vision API, no real documents needed)

リクエストフロー

AI agent (Claude Desktop, Cursor, etc.)
    │
    │  MCP tool call (JSON-RPC over HTTP)
    ▼
Cloudflare Worker (worker.js)        ← optional remote proxy
    │
    │  Forwards to Railway deployment
    ▼
server.py (FastMCP, streamable HTTP)
    │
    ├── auth.py              validates API key / x402 proof
    ├── x402.py              verifies USDC transaction on Base
    └── Anthropic API        Claude Vision reads the document
            │
            ▼
        structured JSON → returned to agent

環境変数

変数

必須

説明

ANTHROPIC_API_KEY

はい

Claude Vision用のAnthropic APIキー。ローカルプロキシルーティングの場合はmaxproxyに設定。

ANTHROPIC_BASE_URL

いいえ

AnthropicベースURLのオーバーライド。ローカルでmaxproxyを使用する場合はhttp://localhost:3456に設定。クラウドデプロイ時は未設定のままにしてください。

CLAUDE_MODEL

いいえ

ClaudeモデルID。デフォルトはclaude-3-5-sonnet-20241022

INVOICEPARSER_DATA_DIR

いいえ

SQLiteデータベース用ディレクトリ。デフォルトは./data

PORT

いいえ

HTTPポート。デフォルトは8000。Railwayはこれを自動的に設定します。


デプロイ (Railway)

  1. このリポジトリをフォーク

  2. Railwayに接続 → New Project → GitHubからデプロイ

  3. 環境変数を追加:

    • ANTHROPIC_API_KEY — Anthropic APIキー

    • INVOICEPARSER_DATA_DIR/data

    • STRIPE_WEBHOOK_SECRET — Stripeダッシュボードから取得

    • STRIPE_PRO_PRICE_ID — Stripeダッシュボードから取得

  4. /dataに永続ボリュームを追加

  5. デプロイ


ローカル実行 (オプションのmaxproxyルーティング)

ポート3456でmaxproxyインスタンスを実行しているマシン上でサーバーを起動する場合、Anthropic APIを直接叩く代わりに、そこを経由してClaude Vision呼び出しをルーティングできます:

ANTHROPIC_API_KEY=maxproxy
ANTHROPIC_BASE_URL=http://localhost:3456

クラウド/Railwayデプロイ環境では、ANTHROPIC_BASE_URLは未設定(または空)のままにしてください。これらの環境からはローカルプロキシに到達できません。


貢献とセキュリティ

ライセンス

MIT — Copyright © 2025 Kenneth Nygren / Plenitudo AI

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Appeared in Searches

Latest Blog Posts

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/knportal/invoice-parser-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server