Yggdrasil
MCP ServersMCP 伺服器 SKILLs技能 PlugIns解決方案 Asgard AI SolutionAsgard AI 方案 Submit Listing申請上架 GitHub
e

ezPay E-Invoice ezPay 電子發票

Released已發布
payment taiwan

MCP Server for Taiwan's ezPay E-Invoice API — 7 AI-callable tools for invoice issuance (B2B/B2C), voiding, allowances, and querying via Model Context Protocol.

ezPay 電子發票 MCP Server — 7 個 AI 可呼叫工具,涵蓋開立發票(B2B/B2C)、作廢、折讓與查詢。

Status狀態
released
Tools工具數
7
Category分類
payment
Region地區
taiwan
Maintainer維護者
GitHub

Features功能特色

  • issue_invoice -- Issue B2B (business) or B2C (individual) e-invoices with full item detail, tax types, carriers, and donation codes
  • trigger_invoice -- Trigger deferred or scheduled invoices for immediate issuance
  • void_invoice -- Void issued invoices within the allowed reporting period
  • issue_allowance -- Issue allowances (credit notes / partial refunds) against existing invoices
  • trigger_allowance -- Confirm or cancel pending allowances
  • void_allowance -- Void confirmed allowances
  • query_invoice -- Query invoice details by invoice number or order number
  • AES-256-CBC encryption -- Implements the ezPay encrypted form POST protocol (URL-encode, PKCS7 pad, AES encrypt, hex encode)
  • CheckCode verification -- SHA-256 based response validation
  • Dual environment -- Supports both test (cinv.ezpay.com.tw) and production (inv.ezpay.com.tw) environments
  • issue_invoice -- 開立 B2B(營業人)或 B2C(個人)電子發票,支援多品項、稅別、載具及捐贈碼
  • trigger_invoice -- 觸發延遲開立或預約開立的發票
  • void_invoice -- 於允許期間內作廢已開立的發票
  • issue_allowance -- 針對既有發票開立折讓(部分退款)
  • trigger_allowance -- 確認或取消待處理的折讓
  • void_allowance -- 作廢已確認的折讓
  • query_invoice -- 依發票號碼或訂單編號查詢發票明細
  • AES-256-CBC 加密 -- 實作 ezPay 加密表單 POST 協定(URL 編碼、PKCS7 填充、AES 加密、十六進位編碼)
  • CheckCode 驗證 -- SHA-256 回應驗證機制
  • 雙環境支援 -- 支援測試環境(cinv.ezpay.com.tw)及正式環境(inv.ezpay.com.tw

Available Tools可用工具

Tool Description Key Parameters
issue_invoice Issue B2B/B2C e-invoice category, buyer_name, tax_type, amt, total_amt, item_name, item_count, item_price, print_flag
trigger_invoice Trigger deferred/scheduled invoice invoice_trans_no, merchant_order_no, total_amt
void_invoice Void an issued invoice invoice_number, invalid_reason
issue_allowance Issue allowance (credit note) invoice_no, item_name, item_count, item_price, total_amt
trigger_allowance Confirm or cancel pending allowance allowance_no, allowance_status (C=confirm, D=cancel)
void_allowance Void confirmed allowance allowance_no, invalid_reason
query_invoice Query invoice details search_type (0=by invoice number, 1=by order number)
工具 說明 主要參數
issue_invoice 開立 B2B/B2C 電子發票 category, buyer_name, tax_type, amt, total_amt, item_name, item_count, item_price, print_flag
trigger_invoice 觸發延遲/預約發票 invoice_trans_no, merchant_order_no, total_amt
void_invoice 作廢已開立發票 invoice_number, invalid_reason
issue_allowance 開立折讓 invoice_no, item_name, item_count, item_price, total_amt
trigger_allowance 確認或取消待處理折讓 allowance_no, allowance_statusC=確認, D=取消)
void_allowance 作廢已確認折讓 allowance_no, invalid_reason
query_invoice 查詢發票明細 search_type0=依發票號碼, 1=依訂單編號)

Contributing貢獻

See CONTRIBUTING.md for setup instructions and guidelines.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Make changes and run tests
  4. Submit a pull request

