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.
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
| Variable | Description | Default |
|---|---|---|
PDFGENSTUDIO_API_KEY | Your PDF Gen Studio API key | Required |
PDFGENSTUDIO_BASE_URL | API base URL | https://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
| Tool | Description |
|---|---|
render_template | Render a template to PDF/PNG/JPG with data injection |
render_template_image | Render template and return viewable image |
JSON Tools
| Tool | Description |
|---|---|
render_json | Convert JSON design document to PDF/image |
render_json_image | Render JSON and return viewable image |
HTML Tools
| Tool | Description |
|---|---|
render_html | Convert HTML/CSS to PDF/image |
render_html_image | Render HTML and return viewable image |
URL Tools
| Tool | Description |
|---|---|
render_url | Screenshot webpage as PDF/image |
render_url_image | Screenshot and return viewable image |
Management Tools
| Tool | Description |
|---|---|
list_templates | List all saved templates |
get_template | Get template details |
get_template_schema | Get modifiable template elements |
Resources
The MCP server provides these resources:
| URI | Description |
|---|---|
pdfgenstudio://templates | List of all templates |
pdfgenstudio://templates/{id} | Specific template details |
pdfgenstudio://docs/api | API documentation |
pdfgenstudio://config | Current configuration status |
Pre-built Prompts
| Prompt | Description |
|---|---|
generate-invoice | Generate invoice PDFs |
generate-report | Create report documents |
capture-webpage | Screenshot webpages |
use-template | Render templates with data |
html-to-pdf | Convert HTML to PDF |