Skip to main content
Glama

MCP PDF

by mcp-z

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PDF_OUTPUT_DIRNoCustom directory for PDF output files. Defaults to ~/.mcp-pdf/ if not specified.

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
create-pdf

Create a PDF document with text, images, shapes, and full layout control. Supports progressive enhancement from simple documents to complex designs.

Key Features: • Unicode support: Chinese, Japanese, Korean, Arabic, emoji - auto-detects system fonts • Page setup (custom size, margins, background color) • Text with colors, fonts, positioning, and styling (oblique, spacing, etc.) • Shapes (rectangles, circles, lines) for visual design • Emoji rendering with inline image support

Common Patterns:

  1. Simple Document (no pageSetup needed): [{"type": "heading", "text": "Title"}, {"type": "text", "text": "Body"}]

  2. Styled Document (add colors/background): pageSetup: {"backgroundColor": "#F5F5F5"} content: [{"type": "heading", "text": "Title", "color": "#4A90E2"}]

  3. Custom Layout (letterhead, certificates): [{"type": "rect", "x": 0, "y": 0, "width": 612, "height": 80, "fillColor": "navy"}, {"type": "heading", "text": "Company", "color": "white", "y": 25, "align": "center"}]

  4. Algorithmic Design (tapering fonts, progressive layouts): Calculate values in a loop, then pass to tool: for (let i = 0; i < lines.length; i++) { const progress = i / lines.length; const fontSize = 8 + (progress * 16); // 8pt → 24pt content.push({"type": "text", "text": lines[i], "fontSize": fontSize}); }

Coordinate System: • Origin (0, 0) is top-left corner • Letter size page: 612 x 792 points (8.5" x 11") • 72 points = 1 inch

Tips: • Use "align": "center" for centered text (works with or without "width") • Use "x" to manually position (calculate as: (pageWidth - textWidth) / 2 for centering) • Colors: hex ("#FFD700") or named ("gold", "navy", "black") • Oblique: true for default slant, or number for degrees (15 = italic look) • All pageSetup and visual styling fields are optional - defaults match standard documents

create-simple-pdf

Create a simple PDF with just text content. A simplified version of create-pdf for basic use cases. Supports emoji rendering.

generate-resume-pdf

Generate a professional resume PDF from JSON Resume format. Follows the standard JSON Resume schema (https://jsonresume.org/schema). Supports basics, work, education, projects, skills, awards, certificates, languages, and more. Includes customizable styling options.

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcp-z/mcp-pdf'

If you have feedback or need assistance with the MCP directory API, please join our Discord server