詳見 CONTRIBUTING.md 的設定說明與開發指南。

  1. Fork 此專案
  2. 建立功能分支:git checkout -b feat/your-feature
  3. 修改並執行測試
  4. 提交 Pull Request

License授權

MIT License -- see LICENSE for details.

MIT License -- 詳見 LICENSE

OverviewOverview

An MCP (Model Context Protocol) server that exposes 7 AI-callable tools for the full Taiwan e-invoice lifecycle through the ezPay platform. Covers invoice issuance (B2B/B2C), triggering, voiding, allowances (credit notes/refunds), and querying -- all accessible to AI assistants like Claude via the standard MCP protocol.

Part of the Asgard AI Platform open-source ecosystem.

透過 ezPay 平台,提供完整台灣電子發票生命週期的 MCP (Model Context Protocol) 伺服器。內建 7 個 AI 可呼叫工具,涵蓋發票開立(B2B/B2C)、觸發開立、作廢、折讓(退款)、以及查詢功能,可透過標準 MCP 協定供 Claude 等 AI 助理使用。

Asgard AI Platform 開源生態系的一部分。

PrerequisitesPrerequisites

InstallInstall

Option 1: Install from PyPI

pip install mcp-ezpay-einvoice

Or with uv:

uv pip install mcp-ezpay-einvoice

Option 2: Run directly with uvx (no install needed)

EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  uvx mcp-ezpay-einvoice

Option 3: Install from source

git clone https://github.com/asgard-ai-platform/mcp-ezpay-einvoice.git
cd mcp-ezpay-einvoice
uv venv && source .venv/bin/activate
uv pip install -e .

方法一:從 PyPI 安裝

pip install mcp-ezpay-einvoice

或使用 uv

uv pip install mcp-ezpay-einvoice

方法二:使用 uvx 直接執行(免安裝)

EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  uvx mcp-ezpay-einvoice

方法三:從原始碼安裝

git clone https://github.com/asgard-ai-platform/mcp-ezpay-einvoice.git
cd mcp-ezpay-einvoice
uv venv && source .venv/bin/activate
uv pip install -e .

ConfigurationConfiguration

Set the following environment variables before running the server:

Environment Variable Required Description
EZPAY_MERCHANT_ID Yes Your ezPay merchant ID
EZPAY_HASH_KEY Yes AES-256 encryption key (32 chars)
EZPAY_HASH_IV Yes AES-CBC initialization vector (16 chars)
EZPAY_IS_PRODUCTION No Set to true for production. Defaults to false (test environment)

You can also copy the .env.example file to .env and fill in your values:

cp .env.example .env

啟動伺服器前,請設定以下環境變數:

環境變數 必填 說明
EZPAY_MERCHANT_ID ezPay 商店代號
EZPAY_HASH_KEY AES-256 加密金鑰(32 字元)
EZPAY_HASH_IV AES-CBC 初始向量(16 字元)
EZPAY_IS_PRODUCTION 設為 true 使用正式環境,預設為 false(測試環境)

也可以複製 .env.example.env 並填入憑證:

cp .env.example .env

UsageUsage

Claude Desktop

Add the following to your claude_desktop_config.json:

Using uvx (recommended -- no manual install needed):

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "uvx",
      "args": ["mcp-ezpay-einvoice"],
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

Using pip install:

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "mcp-ezpay-einvoice",
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

Claude Code

If you cloned the repo, the .mcp.json in the project root is auto-discovered by Claude Code. Just set the environment variables:

export EZPAY_MERCHANT_ID=your_merchant_id
export EZPAY_HASH_KEY=your_hash_key
export EZPAY_HASH_IV=your_hash_iv

Or add the server via CLI:

claude mcp add ezpay-einvoice -- uvx mcp-ezpay-einvoice

Cursor / Windsurf

Add to your MCP settings (.cursor/mcp.json or equivalent):

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "uvx",
      "args": ["mcp-ezpay-einvoice"],
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

Running Directly

# With environment variables
EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  python mcp_server.py

# Or with uvx
EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  uvx mcp-ezpay-einvoice

Testing

# Validate credentials and connectivity
python scripts/auth/test_connection.py

# Run all 7 tool E2E tests
python tests/test_all_tools.py

Claude Desktop

將以下設定加入 claude_desktop_config.json

