
Invoice Studio
io.github.vijayst由 GitHub 帳號 vijayst 發布v1.0.0更新於 Oct 24, 2026
Edit Markdown invoice templates, generate PDFs, and inspect preview PNGs.
概覽
讓助手在本機發票專案中編輯 Markdown 發票範本、重新產生 PDF,並檢視預覽 PNG。
- 可以做什麼
- Invoice Studio 提供讀取與寫入發票範本及 CSS 檔案的工具,執行專案的產生建置以輸出 PDF 與預覽 PNG,並回傳該預覽供視覺檢查。它也能查看 Git 狀態、顯示伺服器正在使用的工作區根目錄,並把範本、樣式與資料匯出到複製的分支儲存庫。專案提供三條無介面流程:Markdown 加 Handlebars、Handlebars 加 Tailwind,以及原始 Markdown。
- 適用情境
- 當你把發票範本保存在這個儲存庫,並希望助手反覆調整版面與文字、重新產生 PDF、在提交前檢視預覽時使用。它面向本機桌面編輯流程,而非託管服務。
- 執行需求
- 以 npm 套件形式透過 stdio 在本機執行,通常用 npx 啟動,或在用戶端設定中以絕對路徑指向建置後的 dist/index.js。需要 Node.js、npm install 與 npm run build:mcp,以及用於算繪 PDF 和 PNG 的 Chrome 或 Chromium,可透過 CHROME_PATH 環境變數指定。Tailwind 流程需要網路存取以載入 Tailwind CDN。未宣告帳號、API 金鑰或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Invoice Studio,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Invoice Studio
Invoice templates with an MCP server for interactive editing (Claude Desktop / Cursor / Windsurf) and three headless generate pipelines for monthly PDF runs.
Agents: see AGENTS.md for the edit → generate → preview workflow. Registry → PDF → fork: USER-JOURNEY.md.
How it works
Phase 1 — Interactive studio: an AI client connects to the MCP server over stdio. You ask it to tweak the template or styles, regenerate, and inspect the preview PNG until the layout looks right.
Phase 2 — Monthly execution: pick one of the three generate commands below. The default pipeline updates src/data/invoice-input.json (or injects it from CI), then runs npm run generate to produce output/invoice.pdf and output/preview.png.
Markdown + Handlebars (npm run generate)
Handlebars fills src/templates/invoice.md from src/data/invoice-input.json. Marked turns that Markdown into HTML, src/styles/invoice.css styles it, and headless Chrome writes the PDF and preview.
Handlebars + Tailwind CDN (npm run generate:hbs)
scripts/generate-invoice-hbs.js compiles src/templates/invoice.hbs with the same JSON. Styling is Tailwind utility classes in the template. The page loads Tailwind from https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4, so this command needs network access. The script does not compile a CSS file.
Raw Markdown (npm run generate:raw)
src/templates/invoice-raw.md contains the invoice text itself (dates, amounts, parties, line items). scripts/generate-invoice-raw.js converts that file with Marked and src/styles/invoice.css. This path does not read invoice-input.json and does not run Handlebars. Change the Markdown when the month’s values change.
Setup
Chrome or Chromium is required for PDF/PNG rendering. The generate script finds common install paths (macOS / Linux / Windows). If needed:
Generate an invoice (headless)
Markdown + Handlebars
- Edit monthly fields in
src/data/invoice-input.json(amounts, dates, line items, etc.). - Optionally adjust layout in
src/templates/invoice.mdorsrc/styles/invoice.css. - Run
npm run generate.
Handlebars + Tailwind
- Edit
src/data/invoice-input.jsonfor monthly values. - Adjust layout with Tailwind classes in
src/templates/invoice.hbs. - Run
npm run generate:hbs(requires network so Chrome can load the Tailwind CDN).
Raw Markdown
- Edit the values directly in
src/templates/invoice-raw.md. - Optionally adjust
src/styles/invoice.css. - Run
npm run generate:raw.
Artifacts land in output/.
Use the MCP to edit and generate
1. Build and point your client at the server
Cursor (recommended): this repo includes .cursor/mcp.json. Open the project folder in Cursor, then reload MCP / the window. It uses ${workspaceFolder}/dist/index.js so the path is always the repo root.
If you configure MCP manually in Cursor Settings, use the absolute path to dist/index.js (relative dist/index.js alone resolves under your home directory and fails):
Claude Desktop — in claude_desktop_config.json (absolute paths required):
The server locates the repo from its own script path, so tools always read/write this project even if the client’s cwd is wrong.
Public MCP Registry
Registry name: io.github.vijayst/invoice-studio (npm: @vijayst/invoice-studio). After publish, search the official MCP Registry.
Clients that install from the registry typically run:
npx runs a copy of this repo (sample data included). You can generate output/invoice.pdf in that copy, then fork this repo and export the template into the clone.
Full walkthrough: USER-JOURNEY.md.
2. Interactive edit loop
Ask the model something like:
Read
src/templates/invoice.mdand tighten the payment section. Regenerate and show me the preview.
Typical tool sequence:
Repeat edit → generate → preview until satisfied, then commit.
3. Scripts reference
Project layout
來源:README.md,提交 886f902
工具
0版本歷史
1- v1.0.0最新Sep 21, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。