A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with the PDFMonkey API for generating PDFs from templates.
- Template Management: List and inspect PDF templates with detailed information (HTML, CSS, properties)
- Document Generation: Create PDFs with async generation and automatic polling
- Document Management: List, check status, and delete generated documents
- Snippet Support: Access reusable Liquid code snippets
- Workspace Info: View workspace details
- User & Quota Management: Check account quota, plan information, and user details
# Build locally (a published Docker Hub image is not available yet)
docker build -t pdfmonkey-mcp-server:latest .Configure in Claude Desktop:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"pdfmonkey": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PDFMONKEY_API_KEY=your-api-key-here",
"pdfmonkey-mcp-server:latest"
]
}
}
}See DOCKER-MCP-TOOLKIT.md for Docker MCP Toolkit integration.
npm install -g pdfmonkey-mcp-server{
"mcpServers": {
"pdfmonkey": {
"command": "pdfmonkey-mcp-server",
"env": {
"PDFMONKEY_API_KEY": "your-api-key-here"
}
}
}
}git clone https://github.com/pdfmonkey/pdfmonkey-mcp
cd pdfmonkey-mcp
npm install
npm run build{
"mcpServers": {
"pdfmonkey": {
"command": "node",
"args": ["/absolute/path/to/pdfmonkey-mcp-server/dist/index.js"],
"env": {
"PDFMONKEY_API_KEY": "your-api-key-here"
}
}
}
}- Sign up at dashboard.pdfmonkey.io/register
- Get your API key from the dashboard
list_workspaces- List all accessible workspaces
list_templates- List all PDF templatesget_template- Get template details with full HTML, CSS, and properties
generate_document- Generate PDF with async polling (1.5s intervals, 3min timeout)get_document_status- Check document status and get download URLlist_documents- List documents with filters (status, template_id, page, updated_since)delete_document- Delete document permanently
list_snippets- List all Liquid code snippetsget_snippet- Get snippet code
get_quota- Get quota and plan informationget_user_info- Get complete account details
User: Generate a PDF invoice using my invoice template
Claude: I'll help you generate an invoice. First, let me list your templates.
[Uses list_templates tool]
I found your invoice template (ID: abc-123). Now I'll generate the PDF.
[Uses generate_document tool with data]
Your invoice has been generated! Download: https://...
User: Show me the HTML and CSS for template abc-123
Claude: [Uses get_template tool]
Here's the complete template:
### π HTML Template
[Shows full HTML code]
### π¨ CSS Styles
[Shows full CSS code]
### π Sample Data
[Shows JSON properties]
User: What's my current quota?
Claude: [Uses get_quota tool]
You have 450 documents available on your Professional plan (monthly).
Share links are enabled.
npm run buildnpm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage reportCurrent test coverage: 80/80 tests passing (~89% overall statements/lines; tools.ts dispatch 100%)
npm run watchexport PDFMONKEY_API_KEY="your-api-key"
npm start# Build
docker build -t pdfmonkey-mcp-server:latest .
# Test with real API
docker run -it --rm \
-e PDFMONKEY_API_KEY="your-key" \
pdfmonkey-mcp-server:latest
# In another terminal, send test JSON-RPC
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | \
docker run -i --rm -e PDFMONKEY_API_KEY="your-key" pdfmonkey-mcp-server:latest- Docker Hub account
- Image tested and validated
- All tests passing
# 1. Tag image
docker tag pdfmonkey-mcp-server:latest yourusername/pdfmonkey-mcp-server:1.0.0
docker tag pdfmonkey-mcp-server:latest yourusername/pdfmonkey-mcp-server:latest
# 2. Login to Docker Hub
docker login
# 3. Push images
docker push yourusername/pdfmonkey-mcp-server:1.0.0
docker push yourusername/pdfmonkey-mcp-server:latestSupport Mac M1/M2 (ARM64) and Intel (AMD64):
# Create builder
docker buildx create --use --name mcp-builder
# Build and push multi-arch
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t yourusername/pdfmonkey-mcp-server:1.0.0 \
-t yourusername/pdfmonkey-mcp-server:latest \
--push \
.Create .github/workflows/docker-publish.yml:
name: Docker Build and Publish
on:
release:
types: [created]
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install and test
run: |
npm ci
npm test
npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
yourusername/pdfmonkey-mcp-server:latest
yourusername/pdfmonkey-mcp-server:${{ github.ref_name }}- Base: Node 18 Alpine
- Size: ~236MB
- User: Non-root (nodejs:1001)
- Security: Read-only filesystem, no hardcoded secrets
- Architecture: Multi-arch (AMD64, ARM64)
- Async Generation:
generate_documentpolls every 1.5 seconds for up to 3 minutes - Download URLs: Expire after 1 hour
- Share Links: Permanent URLs for premium users
- Rate Limiting: 60 requests/minute
Full API documentation: docs.pdfmonkey.io
Verify your configuration file includes the API key.
Get a new key from dashboard.pdfmonkey.io.
Generation took >3 minutes. Use get_document_status with the document ID to check later.
Ensure you're using -i (interactive) flag:
docker run -i --rm -e PDFMONKEY_API_KEY="key" pdfmonkey-mcp-server:latestdocker logs <container-id>Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass (
npm test) - Submit a pull request
The project has comprehensive test coverage:
- Unit tests: 80 tests covering the formatters, API client, and tool/prompt dispatch
- Coverage: ~89% overall statements/lines (
tools.tsdispatch at 100%) - Mock testing: Full fetch API mocking
- Async testing: Polling and timeout scenarios
Run tests:
npm test # All tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage reportpdfmonkey-mcp-server/
βββ src/
β βββ index.ts # MCP server bootstrap (env, client, stdio)
β βββ tools.ts # Tool/prompt definitions + dispatch
β βββ pdfmonkey-client.ts # PDFMonkey API client
β βββ formatters.ts # Output formatters
βββ tests/
β βββ unit/
β βββ formatters.test.ts # Formatter tests (21)
β βββ pdfmonkey-client.test.ts # Client tests (25)
β βββ tools.test.ts # Tool dispatch tests (34)
βββ server.json # MCP registry manifest
βββ Dockerfile # Multi-stage build
βββ package.json
βββ tsconfig.json
βββ jest.config.js
MIT License - see LICENSE file
- PDFMonkey Website
- PDFMonkey Documentation
- PDFMonkey Dashboard
- Model Context Protocol
- Docker MCP Toolkit
- MCP Server Issues: Open an issue on GitHub
- PDFMonkey API Issues: PDFMonkey Support
- Docker MCP Toolkit: Docker Forums