使用 uvx(推薦 -- 免手動安裝):

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "uvx",
      "args": ["mcp-ezpay-einvoice"],
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

使用 pip 安裝後:

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "mcp-ezpay-einvoice",
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

Claude Code

若已 clone 專案,Claude Code 會自動偵測專案根目錄的 .mcp.json,只需設定環境變數:

export EZPAY_MERCHANT_ID=your_merchant_id
export EZPAY_HASH_KEY=your_hash_key
export EZPAY_HASH_IV=your_hash_iv

或透過 CLI 新增伺服器:

claude mcp add ezpay-einvoice -- uvx mcp-ezpay-einvoice

Cursor / Windsurf

將以下設定加入 MCP 設定檔(.cursor/mcp.json 或對應路徑):

{
  "mcpServers": {
    "ezpay-einvoice": {
      "command": "uvx",
      "args": ["mcp-ezpay-einvoice"],
      "env": {
        "EZPAY_MERCHANT_ID": "your_merchant_id",
        "EZPAY_HASH_KEY": "your_hash_key",
        "EZPAY_HASH_IV": "your_hash_iv",
        "EZPAY_IS_PRODUCTION": "false"
      }
    }
  }
}

直接執行

# 使用環境變數
EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  python mcp_server.py

# 或使用 uvx
EZPAY_MERCHANT_ID=your_id EZPAY_HASH_KEY=your_key EZPAY_HASH_IV=your_iv \
  uvx mcp-ezpay-einvoice

測試

# 驗證憑證與連線
python scripts/auth/test_connection.py

# 執行全部 7 個工具的端對端測試
python tests/test_all_tools.py

Usage ExamplesUsage Examples

Once the MCP server is running, an AI assistant (e.g. Claude) can call these tools on your behalf. Here are real-world scenarios showing what you say and how the AI responds.


"Help me issue an invoice for a customer who bought a test product"

You: 幫我開一張發票,客人買了一個測試商品 105 元含稅,要印紙本發票

AI calls:

issue_invoice(
  merchant_order_no = "ORDER20260404001",
  buyer_name        = "Test Buyer",
  category          = "B2C",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 100,
  tax_amt           = 5,
  total_amt         = 105,
  item_name         = "Test Product",
  item_count        = "1",
  item_unit         = "pc",
  item_price        = "105",
  item_amt          = "105",
  print_flag        = "Y",
  status            = "1",
)

Result: SUCCESS -- Invoice TE00000000 issued, amount NT$105, random code 9393. The response includes BarCode, QRcodeL, and QRcodeR for printing.


"Issue a B2B invoice with the buyer's tax ID"

You: 幫我開一張 B2B 發票給統編 54352706 的公司,品名是顧問服務費 10000 元加稅 500 元

AI calls:

issue_invoice(
  merchant_order_no = "B2B20260404001",
  buyer_name        = "範例科技股份有限公司",
  buyer_ubn         = "54352706",
  category          = "B2B",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 10000,
  tax_amt           = 500,
  total_amt         = 10500,
  item_name         = "顧問服務費",
  item_count        = "1",
  item_unit         = "式",
  item_price        = "10000",
  item_amt          = "10000",
  print_flag        = "Y",
  status            = "1",
)

Result: SUCCESS -- B2B invoice issued with buyer UBN 54352706. The printed invoice includes BarCode and QR codes for tax reporting.


"Issue a B2C invoice with phone barcode carrier"

You: 客人要存手機條碼載具 /ABC1234,不印紙本,品項是拿鐵咖啡 2 杯 65 元、巧克力蛋糕 1 個 85 元

AI calls:

issue_invoice(
  merchant_order_no = "POS20260404001",
  buyer_name        = "顧客",
  category          = "B2C",
  carrier_type      = "0",
  carrier_num       = "/ABC1234",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 205,
  tax_amt           = 10,
  total_amt         = 215,
  item_name         = "拿鐵咖啡|巧克力蛋糕",
  item_count        = "2|1",
  item_unit         = "杯|個",
  item_price        = "65|85",
  item_amt          = "130|85",
  print_flag        = "N",
  status            = "1",
)

Result: SUCCESS -- Invoice stored to phone barcode carrier /ABC1234, no paper copy printed.


"Query the invoice I just issued"

You: 幫我查一下訂單 ORDER20260404001 的發票資料

