🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@docweave/mcp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@docweave/mcp

MCP server for AI agents to generate AND read PDFs: generate_pdf (HTML, a URL, or a template + JSON → PDF) and read_pdf (a PDF → text/markdown). Works with Claude, Cursor, and any MCP client.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

@docweave/mcp

npm version npm downloads license

An MCP server that gives your AI agent a generate_pdf tool. Turn HTML, a URL, or a template + JSON into a real PDF — from Claude, Cursor, or any MCP client. Free, open source, renders locally with Chromium.

Built by Docweave — the PDF/document-generation API for AI agents.

Install

Add it to your MCP client config (Claude Desktop, Cursor, Windsurf, …):

{
  "mcpServers": {
    "docweave": {
      "command": "npx",
      "args": ["-y", "@docweave/mcp"]
    }
  }
}

First run downloads a Chromium build via Playwright. If it doesn't render, run once:

npx playwright install chromium

The generate_pdf tool

{
  "source": {
    "type": "template",                 // "html" | "url" | "template"
    "template": "<h1>Invoice {{ n }}</h1>",
    "data": { "n": "INV-042" }
  },
  "options": { "format": "A4" },        // optional: format, landscape, printBackground
  "outputPath": "/tmp/invoice.pdf"      // optional; if omitted, base64 is returned
}
  • html — render a raw HTML string.
  • url — render a public URL (SSRF-guarded: private/loopback hosts and file:// are blocked).
  • template — bind JSON data into an inline template via {{ placeholders }}.

Example asks your agent can now do: "Generate an invoice PDF for order #042 and save it to my Desktop."

Security

Every request the browser makes (page + subresources) is intercepted: non-http(s) schemes (file://) are blocked, and any host that resolves to a private/loopback/ link-local IP is refused — so crafted HTML can't exfiltrate local files or hit internal services. Set DOCWEAVE_ALLOW_PRIVATE_URLS=1 to opt out (e.g. rendering your own localhost).

Hosted API

Need metering, stored templates, higher limits, and per-document billing? The hosted Docweave API wraps the same engine behind POST /api/v1/pdf.

License

MIT

Keywords

mcp

FAQs

Package last updated on 18 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts