{"_id":"@cyanheads/docgen-mcp-server","_rev":"4-2627002c689089f0b58d4f4fdd1d5349","name":"@cyanheads/docgen-mcp-server","dist-tags":{"latest":"0.2.3"},"versions":{"0.2.0":{"name":"@cyanheads/docgen-mcp-server","version":"0.2.0","keywords":["mcp","mcp-server","model-context-protocol","typescript","bun","stdio","streamable-http","pdf","xlsx","spreadsheet","pdf-form","document-generation"],"author":"cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/docgen-mcp-server#readme)","license":"Apache-2.0","_id":"@cyanheads/docgen-mcp-server@0.2.0","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/docgen-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/docgen-mcp-server/issues"},"bin":{"docgen-mcp-server":"dist/index.js"},"dist":{"shasum":"7bc4ed2aac00fff9b328212a53d6a39df9daa043","tarball":"https://registry.npmjs.org/@cyanheads/docgen-mcp-server/-/docgen-mcp-server-0.2.0.tgz","fileCount":66,"integrity":"sha512-cCW64+VGoy1GE5G0hBa80d1yw4i7IlbSh7K5gR19zAzwWltatST6eBZiHxnheLfKCQDeKu67yjkipJGDm6oJbQ==","signatures":[{"sig":"MEUCICmO1UuuteIhiLzaRjzY7le7nWDPdIMgpT8UM7+IQCZjAiEAqgJ31MiQoO5eK/mom7bE+qi9aNMHeC9acLT74LMPKWg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":288623},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"7bc4ed2aac00fff9b328212a53d6a39df9daa043","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/docgen-mcp-server","scripts":{"test":"vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"node dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/docgen-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/docgen-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run scripts/build.ts","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-cCW64+VGoy1GE5G0hBa80d1yw4i7IlbSh7K5gR19zAzwWltatST6eBZiHxnheLfKCQDeKu67yjkipJGDm6oJbQ==","repository":{"url":"git+https://github.com/cyanheads/docgen-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","marked":"^18.0.5","exceljs":"^4.4.0","pdf-lib":"^1.17.1","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.10.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.2","devDependencies":{"ignore":"^7.0.5","vitest":"^4.1.8","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^26.0.1","@biomejs/biome":"^2.5.1"},"_npmOperationalInternal":{"tmp":"tmp/docgen-mcp-server_0.2.0_1782623002381_0.40873067570149857","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@cyanheads/docgen-mcp-server","version":"0.2.1","keywords":["mcp","mcp-server","model-context-protocol","typescript","bun","stdio","streamable-http","pdf","xlsx","spreadsheet","pdf-form","document-generation"],"author":"cyanheads <casey@caseyjhand.com> (https://github.com/cyanheads/docgen-mcp-server#readme)","license":"Apache-2.0","_id":"@cyanheads/docgen-mcp-server@0.2.1","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/docgen-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/docgen-mcp-server/issues"},"bin":{"docgen-mcp-server":"dist/index.js"},"dist":{"shasum":"77ad6baf90cec1ec7b40de4bfe101322cd521019","tarball":"https://registry.npmjs.org/@cyanheads/docgen-mcp-server/-/docgen-mcp-server-0.2.1.tgz","fileCount":67,"integrity":"sha512-pOrJxuomk2ua9t9I9RjkBd2R33Ctmt00DHU/45EAmlmV3hDUai3p1a0R1v788aRXzrz9ytJ1sLoW9pf/H73DdQ==","signatures":[{"sig":"MEUCIQDxwTNEL7fCc7uMfCLoWQ80MXZ80g/YPqKnFBqlRDlzIQIgBFkPIqBVhWgmVjXvVxpmd4X15W7Aa7y4L1wHX79U6gU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296575},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"77ad6baf90cec1ec7b40de4bfe101322cd521019","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/docgen-mcp-server","scripts":{"test":"vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"node dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/docgen-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/docgen-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run scripts/build.ts","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-pOrJxuomk2ua9t9I9RjkBd2R33Ctmt00DHU/45EAmlmV3hDUai3p1a0R1v788aRXzrz9ytJ1sLoW9pf/H73DdQ==","repository":{"url":"git+https://github.com/cyanheads/docgen-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.4.3","marked":"^18.0.5","exceljs":"^4.4.0","pdf-lib":"^1.17.1","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.10.9"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.3.2","devDependencies":{"ignore":"^7.0.5","vitest":"^4.1.8","depcheck":"^1.4.7","tsc-alias":"^1.8.17","typescript":"^6.0.3","@types/node":"^26.0.1","@biomejs/biome":"^2.5.1"},"_npmOperationalInternal":{"tmp":"tmp/docgen-mcp-server_0.2.1_1782654350153_0.612594799507356","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@cyanheads/docgen-mcp-server","version":"0.2.2","keywords":["mcp","mcp-server","model-context-protocol","typescript","bun","stdio","streamable-http","pdf","xlsx","spreadsheet","pdf-form","document-generation"],"author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","license":"Apache-2.0","_id":"@cyanheads/docgen-mcp-server@0.2.2","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"homepage":"https://github.com/cyanheads/docgen-mcp-server#readme","bugs":{"url":"https://github.com/cyanheads/docgen-mcp-server/issues"},"bin":{"docgen-mcp-server":"dist/index.js"},"dist":{"shasum":"4269766e4966f315d78da588fe1ccc525744be80","tarball":"https://registry.npmjs.org/@cyanheads/docgen-mcp-server/-/docgen-mcp-server-0.2.2.tgz","fileCount":68,"integrity":"sha512-3U7b78dEFF38CRDh6m3zk+oUdApVXW8ebQx6OX/fZw8tN4FnnzBu9YlxBIl8RaGYnL67Hb4R9Yb2DCb58UhFoA==","signatures":[{"sig":"MEYCIQD+bBy7GHdtf01EoFFbSpKR7Tp9Z4790x6/OEmxJd699QIhALeiRy/IFrRbvUhU3opjlixUVmSLrwLIMpnuDGjGMzZF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":303915},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","shasum":"4269766e4966f315d78da588fe1ccc525744be80","engines":{"bun":">=1.3.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"mcpName":"io.github.cyanheads/docgen-mcp-server","scripts":{"test":"vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"node dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/docgen-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/docgen-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run scripts/build.ts","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","test:coverage":"vitest run --coverage","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"_integrity":"sha512-3U7b78dEFF38CRDh6m3zk+oUdApVXW8ebQx6OX/fZw8tN4FnnzBu9YlxBIl8RaGYnL67Hb4R9Yb2DCb58UhFoA==","repository":{"url":"git+https://github.com/cyanheads/docgen-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"zod":"^4.4.3","marked":"^18.0.10","exceljs":"^4.4.0","pdf-lib":"^1.17.1","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.12.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"ignore":"^7.0.6","vitest":"^4.1.11","depcheck":"^1.4.7","tsc-alias":"^1.9.2","fast-check":"^4.9.0","typescript":"^7.0.2","@types/node":"^26.2.0","@biomejs/biome":"^2.5.9","@vitest/coverage-istanbul":"^4.1.11","@socketsecurity/bun-security-scanner":"^1.1.2"},"_npmOperationalInternal":{"tmp":"tmp/docgen-mcp-server_0.2.2_1787354552713_0.6508003491884358","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"_id":"@cyanheads/docgen-mcp-server@0.2.3","bin":{"docgen-mcp-server":"dist/index.js"},"bugs":{"url":"https://github.com/cyanheads/docgen-mcp-server/issues"},"dist":{"shasum":"89acbe6932b955508db8d3049cfbfdcbbe881aab","tarball":"https://registry.npmjs.org/@cyanheads/docgen-mcp-server/-/docgen-mcp-server-0.2.3.tgz","fileCount":69,"integrity":"sha512-qJ+oYHQ6PlTeprbuPcuNOkE5YqClThwQ1kDP5dqmkeboDsrmUNeBREoCZ5YFYKYQpu876XHXv2K/wU/nfeM4dQ==","signatures":[{"sig":"MEYCIQCZvFtvwzmPnQlJzXHyY7DLa5teJp+8pd4c/QJ1ZeL3IQIhAJcAH2GeHetng2Iu7Ah2ela96BFVhdb8/aaWYfKpEsav","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDosUfIFNwSqVRRtzq4sk7/9fg+uayE/6gbc70Qjs4U+AIhALuyKavrFN6mL55KgFePNwPeaMMVbtutrb0nneA+Nab7"}],"unpackedSize":320606},"main":"dist/index.js","name":"@cyanheads/docgen-mcp-server","type":"module","types":"dist/index.d.ts","author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","shasum":"89acbe6932b955508db8d3049cfbfdcbbe881aab","engines":{"bun":">=1.4.0","node":">=24.0.0"},"funding":[{"url":"https://github.com/sponsors/cyanheads","type":"github"},{"url":"https://www.buymeacoffee.com/cyanheads","type":"buy_me_a_coffee"}],"license":"Apache-2.0","mcpName":"io.github.cyanheads/docgen-mcp-server","scripts":{"test":"vitest run","tree":"bun run scripts/tree.ts","build":"bun run scripts/build.ts","clean":"bun run scripts/clean.ts","start":"node dist/index.js","bundle":"bun run build && npx -y @anthropic-ai/mcpb pack . dist/docgen-mcp-server.mcpb && bun run scripts/clean-mcpb.ts dist/docgen-mcp-server.mcpb","format":"biome check --write .","rebuild":"bun run scripts/clean.ts && bun run scripts/build.ts","devcheck":"bun run scripts/devcheck.ts","lint:mcp":"bun run scripts/lint-mcp.ts","audit:fix":"bun audit fix","start:http":"MCP_TRANSPORT_TYPE=http node dist/index.js","list-skills":"bun run scripts/list-skills.ts","publish-mcp":"mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish","start:stdio":"MCP_TRANSPORT_TYPE=stdio node dist/index.js","audit:refresh":"rm -f bun.lock && bun install && bun audit","format:unsafe":"biome check --write --unsafe .","test:coverage":"vitest run --coverage","lint:packaging":"bun run scripts/lint-packaging.ts","release:github":"bun run scripts/release-github.ts","changelog:build":"bun run scripts/build-changelog.ts","changelog:check":"bun run scripts/build-changelog.ts --check"},"version":"0.2.3","_npmUser":{"name":"cyanheads","email":"casey@caseyjhand.com"},"homepage":"https://github.com/cyanheads/docgen-mcp-server#readme","keywords":["mcp","mcp-server","model-context-protocol","typescript","bun","stdio","streamable-http","pdf","xlsx","spreadsheet","pdf-form","document-generation"],"_integrity":"sha512-qJ+oYHQ6PlTeprbuPcuNOkE5YqClThwQ1kDP5dqmkeboDsrmUNeBREoCZ5YFYKYQpu876XHXv2K/wU/nfeM4dQ==","repository":{"url":"git+https://github.com/cyanheads/docgen-mcp-server.git","type":"git"},"_npmVersion":"10.8.3","description":"Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.","directories":{},"maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"_nodeVersion":"26.3.0","dependencies":{"zod":"^4.6.5","marked":"^18.0.13","exceljs":"^4.4.0","pdf-lib":"^1.17.1","pino-pretty":"^13.1.3","@cyanheads/mcp-ts-core":"^0.13.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"bun@1.4.0","devDependencies":{"ignore":"^7.0.9","vitest":"^5.0.1","depcheck":"^1.4.7","tsc-alias":"^1.9.5","fast-check":"^4.10.1","typescript":"^7.0.2","@types/node":"^26.6.2","@biomejs/biome":"^2.5.14","@vitest/coverage-istanbul":"^5.0.1","@socketsecurity/bun-security-scanner":"^1.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/docgen-mcp-server_0.2.3_1790050869036_0.06106603506741415"}}},"time":{"created":"2026-06-28T05:03:22.206Z","modified":"2026-09-22T04:21:09.611Z","0.2.0":"2026-06-28T05:03:22.552Z","0.2.1":"2026-06-28T13:45:50.297Z","0.2.2":"2026-08-21T23:22:32.849Z","0.2.3":"2026-09-22T04:21:09.151Z"},"bugs":{"url":"https://github.com/cyanheads/docgen-mcp-server/issues"},"author":"Casey Hand <casey@caseyjhand.com> (https://caseyjhand.com)","license":"Apache-2.0","homepage":"https://github.com/cyanheads/docgen-mcp-server#readme","keywords":["mcp","mcp-server","model-context-protocol","typescript","bun","stdio","streamable-http","pdf","xlsx","spreadsheet","pdf-form","document-generation"],"repository":{"url":"git+https://github.com/cyanheads/docgen-mcp-server.git","type":"git"},"description":"Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.","maintainers":[{"name":"cyanheads","email":"casey@caseyjhand.com"}],"readme":"<div align=\"center\">\n  <h1>@cyanheads/docgen-mcp-server</h1>\n  <p><b>Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs via MCP. STDIO or Streamable HTTP.</b>\n  <div>4 Tools • 1 Resource</div>\n  </p>\n</div>\n\n<div align=\"center\">\n\n[![Version](https://img.shields.io/badge/Version-0.2.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/docgen-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/docgen-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/docgen-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)\n\n</div>\n\n<div align=\"center\">\n\n[![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/docgen-mcp-server/releases/latest/download/docgen-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=docgen-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvZG9jZ2VuLW1jcC1zZXJ2ZXIiXX0=) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22docgen-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fdocgen-mcp-server%22%5D%7D)\n\n[![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)\n\n</div>\n\n---\n\n## Overview\n\nDocument rendering built on a bundled stack — pdf-lib for PDF and AcroForm fill, exceljs for spreadsheets, marked for markdown. Render HTML, markdown, or template data to PDF, export tabular rows to xlsx, and fill AcroForm PDF forms from any MCP client. Runs as a stdio process or a local Streamable HTTP server.\n\n### Tools\n\n| Tool | Description |\n|:---|:---|\n| `docgen_render_pdf` | Render HTML, markdown, or a `{{key}}` template + data object to a downloadable PDF |\n| `docgen_export_spreadsheet` | Render one or more named worksheets of row objects to a downloadable `.xlsx` workbook |\n| `docgen_fill_form` | Fill the AcroForm fields of a supplied PDF (base64 or https URL) and optionally flatten it |\n| `docgen_get_document` | Re-fetch a previously rendered document by the id a render/export/fill tool returned |\n\n### Resources\n\n| Resource | Description |\n|:---|:---|\n| `docgen://document/{documentId}` | A rendered document by id — raw bytes as a blob plus a JSON metadata block |\n\nAll document data is also reachable via the tool surface — `docgen_get_document` is the tool-only twin of this resource.\n\n## Capability reference\n\n### `docgen_render_pdf` <sub>tool</sub>\n\n- Provide exactly one `source`: `{ html }` (raw HTML, recommended), `{ markdown }` (converted to HTML), or `{ template, data }` (a `{{key}}` template filled from a data object)\n- `pageOptions` sets `size` (`A4` / `Letter` / `Legal` / `A3` / `A5`, default `Letter`), `orientation` (default `portrait`), per-side `margin` as CSS lengths (`\"10mm\"`, `\"0.5in\"`, `\"72pt\"`), `header`/`footer` text supporting `{{page}}` / `{{total}}` / `{{date}}` tokens, and `pageNumbers`\n- The lightweight engine renders structured layout (headings, paragraphs, lists, tables) but not arbitrary CSS, images, or scripts — sets `degraded: true` in the enrichment when unsupported styling is dropped\n- Returns a `DocumentEnvelope` with `pageCount`\n- Typed failures: `invalid_source`, `template_render_failed`, `document_too_large`, `render_timeout`\n\n---\n\n### `docgen_export_spreadsheet` <sub>tool</sub>\n\n- Each entry in `sheets[]` is a worksheet `name` (1–31 chars, unique case-insensitively, no `* ? : \\ / [ ]`, no leading/trailing apostrophe) plus a `rows[]` array of property → scalar objects\n- Optional `columns[]` sets header label, value `type` (`string` / `number` / `date` / `boolean`), width, and an Excel number/date format string; omitted columns derive from the first row's keys\n- An empty `rows[]` yields a header-only sheet; an empty `sheets[]` is rejected as `empty_workbook`\n- Returns a `DocumentEnvelope` with `sheetCount`\n- Typed failures: `empty_workbook`, `invalid_sheet_name`, `document_too_large`, `render_timeout`\n\n---\n\n### `docgen_fill_form` <sub>tool</sub>\n\n- Provide the source PDF as exactly one of `{ base64 }` (whitespace and an optional `data:application/pdf;base64,` prefix tolerated) or `{ url }` — an https URL fetched behind an SSRF guard that resolves DNS, blocks private/loopback/link-local destinations, re-validates every redirect hop, and requires `application/pdf`\n- `fields` is an AcroForm field name → value map; names are case-sensitive and must match the PDF's internal field names exactly\n- Names with no AcroForm counterpart come back in `unmatchedFields[]` instead of failing the call\n- `flatten: true` bakes the values in so the result is no longer editable (default `false`)\n- AcroForm only — a flat or XFA-based PDF returns `not_a_form`\n- Returns a `DocumentEnvelope` with `pageCount`, plus `unmatchedFields[]`\n\n---\n\n### `docgen_get_document` <sub>tool</sub>\n\n- `documentId` must match `doc_` followed by 24 url-safe characters — the format returned by `docgen_render_pdf`, `docgen_export_spreadsheet`, or `docgen_fill_form`; not guessable or constructible\n- Pure read — re-fetches the same `DocumentEnvelope`, useful when an earlier response omitted `inlineBase64` (over the inline threshold)\n- An expired or unknown id returns `document_expired`; ids are single-render and not reusable\n\n---\n\n### `docgen://document/{documentId}` <sub>resource</sub>\n\n- `documentId` format: `doc_` followed by 24 url-safe characters, obtained from a docgen render/export/fill tool result\n- Returns two content items: the raw bytes as a `blob` (real mime type — PDF or xlsx) plus a JSON metadata block (`documentId`, `byteSize`, `pageCount`/`sheetCount` when applicable, `createdAt`, `ttlSecondsRemaining`)\n- Reads the same tenant-scoped store as `docgen_get_document` and never re-renders\n- An expired or unknown id returns `document_expired`\n\n## Features\n\nBuilt on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.\n\ndocgen-specific:\n\n- No external API — a bundled rendering stack (`pdf-lib`, `exceljs`, `marked`), so renders are local and deterministic with no upstream to fail\n- One shared `DocumentEnvelope` across all four tools — the three writers and the reader are interchangeable to the agent, and the resource-URI vs. inline-base64 delivery decision lives in one place\n- Bounded renders — a per-document byte ceiling (`DOCGEN_MAX_DOCUMENT_BYTES`) and a wall-clock timeout (`DOCGEN_RENDER_TIMEOUT_MS`) turn a runaway render into a typed, recoverable error instead of a hang\n- Tenant-scoped, TTL-bounded storage — a document id minted for one tenant resolves only for that tenant; outputs are downloads, not records, so they expire rather than accumulate\n- SSRF-guarded form fetch — `docgen_fill_form` with a URL source resolves DNS and checks the destination IP before fetching, blocking private/loopback/link-local ranges\n\nAgent-friendly output:\n\n- Dual-surface delivery — every envelope field lands in both `structuredContent` and the `format()` markdown twin, so tool-only and resource-only clients both see the `documentId`, resource URI, inline-availability status, size, and TTL\n- Inline-vs-resource by size — `inlineBase64` is populated only at or under `DOCGEN_INLINE_MAX_BYTES`, so a large workbook isn't base64-inlined into a tool result; above the threshold, delivery is via the resource URI\n- Partial-fill reporting — `docgen_fill_form` returns `unmatchedFields[]` so the agent learns which field names didn't land and can correct and re-render rather than assuming a clean fill\n- Typed error contract with recovery hints — each tool declares its failure surface (`invalid_source`, `template_render_failed`, `document_too_large`, `render_timeout`, `not_a_form`, `source_unfetchable`, `document_expired`, …) with actionable next-step text\n\n## Getting started\n\nAdd the following to your MCP client configuration file. No API keys are required.\n\n```json\n{\n  \"mcpServers\": {\n    \"docgen-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"bunx\",\n      \"args\": [\"@cyanheads/docgen-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with npx (no Bun required):\n\n```json\n{\n  \"mcpServers\": {\n    \"docgen-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@cyanheads/docgen-mcp-server@latest\"],\n      \"env\": {\n        \"MCP_TRANSPORT_TYPE\": \"stdio\",\n        \"MCP_LOG_LEVEL\": \"info\"\n      }\n    }\n  }\n}\n```\n\nOr with Docker:\n\n```json\n{\n  \"mcpServers\": {\n    \"docgen-mcp-server\": {\n      \"type\": \"stdio\",\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\", \"-i\", \"--rm\",\n        \"-e\", \"MCP_TRANSPORT_TYPE=stdio\",\n        \"ghcr.io/cyanheads/docgen-mcp-server:latest\"\n      ]\n    }\n  }\n}\n```\n\nFor Streamable HTTP, set the transport and start the server:\n\n```sh\nMCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http\n# Server listens at http://localhost:3010/mcp\n```\n\nDocuments are delivered by the `docgen://document/{id}` resource (and inline base64 when small enough) over every transport. The envelope's `downloadUrl` field is reserved for a future HTTP download route and is not emitted in this version.\n\n### Prerequisites\n\n- [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).\n\n### Installation\n\n1. **Clone the repository:**\n\n```sh\ngit clone https://github.com/cyanheads/docgen-mcp-server.git\n```\n\n2. **Navigate into the directory:**\n\n```sh\ncd docgen-mcp-server\n```\n\n3. **Install dependencies:**\n\n```sh\nbun install\n```\n\n4. **Configure environment:**\n\n```sh\ncp .env.example .env\n# edit .env to override any defaults\n```\n\n## Configuration\n\nAll configuration is optional — docgen runs with no required environment variables.\n\n| Variable | Description | Default |\n|:---------|:------------|:--------|\n| `DOCGEN_DOCUMENT_TTL_SECONDS` | How long a rendered document is retrievable before it expires, in seconds. | `900` |\n| `DOCGEN_MAX_DOCUMENT_BYTES` | Hard ceiling on a single rendered artifact in bytes; exceeding it aborts the render. | `26214400` |\n| `DOCGEN_RENDER_TIMEOUT_MS` | Per-render wall-clock budget in milliseconds; exceeding it aborts the render. | `30000` |\n| `DOCGEN_INLINE_MAX_BYTES` | Artifacts at or under this byte size are returned inline as base64; larger ones omit it. | `5242880` |\n| `DOCGEN_PDF_ENGINE` | PDF rendering engine. Only `lightweight` is implemented; `chromium` is reserved and rejected at startup. | `lightweight` |\n| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |\n| `MCP_HTTP_PORT` | Port for the HTTP server. | `3010` |\n| `MCP_SESSION_MODE` | HTTP session posture: `auto`, `stateful`, or `stateless`. docgen declares `stateless` in code, since no tool asks for input mid-handler and documents live in tenant-scoped storage rather than the session store. The env var overrides it when set; the framework's `auto` default resolves to `stateful`. | `stateless` |\n| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |\n| `MCP_PUBLIC_URL` | Public origin behind a TLS proxy. (The `downloadUrl` envelope field is reserved for a future HTTP download route and is not emitted in this version.) | — |\n| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |\n| `STORAGE_PROVIDER_TYPE` | Storage backend for document bytes + metadata. | `in-memory` |\n| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |\n\nSee [`.env.example`](./.env.example) for the full list of optional overrides.\n\n> Documents are stored in `ctx.state`, which the in-memory provider keeps in process memory — a restart drops every stored document, and an id minted before the restart returns `document_expired`. This is intended (outputs are downloads, not records); for durable retention across restarts, point `STORAGE_PROVIDER_TYPE` at a persistent backend.\n\n## Running the server\n\n### Local development\n\n- **Build and run:**\n\n  ```sh\n  # One-time build\n  bun run rebuild\n\n  # Run the built server\n  bun run start:stdio\n  # or\n  bun run start:http\n  ```\n\n- **Run checks and tests:**\n\n  ```sh\n  bun run devcheck   # Lint, format, typecheck, security, changelog sync\n  bun run test       # Vitest test suite\n  bun run lint:mcp   # Validate MCP definitions against spec\n  ```\n\n### Docker\n\n```sh\ndocker build -t docgen-mcp-server .\ndocker run --rm -e MCP_TRANSPORT_TYPE=http -p 3010:3010 docgen-mcp-server\n```\n\nThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/docgen-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.\n\n## Project structure\n\n| Directory | Purpose |\n|:----------|:--------|\n| `src/index.ts` | `createApp()` entry point — registers the tools/resource and inits the render + storage services. |\n| `src/config` | Server-specific environment variable parsing and validation with Zod. |\n| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). |\n| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). |\n| `src/services/document` | The rendering stack (`RenderService`) and artifact store (`DocumentStore`), shared types, and the SSRF fetch guard. |\n| `tests/` | Unit and integration tests mirroring `src/`. |\n\n## Development guide\n\nSee [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:\n\n- Handlers throw, framework catches — no `try/catch` in tool logic\n- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage\n- Register new tools and resources in `src/index.ts`'s `createApp()` arrays\n- One shared `DocumentEnvelope` across all delivery tools — keep the writers and reader interchangeable\n\n## Contributing\n\nIssues are welcome. Run checks and tests before submitting:\n\n```sh\nbun run devcheck\nbun run test\n```\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md"}