AI calls:

query_invoice(
  search_type       = "1",
  merchant_order_no = "ORDER20260404001",
  total_amt         = 105,
)

Result: SUCCESS -- Returns full invoice details including invoice number TE00000000, buyer info, tax breakdown (Amt: 100, TaxAmt: 5, TotalAmt: 105), item details, invoice status (1=issued), upload status, BarCode, and QR codes.


"I need to issue a refund for a returned item"

You: 客人退了一杯拿鐵 65 元,幫我對發票 TE00000000 開折讓

AI calls:

issue_allowance(
  invoice_no        = "TE00000000",
  merchant_order_no = "ORDER20260404001",
  item_name         = "拿鐵咖啡",
  item_count        = "1",
  item_unit         = "杯",
  item_price        = "65",
  item_amt          = "65",
  item_tax_amt      = "3",
  total_amt         = 68,
  status            = "1",
)

Result: SUCCESS -- Allowance issued against invoice TE00000000 for NT$68 (65 + 3 tax). The remaining invoice amount is updated accordingly.


"Void that invoice -- it was issued by mistake"

You: 發票 TE00000000 開錯了,幫我作廢,原因是誤開發票

AI calls:

void_invoice(
  invoice_number = "TE00000000",
  invalid_reason = "誤開發票",
)

Result: SUCCESS -- Invoice TE00000000 voided. The platform will notify the buyer and upload the void record to the tax authority.

Note: Invoices can only be voided before the 14th of the next odd month (e.g., invoices issued in March-April can be voided before May 14th).


"Create a scheduled invoice for next week"

You: 幫我建一張預約發票,預計 2026-04-10 開立,金額 1000 元含稅

AI calls:

issue_invoice(
  merchant_order_no  = "SCH20260404001",
  buyer_name         = "預約客戶",
  category           = "B2C",
  tax_type           = "1",
  tax_rate           = 5,
  amt                = 952,
  tax_amt            = 48,
  total_amt          = 1000,
  item_name          = "訂閱服務",
  item_count         = "1",
  item_unit          = "式",
  item_price         = "1000",
  item_amt           = "1000",
  print_flag         = "Y",
  status             = "3",
  create_status_time = "2026-04-10",
)

Result: SUCCESS -- Invoice data saved, scheduled to issue on 2026-04-10. If you need to issue it earlier, use trigger_invoice to trigger it immediately.


"Trigger that scheduled invoice now"

You: 預約發票 SCH20260404001 要提前開立,幫我觸發

AI calls:

trigger_invoice(
  invoice_trans_no  = "26040423034604894",
  merchant_order_no = "SCH20260404001",
  total_amt         = 1000,
)

Result: SUCCESS -- Scheduled invoice triggered and issued immediately. Invoice number and random code are returned.

啟動 MCP 伺服器後,AI 助理(如 Claude)即可代為呼叫這些工具。以下是實際對話情境與回應結果。


「幫我開一張發票,客人買了一個測試商品」

你: 幫我開一張發票,客人買了一個測試商品 105 元含稅,要印紙本發票

AI 呼叫:

issue_invoice(
  merchant_order_no = "ORDER20260404001",
  buyer_name        = "Test Buyer",
  category          = "B2C",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 100,
  tax_amt           = 5,
  total_amt         = 105,
  item_name         = "Test Product",
  item_count        = "1",
  item_unit         = "pc",
  item_price        = "105",
  item_amt          = "105",
  print_flag        = "Y",
  status            = "1",
)

結果: SUCCESS -- 發票 TE00000000 開立成功,金額 NT$105,隨機碼 9393。回應包含 BarCode、QRcodeL 及 QRcodeR 供列印使用。


「幫我開一張 B2B 發票給這家公司」

你: 幫我開一張 B2B 發票給統編 54352706 的公司,品名是顧問服務費 10000 元加稅 500 元

AI 呼叫:

issue_invoice(
  merchant_order_no = "B2B20260404001",
  buyer_name        = "範例科技股份有限公司",
  buyer_ubn         = "54352706",
  category          = "B2B",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 10000,
  tax_amt           = 500,
  total_amt         = 10500,
  item_name         = "顧問服務費",
  item_count        = "1",
  item_unit         = "式",
  item_price        = "10000",
  item_amt          = "10000",
  print_flag        = "Y",
  status            = "1",
)

