MCP PDF
Generate professional PDFs with full Unicode, emoji, and offline support for diverse document needs.
Create Simple Documents: Generate basic text PDFs quickly with titles and content for letters and notices
Build Advanced Layouts: Design complex documents with full layout control including text positioning, images, shapes (rectangles, circles, lines), colors, gradients, and custom page configurations
Generate Professional Resumes: Create formatted resumes from standard JSON Resume format with customizable styling for margins, spacing, fonts, and header alignment
Rich Text Styling: Apply extensive formatting with custom fonts, sizes, colors, alignment (left, center, right, justify), bold, italic, underline, strikethrough, character/word spacing, and line/paragraph gaps
Unicode & Emoji Support: Render full color emojis (😀 🎉 🚀) and international text (Chinese, Japanese, Korean, Arabic, Cyrillic) automatically
Work Offline: Operate without internet after initial installation with cached fonts and emoji resources
Security Features: Write PDFs to sandboxed directories with filename sanitization to prevent path traversal attacks
Hosted on GitHub as a repository for source code and issue tracking
Built using JavaScript/TypeScript and provides direct access to PDFKit's JavaScript API for advanced PDF generation capabilities
Runs on Node.js runtime environment and is distributed as a Node.js package
Published and distributed through npm package registry for easy installation and dependency management
Provides TypeScript interfaces and examples for type-safe PDF generation and content structuring
Provides full Unicode text support for international languages including CJK, Arabic, Cyrillic, Hebrew, Thai and other scripts in PDF generation
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP PDF create a resume for me with my work experience and skills"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mcp-z/mcp-pdf
Create PDF documents and layouts, render pages to PNG, and measure text through MCP. The server runs locally and requires no API key.
Requires Node.js >=22.13. The examples use npx, included with npm, to run this server and @mcp-z/cli.
Transports
MCP supports stdio and HTTP.
Both transports support the 2025 and 2026-07-28 protocol revisions. The 2026 revision is stateless, so clients using it send no initialize handshake or session ID.
Save one of these configurations as .mcp.json in the directory where you will run the commands.
Stdio
{
"mcpServers": {
"pdf": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf"]
}
}
}HTTP
{
"mcpServers": {
"pdf": {
"type": "http",
"url": "http://localhost:9010/mcp",
"start": {
"command": "npx",
"args": ["-y", "@mcp-z/mcp-pdf", "--port=9010"]
}
}
}
}start is an extension used by npx @mcp-z/cli up to launch HTTP servers for you. The MCP endpoint is /mcp.
Related MCP server: Yakpdf MCP Server
First use
# List tools
npx -y @mcp-z/cli inspect --servers pdf --tools
# Create a simple PDF
npx -y @mcp-z/cli call-tool pdf pdf-document '{"content":[{"type":"text","text":"Hello from MCP"}]}'The tool returns a file URI and metadata for the generated PDF. See the complete tool reference for parameters and examples.
Tool summary
Tool | Use |
| Flowing documents with automatic pagination |
| Precisely positioned layouts such as slides and flyers |
| JSON Resume documents |
| Render PDF pages to PNG |
| Measure text before layout |
External resources
None.
Prompts
resource-fetching
Resources
PDFKit Documentation
JSON Resume Schema
JSON Resume Editor
Documentation
Available Tools
5 toolspdf-documentCreate PDF DocumentA
Create a flowing PDF document with automatic pagination.
Best for: Reports, articles, letters, contracts, and documents with sequential content.
Content flows naturally from top to bottom. Pages break automatically when content exceeds page height. Use "pageBreak" to force page breaks, "divider" for horizontal rules, and "spacer" for vertical spacing.
Supported content types:
text: Body text with optional formatting (bold, italic, color, alignment)
heading: Section headings (larger font, bold by default)
image: Inline images that flow with content
divider: Horizontal line separators
spacer: Vertical whitespace
pageBreak: Force new page
Default margins: Varies by page size (e.g., 72pt/1" for Letter, ~56pt for A4).
Inputs: content (required), filename, title, author, +2 more. Returns: result
pdf-imageConvert PDF to ImageA
Generate PNG image(s) from PDF pages.
Use this to visually verify PDF output without opening external applications.
Pages Options:
Single page:
pages: 1orpages: 3Multiple pages:
pages: [1, 3, 5]All pages:
pages: "all"Default: page 1 only
Viewport Scale Recommendations:
0.25 (thumbnail): ~150px wide, smallest file (~15-30KB). Use for quick verification.
0.5 (preview): ~300px wide, good balance (~40-80KB). Recommended default.
1.0 (full): ~612px wide, detailed view (~150-300KB). Use when details matter.
Lower scales produce smaller files, reducing context usage when sharing images.
Inputs: pdfPath (required), pages, viewportScale. Returns: images, totalPages
pdf-layoutCreate PDF LayoutA
Create a PDF with precise positioning using Yoga flexbox layout.
Best for: Dashboards, slides, certificates, flyers, and designs requiring exact placement.
All items are positioned absolutely on specific pages. Use the "page" property to target different pages (e.g., page: 2 for multi-slide presentations). Pages are created as needed.
Use groups for flexbox containers - they support direction, gap, justify, alignItems, and alignment properties for sophisticated layouts.
Default margins: 0 (full canvas access for precise positioning).
Inputs: content (required), filename, title, author, +3 more. Returns: result
pdf-resumeGenerate Resume PDFB
Generate a professional resume PDF from JSON Resume format. Supports layout customization, date/locale formatting, styling, fonts, and automatic page breaks.
Inputs: resume (required), filename, font, pageSize, +4 more. Returns: result
text-measureMeasure Text DimensionsA
Measure text width and height before rendering.
Returns exact dimensions based on font, font size, and text content. Use this to:
Calculate text width to set proper container sizes
Determine if text will fit in a given space
Plan multi-line layouts by specifying width constraint
Width is measured as single-line natural width. Height accounts for text wrapping when width is specified.
Inputs: items (required), font. Returns: font, measurements
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: pdf-document creates flowing documents, pdf-image generates PNGs from PDFs, pdf-layout handles precise positioning, pdf-resume builds resumes from JSON, and text-measure calculates text dimensions. There is no overlap or ambiguity between these functions.
All tool names follow a consistent hyphenated prefix pattern (pdf- or text-) with descriptive nouns, making them predictable and readable. The naming is uniform across the set without any deviations in style.
With 5 tools, the server is well-scoped for PDF generation and manipulation, covering core needs like document creation, layout, image export, resume generation, and text measurement. Each tool earns its place without being excessive or insufficient.
The tool set covers key PDF operations: creation (pdf-document, pdf-layout, pdf-resume), conversion (pdf-image), and utility (text-measure). Minor gaps exist, such as no explicit tools for editing existing PDFs or merging files, but agents can work around this with the provided tools.
Maintenance
Related MCP Connectors
Cloud PDF generation from HTML, CSS and XSL-FO, with PDF/A and PDF/UA support.
Compliant PDFs (PDF/A-2A + PDF/UA-1) from markdown or a compact DSL - fast, no headless browser.
Generate PDFs and images with APITemplate.io from templates, HTML, Markdown or a URL.
Turn HTML or templates into branded invoice & document PDFs from your agent. One call, no install.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables PDF generation from HTML, text, and Markdown content with customizable formatting options. Provides secure cross-platform PDF creation tools that automatically save to user directories like Downloads, Documents, or Desktop.431 npmMIT
- AlicenseBqualityDmaintenanceEnables PDF generation from URLs or HTML strings through the Yakpdf API, allowing users to convert web content into PDF documents.1MIT
- AlicenseAqualityDmaintenanceGenerate professional PDFs from Claude, Cursor, and other AI tools. Create invoices, contracts, reports, and certificates from templates or inline HTML markup.759 npm1MIT
- AlicenseAqualityBmaintenanceEnterprise-grade PDF engine for AI agents. Pure TypeScript, zero-dependency, sandboxed, and local-first. Exposes 28 tools to generate ISO-compliant PDF/A documents, inspect layouts, extract text, handle digital signatures (PKCS#7), and render high-performance tables (10,000+ rows/s).28391 npm2MIT