Skip to content
MCP server
Registry

docgen-mcp-server MCP Server

Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs.

docgen-mcp-server scores 73 (Good), licensed Apache-2.0 and written in TypeScript. It installs as a local process. It declares 6 tools. Filed under Knowledge, Data and analytics. GitHub shows 3 stars. Package registries report about 374 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.

by cyanheadsApache-2.0TypeScript3 stars
Trust score
73Good
Trust score 73 of 100, Good

Good trust

73 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: apache-2.0.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 73 comes from

22 + 20 + 7 + 10 + 4 + 10 = 73. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity7 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 7 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "cyanheads-docgen-mcp-server": {      "command": "npx",      "args": [        "-y",        "@cyanheads/docgen-mcp-server@0.5.0"      ],      "env": {        "MCP_LOG_LEVEL": "info",        "DOCGEN_DOCUMENT_TTL_SECONDS": "900",        "DOCGEN_MAX_DOCUMENT_BYTES": "26214400",        "DOCGEN_RENDER_TIMEOUT_MS": "30000",        "DOCGEN_INLINE_MAX_BYTES": "5242880",        "DOCGEN_PDF_ENGINE": "lightweight"      }    }  }}

Environment variables

NameRequiredNotes
MCP_LOG_LEVELOptionalSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
DOCGEN_DOCUMENT_TTL_SECONDSOptionalHow long a rendered document is retrievable before it expires, in seconds.
DOCGEN_MAX_DOCUMENT_BYTESOptionalHard ceiling on a single rendered artifact in bytes; exceeding it aborts the render.
DOCGEN_RENDER_TIMEOUT_MSOptionalPer-render wall-clock budget in milliseconds; exceeding it aborts the render.
DOCGEN_INLINE_MAX_BYTESOptionalArtifacts at or under this byte size are returned inline as base64; larger ones omit it.
DOCGEN_PDF_ENGINEOptionalPDF rendering engine. Only 'lightweight' is implemented; 'chromium' is reserved and rejected at startup.
MCP_TRANSPORT_TYPEOptionalSelects the HTTP transport.
MCP_HTTP_HOSTOptionalThe hostname for the HTTP server.
MCP_HTTP_PORTOptionalThe port to run the HTTP server on.
MCP_HTTP_ENDPOINT_PATHOptionalThe endpoint path for the MCP server.
MCP_AUTH_MODEOptionalAuthentication mode to use: 'none', 'jwt', or 'oauth'.
MCP_LOG_LEVELOptionalSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
DOCGEN_DOCUMENT_TTL_SECONDSOptionalHow long a rendered document is retrievable before it expires, in seconds.
DOCGEN_MAX_DOCUMENT_BYTESOptionalHard ceiling on a single rendered artifact in bytes; exceeding it aborts the render.
DOCGEN_RENDER_TIMEOUT_MSOptionalPer-render wall-clock budget in milliseconds; exceeding it aborts the render.
DOCGEN_INLINE_MAX_BYTESOptionalArtifacts at or under this byte size are returned inline as base64; larger ones omit it.
DOCGEN_PDF_ENGINEOptionalPDF rendering engine. Only 'lightweight' is implemented; 'chromium' is reserved and rejected at startup.

Tools6Tool docs quality grade F

All capabilities

About

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework


Overview

Render HTML, Markdown, or template data to PDF, export rows to Excel, and fill PDF forms. Rendering runs locally with pdf-lib, ExcelJS, Marked and parse5.

Tools

ToolDescription
docgen_render_pdfRender HTML, markdown, or a {{key}} template + data object to a downloadable PDF
docgen_export_spreadsheetRender one or more named worksheets of row objects to a downloadable .xlsx workbook
docgen_fill_formFill the AcroForm fields of a supplied PDF (base64 or https URL) and optionally flatten it
docgen_list_form_fieldsInspect AcroForm names, values, constraints, choice options and widget pages without changing the PDF
docgen_get_documentRe-fetch a previously rendered document by the id a render/export/fill tool returned

Resources

ResourceDescription
docgen://document/{documentId}A rendered document by id — raw bytes as a blob plus a JSON metadata block

docgen_get_document retrieves the delivery envelope. Read the resource for bytes when the envelope omits inline base64.

Skill

docgen-guide walks through inspecting, filling, verifying, and flattening an AcroForm PDF. It is available to plugin hosts and MCP clients that support the Skills extension.

Capability reference

docgen_render_pdf tool

  • Provide one source using { html }, { markdown }, or { template, data }. In templates, {{customer.name}} inserts literal text and {{{section}}} inserts HTML. To display a literal tag such as {{#if paid}} alongside interpolated values, write {{#if paid}} in the template.
  • HTML and Markdown share a layout for headings, paragraphs, nested lists, tables and preformatted text. Links print their destinations and task items show their checked state.
  • pageOptions controls page size, orientation, margins, headers, footers and page numbers. Headers and footers support {{page}}, {{total}} and {{date}}. If the margins leave too little room for the content, reduce the named margins or choose a larger page.
  • The delivery envelope includes pageCount. The engine sets degraded when it drops presentation or replaces an unsupported character with ?. Helvetica can print WinAnsi characters such as € and ™.
  • Typed failures include invalid_source, template_render_failed, invalid_page_margins, document_too_large and render_timeout.

docgen_export_spreadsheet tool

  • Supply at least one sheet with a unique name (1–31 characters) and scalar rows[]; empty rows yield a header-only sheet. Optional columns[] sets headers, type (string / number / date / boolean), width and Excel format.
  • Omitted columns use all row keys in first-seen order. Boolean columns accept true/1/yes/on and false/0/no/off, case-insensitive; other strings stay text.
  • Date columns accept full calendar dates such as 2026-03-04 and date-times such as 2026-03-04T10:00-08:00. Without an offset, the value is read as UTC. Invalid dates and locale-style strings stay text. Whitespace-only strings produce blank cells.
  • Returns a DocumentEnvelope with sheetCount. Typed failures: empty_workbook, invalid_sheet_name, document_too_large, render_timeout.

docgen_fill_form tool

  • Provide exactly one sourcePdf: { base64 } or { url } (public HTTPS serving application/pdf, or application/octet-stream whose bytes start with %PDF-), plus a fields map. Flat or XFA-only PDFs return not_a_form.
  • Inspect unfamiliar PDFs with docgen_list_form_fields. Exact names take precedence across the whole map; a unique last segment or case-insensitive full name also works. Ambiguous or conflicting aliases remain unmatched.
  • Returns a DocumentEnvelope with pageCount, unmatchedFields[], resolvedFields[] for accepted aliases, and madeEditableFields[] for dropdowns made editable by custom text. The accompanying notices disclose custom dropdown values and unrecognized checkbox values.
  • Checkboxes accept booleans, common checked/unchecked strings and their PDF export value. Radios and option lists accept an exact option or a unique case-insensitive match. Dropdown custom text is preserved verbatim.
  • Invalid assignments are reported together as invalid_field_value, with field constraints and a recovery hint; no document is stored on failure.
  • flatten: true makes the filled values non-editable (default false).

docgen_list_form_fields tool

  • Accepts the same sourcePdf base64-or-URL source as docgen_fill_form. Returns { fields: [{ name, type, required, options?, label?, maxLength?, onValue?, value?, page? }] } without modifying the PDF or storing a document.
  • Types: text, checkbox, dropdown, optionList, radioGroup, signature, button. Only dropdown, optionList and radioGroup entries include options; signatures and buttons are discovery only.
  • Optional metadata reflects the PDF: tooltip, text length limit, checkbox export value, current value and the first widget's 1-based page. Missing metadata is omitted; unchecked boxes and empty selections remain false and []. Nested names retain their exact paths. PDFs without AcroForm fields return not_a_form.

docgen_get_document tool

  • Supply the documentId an earlier render/export/fill returned (doc_ plus 24 url-safe characters).
  • Re-fetches its DocumentEnvelope without rendering again; an expired or unknown id returns document_expired.

docgen://document/{documentId} resource

  • Use the documentId from a render/export/fill result (doc_ plus 24 url-safe characters).
  • Returns a base64 blob with the document's MIME type and JSON metadata (documentId, byteSize, pageCount/sheetCount, createdAt, ttlSecondsRemaining). Reads the same store as docgen_get_document; expired or unknown ids return document_expired.

Features

Built on @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.

docgen-specific:

  • Bundled rendering stack (pdf-lib, exceljs, marked); only caller-supplied URL sources require a network fetch
  • One shared DocumentEnvelope across the four document delivery tools; field inspection returns its inventory directly
  • Bounded renders — a byte ceiling (DOCGEN_MAX_DOCUMENT_BYTES) and a timeout (DOCGEN_RENDER_TIMEOUT_MS) turn a runaway render into a typed error instead of a hang
  • Tenant-scoped, expiring storage — a document id resolves only for the tenant that created it, and documents expire rather than accumulate
  • SSRF-guarded form fetch — both form tools check every address, including each redirect hop, and block private, loopback and link-local destinations

Agent-friendly output:

  • Dual-surface delivery — every envelope field appears in both structuredContent and the markdown output, including the documentId, resource URI, size, and TTL
  • Inline by size — inlineBase64 is populated only at or under DOCGEN_INLINE_MAX_BYTES; larger documents are delivered through the resource URI
  • Fill reporting — unmatched names, resolved aliases and dropdown editability changes are visible on both output surfaces
  • Typed errors with recovery hints (invalid_source, template_render_failed, document_too_large, render_timeout, not_a_form, source_unfetchable, document_expired, …); semantic validation uses ValidationError (-32007) and malformed arguments InvalidParams (-32602)

Getting started

Add the following to your MCP client configuration file. No API keys are required.

{
  "mcpServers": {
    "docgen-mcp-server": {
      "type": "stdio",
      "command": "bunx",
      "args": ["@cyanheads/docgen-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Or with npx (no Bun required):

{
  "mcpServers": {
    "docgen-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cyanheads/docgen-mcp-server@latest"],
      "env": {
        "MCP_TRANSPORT_TYPE": "stdio",
        "MCP_LOG_LEVEL": "info"
      }
    }
  }
}

Or with Docker:

{
  "mcpServers": {
    "docgen-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MCP_TRANSPORT_TYPE=stdio",
        "ghcr.io/cyanheads/docgen-mcp-server:latest"
      ]
    }
  }
}

For Streamable HTTP, set the transport and start the server:

MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp

Documents 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.

Prerequisites

  • Bun v1.4.4 or higher (or Node.js v24+). Development uses Bun v1.4.4.

Installation

  1. Clone the repository:
git clone https://github.com/cyanheads/docgen-mcp-server.git
  1. Navigate into the directory:
cd docgen-mcp-server
  1. Install dependencies:
bun install
  1. Configure environment:
cp .env.example .env
# edit .env to override any defaults

Configuration

All configuration is optional — docgen runs with no required environment variables.

VariableDescriptionDefault
DOCGEN_DOCUMENT_TTL_SECONDSHow long a rendered document is retrievable before it expires, in seconds.900
DOCGEN_MAX_DOCUMENT_BYTESHard ceiling on a single rendered artifact in bytes; exceeding it aborts the render.26214400
DOCGEN_RENDER_TIMEOUT_MSPer-render wall-clock budget in milliseconds; exceeding it aborts the render.30000
DOCGEN_INLINE_MAX_BYTESArtifacts at or under this byte size are returned inline as base64; larger ones omit it.5242880
DOCGEN_PDF_ENGINEPDF rendering engine. Only lightweight is implemented; chromium is reserved and rejected at startup.lightweight
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for the HTTP server.3010
MCP_SESSION_MODEHTTP session mode: auto, stateful, or stateless.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_PUBLIC_URLPublic origin behind a TLS proxy.—
MCP_LOG_LEVELLog level (RFC 5424).info
LOG_TOOL_FAILURE_PAYLOADSLog failed arguments/results, redacted by key name and capped by LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). Free-form values may retain secrets.false
STORAGE_PROVIDER_TYPEStorage backend for document bytes + metadata.in-memory
OTEL_ENABLEDEnable OpenTelemetry instrumentation (spans, metrics, completion logs).false
OTEL_EXPORTER_OTLP_ENDPOINTBase OTLP URL; traces use /v1/traces, metrics use /v1/metrics. Signal-specific endpoints override it.—
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTOpt-in log endpoint, used as-is; the base URL never enables log export.—

See .env.example for the full list of optional overrides.

The default in-memory storage drops every document on restart, and earlier ids then return document_expired. To keep documents across restarts, point STORAGE_PROVIDER_TYPE at a persistent backend.

When upgrading a filesystem store from mcp-ts-core 0.13.21 or earlier, the first start copies existing data into _v2/ under STORAGE_FILESYSTEM_PATH. Allow room for both copies and upgrade every instance sharing the path before resuming writes.

Running the server

Local development

  • Build and run:

    # One-time build
    bun run rebuild
    
    # Run the built server
    bun run start:stdio
    # or
    bun run start:http
    
  • Run checks and tests:

    bun run devcheck   # Lint, format, typecheck, security, changelog sync
    bun run test       # Vitest test suite
    bun run lint:mcp   # Validate MCP definitions against spec
    

Docker

docker build -t docgen-mcp-server .
docker run --rm -e MCP_TRANSPORT_TYPE=http -p 3010:3010 docgen-mcp-server

The 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.

Project structure

DirectoryPurpose
src/index.tscreateApp() entry point — registers the tools/resource and inits the render + storage services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts).
src/mcp-server/resourcesResource definitions (*.resource.ts).
src/services/documentThe rendering stack (RenderService) and artifact store (DocumentStore), shared types, and the SSRF fetch guard.
tests/Unit and integration tests mirroring src/.

Development guide

See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:

  • Handlers throw, framework catches — no try/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.state for tenant-scoped storage
  • Register new tools and resources in src/index.ts's createApp() arrays
  • One shared DocumentEnvelope across all delivery tools — keep the writers and reader interchangeable

Contributing

Issues are welcome. Run checks and tests before submitting:

bun run devcheck
bun run test

License

Apache-2.0 — see LICENSE for details.

Frequently asked questions

What is docgen-mcp-server MCP Server?

Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs.

How do I install docgen-mcp-server MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. docgen-mcp-server MCP Server runs locally from the npm package @cyanheads/docgen-mcp-server with the command npx -y @cyanheads/docgen-mcp-server@0.5.0.

Is docgen-mcp-server MCP Server free and open source?

Yes. docgen-mcp-server MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

What tools does docgen-mcp-server MCP Server provide?

docgen-mcp-server MCP Server provides 6 tools, including ctx.log, docgen_export_spreadsheet, docgen_fill_form, and docgen_get_document. See the full tool list for descriptions and parameters.

How is docgen-mcp-server MCP Server's trust score calculated?

docgen-mcp-server MCP Server scores 73 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server