結果: SUCCESS -- B2B 發票開立成功,買方統編 54352706。紙本發票包含條碼及 QR Code 供報稅使用。


「客人要存手機條碼載具,不印紙本」

你: 客人要存手機條碼載具 /ABC1234,不印紙本,品項是拿鐵咖啡 2 杯 65 元、巧克力蛋糕 1 個 85 元

AI 呼叫:

issue_invoice(
  merchant_order_no = "POS20260404001",
  buyer_name        = "顧客",
  category          = "B2C",
  carrier_type      = "0",
  carrier_num       = "/ABC1234",
  tax_type          = "1",
  tax_rate          = 5,
  amt               = 205,
  tax_amt           = 10,
  total_amt         = 215,
  item_name         = "拿鐵咖啡|巧克力蛋糕",
  item_count        = "2|1",
  item_unit         = "杯|個",
  item_price        = "65|85",
  item_amt          = "130|85",
  print_flag        = "N",
  status            = "1",
)

結果: SUCCESS -- 發票已存入手機條碼載具 /ABC1234,不列印紙本。


「幫我查一下剛剛那張發票的資料」

你: 幫我查一下訂單 ORDER20260404001 的發票資料

AI 呼叫:

query_invoice(
  search_type       = "1",
  merchant_order_no = "ORDER20260404001",
  total_amt         = 105,
)

結果: SUCCESS -- 回傳完整發票資料,包含發票號碼 TE00000000、買受人資訊、稅額明細(Amt: 100、TaxAmt: 5、TotalAmt: 105)、商品明細、發票狀態(1=已開立)、上傳狀態、BarCode 及 QR Code。


「客人退了一杯拿鐵,幫我開折讓」

你: 客人退了一杯拿鐵 65 元,幫我對發票 TE00000000 開折讓

AI 呼叫:

issue_allowance(
  invoice_no        = "TE00000000",
  merchant_order_no = "ORDER20260404001",
  item_name         = "拿鐵咖啡",
  item_count        = "1",
  item_unit         = "杯",
  item_price        = "65",
  item_amt          = "65",
  item_tax_amt      = "3",
  total_amt         = 68,
  status            = "1",
)

結果: SUCCESS -- 對發票 TE00000000 開立折讓 NT$68(65 + 稅 3 元),發票剩餘金額同步更新。


「那張發票開錯了,幫我作廢」

你: 發票 TE00000000 開錯了,幫我作廢,原因是誤開發票

AI 呼叫:

void_invoice(
  invoice_number = "TE00000000",
  invalid_reason = "誤開發票",
)

結果: SUCCESS -- 發票 TE00000000 已作廢。平台會通知買受人並將作廢紀錄上傳至財政部電子發票平台。

注意: 發票只能在下一個奇數月的 14 日之前作廢(例如:3-4 月開立的發票需在 5 月 14 日前作廢)。


「幫我建一張預約發票,下週再開」

你: 幫我建一張預約發票,預計 2026-04-10 開立,金額 1000 元含稅

AI 呼叫:

issue_invoice(
  merchant_order_no  = "SCH20260404001",
  buyer_name         = "預約客戶",
  category           = "B2C",
  tax_type           = "1",
  tax_rate           = 5,
  amt                = 952,
  tax_amt            = 48,
  total_amt          = 1000,
  item_name          = "訂閱服務",
  item_count         = "1",
  item_unit          = "式",
  item_price         = "1000",
  item_amt           = "1000",
  print_flag         = "Y",
  status             = "3",
  create_status_time = "2026-04-10",
)

結果: SUCCESS -- 發票資料已儲存,預計於 2026-04-10 自動開立。如需提前開立,可使用 trigger_invoice 觸發立即開立。


「預約發票要提前開,幫我觸發」

你: 預約發票 SCH20260404001 要提前開立,幫我觸發

AI 呼叫:

trigger_invoice(
  invoice_trans_no  = "26040423034604894",
  merchant_order_no = "SCH20260404001",
  total_amt         = 1000,
)

結果: SUCCESS -- 預約發票已觸發立即開立,回傳發票號碼及隨機碼。

Error Codes ReferenceError Codes Reference

Common ezPay API response status codes:

