Skip to main content

MCP Server Overview

PDF Gen Studio provides a Model Context Protocol (MCP) server that enables AI assistants and LLM-powered tools to generate PDFs and images directly.

npm version License: MIT

What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI models to interact with external tools and data sources. PDF Gen Studio's MCP server allows AI assistants like Claude, GitHub Copilot, and others to generate documents on your behalf.

Features

  • 📄 Template Rendering - Render saved templates with dynamic data injection
  • 🔧 JSON Rendering - Convert JSON design documents to PDF/images
  • 🌐 HTML Rendering - Convert HTML/CSS content to PDF/images
  • 📸 URL Rendering - Screenshot any website URL as PDF/images
  • 📋 Template Management - List and retrieve your saved templates

Installation

Using npm (Global)

npm install -g @pdfgenstudio/mcp

Using npx (No Install)

npx @pdfgenstudio/mcp

From Source

git clone https://github.com/Majid9287/pdfgenstudio-mcp.git
cd pdfgenstudio-mcp
npm install
npm run build

Using Docker

docker pull mcp/pdfgenstudio:latest

Or build locally:

docker build -t mcp/pdfgenstudio .

Configuration

Environment Variables

Set your PDF Gen Studio API key:

Linux/macOS:

export PDFGENSTUDIO_API_KEY="your-api-key-here"

Windows (PowerShell):

$env:PDFGENSTUDIO_API_KEY = "your-api-key-here"

Windows (Command Prompt):

set PDFGENSTUDIO_API_KEY=your-api-key-here

Configuration Options

VariableDescriptionDefault
PDFGENSTUDIO_API_KEYYour PDF Gen Studio API keyRequired
PDFGENSTUDIO_BASE_URLAPI base URLhttps://api.pdfgenstudio.com

Usage Modes

As stdio Server (Default)

# Using global install
pdfgenstudio-mcp

# Using npx
npx @pdfgenstudio/mcp

# With explicit transport
pdfgenstudio-mcp --transport stdio

As HTTP Server

# Start HTTP server on port 3100
pdfgenstudio-mcp --transport http --port 3100

# Or with custom port
pdfgenstudio-mcp -t http -p 8080

Available Tools

Template Tools

ToolDescription
render_templateRender a template to PDF/PNG/JPG with data injection
render_template_imageRender template and return viewable image

JSON Tools

ToolDescription
render_jsonConvert JSON design document to PDF/image
render_json_imageRender JSON and return viewable image

HTML Tools

ToolDescription
render_htmlConvert HTML/CSS to PDF/image
render_html_imageRender HTML and return viewable image

URL Tools

ToolDescription
render_urlScreenshot webpage as PDF/image
render_url_imageScreenshot and return viewable image

Management Tools

ToolDescription
list_templatesList all saved templates
get_templateGet template details
get_template_schemaGet modifiable template elements

Resources

The MCP server provides these resources:

URIDescription
pdfgenstudio://templatesList of all templates
pdfgenstudio://templates/{id}Specific template details
pdfgenstudio://docs/apiAPI documentation
pdfgenstudio://configCurrent configuration status

Pre-built Prompts

PromptDescription
generate-invoiceGenerate invoice PDFs
generate-reportCreate report documents
capture-webpageScreenshot webpages
use-templateRender templates with data
html-to-pdfConvert HTML to PDF

Next Steps