Skip to main content
Glama

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.

Tools

Functions exposed to the LLM to take actions

NameDescription
pdf-document

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

pdf-image

Generate PNG image(s) from PDF pages.

Use this to visually verify PDF output without opening external applications.

Pages Options:

  • Single page: pages: 1 or pages: 3

  • Multiple 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.

pdf-layout

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

pdf-resume

Generate a professional resume PDF from JSON Resume format. Supports layout customization, date/locale formatting, styling, fonts, and automatic page breaks.

text-measure

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.

Prompts

Interactive templates invoked by user choice

NameDescription
resource-fetchingHow to fetch generated PDF binary data via MCP resources

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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