Status Meaning
SUCCESS Operation completed successfully
LIB10001 Merchant ID does not exist
LIB10002 Encryption verification failed
LIB10003 Timestamp has expired
INV10001 Duplicate merchant order number
INV10003 Invoice number does not exist
INV20001 Invoice has already been voided
INV20002 Invoice void period has passed
ALW10001 Allowance amount exceeds invoice amount
ALW10002 Allowance number does not exist

For the complete error code list, refer to the ezPay API documentation.

常見 ezPay API 回應狀態碼:

狀態碼 說明
SUCCESS 操作成功
LIB10001 商店代號不存在
LIB10002 加密驗證失敗
LIB10003 時間戳記已過期
INV10001 商店自訂編號重複
INV10003 發票號碼不存在
INV20001 發票已作廢
INV20002 發票作廢期限已過
ALW10001 折讓金額超過發票金額
ALW10002 折讓號碼不存在

完整錯誤代碼請參閱 ezPay API 文件

ArchitectureArchitecture

stdio (JSON-RPC 2.0)
  -> mcp_server.py           Entry point, side-effect import triggers tool registration
    -> app.py                FastMCP("mcp-ezpay-einvoice") singleton
      -> tools/invoice_tools.py    7 @mcp.tool() decorated functions
        -> connectors/ezpay_client.py   Encrypted form POST connector
          -> auth/ezpay_crypto.py       AES-256-CBC encrypt + CheckCode verify
            -> config/settings.py       Endpoints, URL builder, env var config
mcp-ezpay-einvoice/
|-- app.py                          # FastMCP server singleton
|-- mcp_server.py                   # Entry point (stdio transport)
|-- config/settings.py              # API endpoints, URL builder, credentials
|-- connectors/ezpay_client.py      # Encrypted form POST connector
|-- auth/ezpay_crypto.py            # AES-256-CBC encryption, CheckCode
|-- tools/invoice_tools.py          # 7 MCP tools (invoice + allowance lifecycle)
|-- tests/test_all_tools.py         # E2E test runner
|-- scripts/auth/test_connection.py # Connection and credential validator
|-- .mcp.json                       # Claude Code auto-discovery config
`-- .env.example                    # Environment variable template
stdio (JSON-RPC 2.0)
  -> mcp_server.py           入口,透過 side-effect import 觸發工具註冊
    -> app.py                FastMCP("mcp-ezpay-einvoice") 單例
      -> tools/invoice_tools.py    7 個 @mcp.tool() 裝飾器函式
        -> connectors/ezpay_client.py   加密表單 POST 連接器
          -> auth/ezpay_crypto.py       AES-256-CBC 加密 + CheckCode 驗證
            -> config/settings.py       端點、URL 建構、環境變數設定
mcp-ezpay-einvoice/
|-- app.py                          # FastMCP 伺服器單例
|-- mcp_server.py                   # 入口(stdio 傳輸)
|-- config/settings.py              # API 端點、URL 建構、憑證
|-- connectors/ezpay_client.py      # 加密表單 POST 連接器
|-- auth/ezpay_crypto.py            # AES-256-CBC 加密、CheckCode
|-- tools/invoice_tools.py          # 7 個 MCP 工具(發票 + 折讓生命週期)
|-- tests/test_all_tools.py         # 端對端測試
|-- scripts/auth/test_connection.py # 連線與憑證驗證
|-- .mcp.json                       # Claude Code 自動偵測設定
`-- .env.example                    # 環境變數範本

Part Of The Asgard EcosystemPart Of The Asgard Ecosystem

This server is part of the Asgard AI Platform, connecting AI assistants to real-world services across e-commerce, finance, government data, and more. See the full Asgard AI Platform.

本伺服器為 Asgard AI Platform 的一部分,將 AI 助理連接至電商、金融、政府開放資料等真實世界服務。查看完整 Asgard AI Platform

Tags標籤

invoicee-invoicetaiwan

Need more powerful payment capabilities? 需要更強大的payment能力?

Upgrade to Asgard for enterprise-grade features, SLAs, and dedicated support.

升級至 Asgard 取得企業級功能、SLA 與專屬支援。

View Asgard Products →查看 Asgard 產品 →

Related MCP Servers相關 MCP 伺服器