MCP Integration
Connect pdfstork to your AI assistant using the Model Context Protocol (MCP).
Overview
pdfstork exposes an MCP (Model Context Protocol) server that allows AI assistants like Claude, Cursor, or Windsurf to generate PDFs from your templates through natural language.
Prerequisites
- A pdfstork account with at least one template
- An API token (go to Settings → API Tokens to create one)
- An MCP-compatible AI client
Server endpoint
https://pdfstork.com/mcp/pdfAuthentication uses a Bearer token in the Authorization header.
Configuration
Claude Code (CLI)
Add the server with one command:
claude mcp add --transport http pdfstork https://pdfstork.com/mcp/pdf \
--header "Authorization: Bearer YOUR_API_TOKEN"Add --scope user to make it available in all your projects. You can also declare it in the project's .mcp.json, at the repository root:
{
"mcpServers": {
"pdfstork": {
"type": "http",
"url": "https://pdfstork.com/mcp/pdf",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Claude Desktop
Claude Desktop's configuration file starts local servers only. Connect to pdfstork through the mcp-remote bridge, which runs locally and forwards to the HTTP endpoint (Node.js required). Edit your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"pdfstork": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://pdfstork.com/mcp/pdf",
"--header",
"Authorization: Bearer YOUR_API_TOKEN"
]
}
}
}Restart Claude Desktop after saving the file.
Cursor
Add the server to ~/.cursor/mcp.json for all projects, or to .cursor/mcp.json in a project:
{
"mcpServers": {
"pdfstork": {
"url": "https://pdfstork.com/mcp/pdf",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Windsurf
Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pdfstork": {
"serverUrl": "https://pdfstork.com/mcp/pdf",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Codex (OpenAI CLI)
Add a section to ~/.codex/config.toml:
[mcp_servers.pdfstork]
url = "https://pdfstork.com/mcp/pdf"
http_headers = { Authorization = "Bearer YOUR_API_TOKEN" }opencode
Add the server to opencode.json at the project root, or globally in ~/.config/opencode/opencode.json:
{
"mcp": {
"pdfstork": {
"type": "remote",
"url": "https://pdfstork.com/mcp/pdf",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Available tools
The MCP server provides four tools:
| Tool | Description |
|---|---|
list-templates | List the templates of the token's team (IDs, names, types) |
get-template-details | Get the variables of a template's published version, with sample data |
generate-pdf | Generate a PDF from a template with provided data |
get-usage | Check your quota and usage statistics |
Recommended workflow
- List templates: call
list-templatesto see your available templates - Inspect a template: call
get-template-detailswith the template ID to understand its variables - Generate a PDF: call
generate-pdfwith the template ID and required data - Check usage: call
get-usageto monitor your quota
Tool reference
list-templates
No parameters required. Returns an array of templates with id, name and type.
get-template-details
| Parameter | Type | Required | Description |
|---|---|---|---|
template_id | integer | Yes | The template ID to inspect. A numeric string such as "9" is also accepted |
Describes the published version of the template, the one the API renders. Returns id, name, type, variables, sample_data and a hint for the assistant. Each variable has a name, a type, an optional example and, for an array, the item_fields of its rows.
generate-pdf
| Parameter | Type | Required | Description |
|---|---|---|---|
template_id | integer | Yes | The template ID, as returned by list-templates. A numeric string such as "9" is also accepted |
data | object | No | Key-value pairs for template variables |
url_expiry | integer | No | How long the download link stays valid, in minutes (1 to 1440, default 60) |
metadata | object | No | Document properties (title, author, subject, keywords, creator), Basic plan and above |
Returns url, a temporary download link to the PDF, with expires_at and size. The render costs one credit, like any API call.
get-usage
No parameters required. Returns:
current_month_usage: PDFs generated this monthquota_limit: your plan's monthly limitquota_percentage: usage as a percentage of the quota, rounded to one decimalpack_credits: prepaid credits lefthas_quota_remaining: whether you can still generate PDFs, counting prepaid creditsplan: your current plan (discovery,basicorpro)
get-template-details before generating a PDF to understand the expected data structure. This helps AI assistants produce accurate results on the first try.