Mcp

io.github.invoicepdfsv0.1.1更新於 Oct 9, 2026

Render invoices and credit notes as PDFs, and check them against EN 16931 e-invoicing rules.

概覽

AI 產生的概覽

讓助理透過 InvoicePDFs API 將發票與貸項通知單渲染成 PDF,並依 EN 16931 電子發票規則檢查。

功能
把 InvoicePDFs API 包裝成約三十個工具,包括 document_render、document_create、compliance_check、customer_list,以及處理文件生命週期的 document_transition。兩個通用工具 find_operation 與 call_operation 可搜尋並執行該 API 的 161 個操作,因此整個 API 都能存取。渲染為非同步,會等待最終結果而非只回傳排隊狀態。
適用情境
適合需要讓助理產生發票或貸項通知單 PDF、依 EN 16931 電子發票規則驗證文件,或在聊天用戶端中管理 InvoicePDFs 客戶與文件的場合。適用於已有 InvoicePDFs 帳號,並想在 Claude Desktop、Cursor 等 stdio MCP 用戶端中使用這套流程的使用者。
執行需求
以 stdio 方式在本機執行,通常透過 npx @invoicepdfs/mcp 啟動,因此需要 Node.js 以及連線至 InvoicePDFs API 的網路。需要在 INVOICEPDFS_API_KEY 環境變數中提供 InvoicePDFs API 金鑰;INVOICEPDFS_BASE_URL 可覆寫 API 主機,例如指向本機伺服器。僅支援桌面端。
安裝前請注意
此 API 金鑰沒有範圍限制:它能執行帳號可做的任何操作,包括刪除資料,且沒有更精細的憑證可用。此伺服器可建立、修改與刪除文件及客戶,call_operation 還能呼叫任意 API 操作。請勿將金鑰寫入共用設定檔,一旦外洩應立即撤銷。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

InvoicePDFs MCP server

Gives an AI agent the InvoicePDFs API as tools: render a document, check it for e-invoicing compliance, manage customers, and reach the rest of the API on demand.

It is an ordinary HTTPS client of the public API. No database, no extra service to deploy, nothing added to render.yaml. It runs on your machine.

Use it

Add to your MCP client's configuration — Claude Desktop, Cursor, or anything else that speaks MCP over stdio:

json
{  "mcpServers": {    "invoicepdfs": {      "command": "npx",      "args": ["-y", "@invoicepdfs/mcp"],      "env": { "INVOICEPDFS_API_KEY": "inv_live_..." }    }  }}

Create a key at https://invoicepdfs.com. INVOICEPDFS_BASE_URL overrides the host if you are pointing at a local server.

An API key is not scoped. Any key you give this server can do anything your account can, including deleting data. That is a property of the key, not of this server — there is no narrower credential to hand it. Your MCP client will still ask before each tool call.

What it offers

Thirty tools. Twenty-seven name a common operation outright — document_render, document_create, compliance_check, customer_list and so on — document_transition covers the seven-state document lifecycle through one to argument, and two reach everything else:

  • find_operation — search all 161 operations by what they do and get the full input schema of each match.
  • call_operation — run one of them.

The whole API is reachable; only the common path is listed up front. Every client caps the tool list (Cursor around 40, Junie 100, Copilot 128), so a server advertising 161 tools would either break or crowd out every other server you have connected.

document_render renders asynchronously and waits for the result, so it returns a finished render rather than a queued one. Rendering is CPU-bound and served by a single worker, so prefer one render at a time over starting many in parallel.

How it is built

The tool surface is built from openapi.json at startup. src/operations.ts reads the spec and derives each operation's name, input schema and description; src/client.ts is one executor that can run any of them. Adding an endpoint to the API adds a working tool with no code change here.

It is built at runtime rather than generated into a committed file on purpose. The first version of this emitted 16,000 lines of TypeScript that had to be regenerated and committed whenever the API changed — a second copy of the spec, with its own way of going stale. Parsing the spec costs about 10ms, once, in a process that starts once.

Only three things are written by hand:

FileWhy it cannot come from the spec
src/manifest.tsWhich operations are promoted, and what they are called
src/tools/documentRender.tsAsync default and poll-until-terminal
src/tools/findOperation.tsThe search, and the lazy load

Tool descriptions come from the API's handler docstrings, through the spec. They are not written here, because prose about an operation kept in two places drifts.

Develop

bash
npm installnpm test        # drift and tool-surface checksnpm run build   # compilesnpm pack        # vendors openapi.json into the tarball, then cleans up

This repository is generated. The source lives in the InvoicePDFs API monorepo under mcp/, and every commit here is a sync from there — so a change made in this repository is overwritten by the next one. Open an issue instead and it gets made where it survives.

The reason for the split is that the two things want different homes. The code belongs next to the API it describes: tool descriptions are the API handlers' own docstrings, and npm test fails when the manifest names an operation the spec no longer has, which is a guard that only works if it runs in the pull request that renames the handler. The package belongs in a public repository, because npm build provenance requires one, and because a registry listing with no readable source behind it is worth less.

So the drift guard runs upstream on every API change, and this repository publishes.

來源:README.md,提交 597f55d

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.1最新Oct 9, 2026