The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Invoice Studio listing page.
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.
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.
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.
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.
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.
Chrome or Chromium is required for PDF/PNG rendering. The generate script finds common install paths (macOS / Linux / Windows). If needed:
Markdown + Handlebars
src/data/invoice-input.json (amounts, dates, line items, etc.).src/templates/invoice.md or src/styles/invoice.css.npm run generate.Handlebars + Tailwind
src/data/invoice-input.json for monthly values.src/templates/invoice.hbs.npm run generate:hbs (requires network so Chrome can load the Tailwind CDN).Raw Markdown
src/templates/invoice-raw.md.src/styles/invoice.css.npm run generate:raw.Artifacts land in output/.
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.
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.
Ask the model something like:
Read
src/templates/invoice.mdand tighten the payment section. Regenerate and show me the preview.
Typical tool sequence:
| Tool | Purpose |
|---|---|
read_template_file | Read src/templates/invoice.md or src/styles/invoice.css |
write_template_file | Write updated template/CSS |
run_generate_build | Runs npm run generate → PDF + output/preview.png |
get_invoice_preview | Returns the preview PNG for visual review |
get_git_status | Check what changed before committing |
get_workspace_root | Show the npx or clone directory this server is using |
export_studio_to_repo | Copy template/CSS/data from this workspace into a cloned fork |
Repeat edit → generate → preview until satisfied, then commit.
| Script | Command |
|---|---|
| Build MCP | npm run build:mcp |
| Start MCP (stdio) | npm run start:mcp |
| Markdown + Handlebars PDF | npm run generate |
| Handlebars + Tailwind CDN PDF | npm run generate:hbs |
| Raw Markdown PDF | npm run generate:raw |