Use PDFKit from your coding agent
Ask your agent to compress, OCR or convert a PDF by path. Results land beside the original file.
claude mcp add --scope user pdfkit "--" npx -y pdfkit-mcp-serverNeeds Node.js 20.3 or newer. Other clients are below.
Add it to your client
It is a standard stdio server, so any MCP client can start it with npx -y pdfkit-mcp-server. Restart the client after adding it.
Claude Code
Run once, from any folder
Works as-is in PowerShell, Command Prompt, bash and zsh. Keep the quotes around "--": PowerShell drops a bare -- and the command then fails with "unknown option '-y'". --scope user makes the server available in every project; without it, only the folder you ran the command in gets it. To share it with your team through .mcp.json, use --scope project instead. On native Windows, if the server does not connect, wrap npx in cmd /c: claude mcp add --scope user pdfkit "--" cmd /c npx -y pdfkit-mcp-server
claude mcp add --scope user pdfkit "--" npx -y pdfkit-mcp-serverOpenAI Codex CLI
~/.codex/config.toml
Or run: codex mcp add pdfkit "--" npx -y pdfkit-mcp-server (keep the quotes around "--", or PowerShell drops it).
[mcp_servers.pdfkit]
command = "npx"
args = ["-y", "pdfkit-mcp-server"]Cursor
.cursor/mcp.json in your project
{
"mcpServers": {
"pdfkit": {
"command": "npx",
"args": ["-y", "pdfkit-mcp-server"],
"env": {
"PDFKIT_ALLOWED_DIRS": "${workspaceFolder}"
}
}
}
}VS Code (Copilot agent mode)
.vscode/mcp.json in your project
{
"servers": {
"pdfkit": {
"type": "stdio",
"command": "npx",
"args": ["-y", "pdfkit-mcp-server"],
"env": {
"PDFKIT_ALLOWED_DIRS": "${workspaceFolder}"
}
}
}
}Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"pdfkit": {
"command": "npx",
"args": ["-y", "pdfkit-mcp-server"]
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json
Windsurf starts servers outside your project, so name the folder that holds your PDFs.
{
"mcpServers": {
"pdfkit": {
"command": "npx",
"args": ["-y", "pdfkit-mcp-server"],
"env": {
"PDFKIT_ALLOWED_DIRS": "/path/to/your/pdfs"
}
}
}
}Claude Desktop
Settings, Developer, Edit Config (claude_desktop_config.json)
Claude Desktop starts servers from your home folder, which is never allowed by default. Name the folder that holds your PDFs.
{
"mcpServers": {
"pdfkit": {
"command": "npx",
"args": ["-y", "pdfkit-mcp-server"],
"env": {
"PDFKIT_ALLOWED_DIRS": "/path/to/your/pdfs"
}
}
}
}What your agent gets
The same 12 tools as the website, plus two helpers. Each tool description tells the agent whether a file is uploaded, so you can approve those calls separately.
On your machine
pdfkit_infoPage count, metadata, and whether the PDF is a scan
pdfkit_mergeCombine PDFs in the order given. Merge PDF
pdfkit_splitSplit by ranges or every N pages, or extract pages. Split PDF
pdfkit_rotateTurn all pages, or only some. Rotate PDF
pdfkit_organizeReorder, delete, duplicate, rotate pages, insert blanks. Organize PDF
pdfkit_add_page_numbersStamp numbers with a template like Page {n} of {N}. Page numbers
pdfkit_pdf_to_jpgRender pages as JPG images. PDF to JPG
Uploaded, processed, deleted
pdfkit_compressShrink PDFs with Ghostscript at three strengths. Compress PDF
pdfkit_ocrAdd a searchable text layer to scans, 14 languages. OCR PDF
pdfkit_pdf_to_markdownConvert to Markdown, with OCR for scanned pages. PDF to Markdown
pdfkit_pdf_to_wordConvert to an editable .docx. PDF to Word
pdfkit_protectEncrypt with a password (AES-256). Protect PDF
pdfkit_unlockRemove a password or restrictions. Unlock PDF
pdfkit_extract_imagesPull embedded pictures out as JPGs. PDF to JPG
pdfkit_list_ocr_languagesThe OCR languages the server has installed
Ask in plain words
- Compress every PDF in ./invoices and tell me how much space it saved.
- Read docs/spec.pdf and summarise the security requirements.
- This scan is in German and English. OCR it so I can search it.
- Split report.pdf into pages 1-4, 5-12 and 13 to the end.
- Add Page {n} of {N} at the bottom right of thesis.pdf.
- Merge cover.pdf with chapters/*.pdf, then password-protect the result.
How it keeps your files safe
The details behind the server-side half are in the privacy policy. The package is open source on GitHub.
Half the tools never upload
7 tools run inside the server process on your machine, the same split the website makes between browser and server.
Uploads are deleted in the same request
The other tools send the file over HTTPS to the PDFKit API, which deletes it as the response is sent. Only the file name travels, never its folder path.
Confined to your project
Tools can only read and write inside the folder your agent started in, plus any you add. Symlinks are resolved first, so a link cannot point them elsewhere.
Only PDFs are read
Every input must start with a PDF header. A prompt hidden in a document cannot talk your agent into uploading a .env file or an SSH key.
Nothing is overwritten
Results get new names beside the input, such as report-compressed.pdf. Replacing a file needs overwrite set, and even then a symlink is refused.
No account, no API key
The server asks the website for the same two-minute token a browser gets, and the same per-IP limits apply. There is no key to leak.
Settings
All optional. Set them in the env block of your client's configuration.
- PDFKIT_ALLOWED_DIRS
- Extra folders the tools may read and write, separated by ; on Windows and : elsewhere. Your home folder and the drive root are never allowed unless you list them here. Default: the folder the agent started in.
- PDFKIT_MAX_LOCAL_MB
- Largest file the local tools will open. Default: 200.
- PDFKIT_TIMEOUT_SECONDS
- Longest a server-side call may take, upload and download included. Default: 1800.
- PDFKIT_API_URL
- Only for a self-hosted PDFKit. Must be https, except on localhost. Default: https://api.pdfkit.zeeshanai.cloud.
- PDFKIT_SITE_URL
- Only for a self-hosted PDFKit: where access tokens are issued. Default: https://pdfkit.zeeshanai.cloud.
Limits and troubleshooting
Server-side tools take up to 10 files per call, 50 MB each and 150 MB together, with a per-IP limit of about 20 jobs a minute. Local tools have no limit beyond the file size setting.
"Outside the folders this server may access" means the PDF is not in your project. Move it there, or add its folder to PDFKIT_ALLOWED_DIRS.
The server will not start on Windows. Use cmd as the command and /c npx -y pdfkit-mcp-server as its arguments.
A password-protected PDF works with Compress, OCR and the converters only after pdfkit_unlock. Your agent will ask you for the password; it is used for that one request and never appears in a tool result.
Releases are published to npm as pdfkit-mcp-server. To pin a version, write it after the name, for example pdfkit-mcp-server@0.1.0.