
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 分
请在仓库或注册中心条目中声明许可证。