pdf-merger-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pdf-merger-mcp-server Merge report.pdf and appendix.pdf into one PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PDF Merger MCP Server
An MCP (Model Context Protocol) server that exposes the PDF Merger App as a set of tools any MCP-compatible LLM client can use to upload, arrange, merge, and download PDFs.
Tools
Tool | Description |
| Upload one or more PDF files from disk to the merger service |
| Remove a file from an upload session |
| Merge uploaded PDFs in a specified order |
| Build a one-time download URL for the merged result |
Related MCP server: context-retrieval
Quick Start
# Install dependencies
npm install
# Build
npm run build
# Run (stdio transport — default)
PDF_MERGER_API_URL=http://localhost:3000 npm start
# Run (HTTP transport for remote access)
TRANSPORT=http PORT=4000 PDF_MERGER_API_URL=http://localhost:3000 npm startEnvironment Variables
Variable | Default | Description |
|
| Base URL of the PDF Merger App API |
|
| Transport mode: |
|
| HTTP server port (only when |
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"pdf-merger": {
"command": "node",
"args": ["/path/to/pdf-merger-mcp-server/dist/index.js"],
"env": {
"PDF_MERGER_API_URL": "https://your-merger-app.vercel.app"
}
}
}
}Typical Workflow
Upload PDFs → returns
session_id+ file IDsRemove unwanted files (optional)
Merge with desired file order → returns one-time download
tokenDownload using the token URL
Architecture
LLM Client ──MCP──▶ pdf-merger-mcp-server ──HTTP──▶ PDF Merger App (Express)
(stdio or HTTP) (Vercel Blob + pdf-lib)Development
npm run dev # Auto-reload via tsx watch
npm run build # Compile TypeScript → dist/
npm run clean # Remove dist/Available Tools
4 toolspdf_merger_get_download_urlGet Download URLARead-onlyIdempotent
Build a one-time download URL for a merged PDF.
The token is returned by pdf_merger_merge. Each token can only be used once; after the first download the link expires and all associated cloud files are cleaned up.
Args:
token (string): One-time download token UUID from the merge response.
Returns (JSON): { "download_url": "https://your-api.example.com/download/" }
Notes:
Opening the URL in a browser triggers a file download of "merged.pdf".
After download, source blobs are automatically deleted from cloud storage.
Inputs: token (required).
pdf_merger_mergeMerge PDFsA
Merge previously uploaded PDFs in a specified order into a single PDF.
Returns a one-time download token. Use pdf_merger_get_download_url to build the download link. The session is consumed after merging — re-upload files to merge again.
Args:
session_id (string): UUID of the upload session.
file_order (string[]): Ordered array of file UUIDs. The first entry becomes the first pages of the merged output. Must contain at least 2 file IDs and at most 30.
Returns (JSON): { "token": "uuid", "page_count": 45, "size_formatted": "2.3 MB", "download_url": "https://..." }
Workflow:
Upload PDFs using pdf_merger_upload_pdfs
(Optional) Remove unwanted files using pdf_merger_remove_file
Merge using this tool with desired file order
Use the returned download_url to download the merged PDF
Error Handling:
Session not found → 404
File order contains unknown IDs → 400
Encrypted/corrupt PDF → 422
Less than 2 files → 400
Inputs: file_order (required), session_id (required).
pdf_merger_remove_fileRemove File from SessionADestructiveIdempotent
Remove a single PDF file from an upload session on the PDF Merger service.
The file is permanently deleted from cloud storage. This operation cannot be undone.
Args:
session_id (string): UUID of the session containing the file.
file_id (string): UUID of the file to remove.
Returns (JSON): { "success": true }
Error Handling:
Session not found → 404 error
File not found in session → 404 error
Inputs: file_id (required), session_id (required).
pdf_merger_upload_pdfsUpload PDFsA
Upload one or more PDF files to the PDF Merger service for later merging.
Each file must be a valid PDF (≤100 MB). Up to 30 files can be uploaded per session. If session_id is provided, files are appended to that existing session; otherwise a new session is created.
Args:
file_paths (string[]): Absolute paths to PDF files on disk.
session_id (string, optional): UUID of existing session to append to.
Returns (JSON): { "session_id": "uuid", "files": [ { "id": "uuid", "name": "doc.pdf", "size": 102400, "sizeFormatted": "100.0 KB" } ] }
Examples:
Upload two files to a new session: file_paths=["/tmp/report.pdf", "/tmp/appendix.pdf"]
Append to existing session: file_paths=["/tmp/extra.pdf"], session_id="550e8400-..."
Error Handling:
File not found on disk → clear message with the missing path
Non-PDF file → 415 error from API
File >100 MB → 413 error from API
30 files in session → 400 error from API
Inputs: file_paths (required), session_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: upload, remove, merge, and get download URL. There is no overlap in functionality, and the descriptions reinforce the boundaries between them.
All tool names follow a consistent prefix+verb_noun pattern (pdf_merger_remove_file, pdf_merger_upload_pdfs, pdf_merger_get_download_url). The single exception, pdf_merger_merge, is still a clear verb and fits the overall style.
Four tools is a well-scoped size for a PDF merging service. Each tool covers a necessary step in the workflow without redundancy or bloat.
The core workflow (upload, remove, merge, download) is covered. However, there is no tool to list the current files in a session, which would be needed if an agent needs to reference file IDs without having just uploaded them. This is a minor but notable gap.
Maintenance
Related MCP Connectors
PDF tools + QR over MCP: merge, split, rotate, text, metadata, malicious-content scan.
Merge PDF files into one document right in the chat.
Convert PDF documents to Markdown for AI agents through an authenticated remote MCP server.
Document processing over MCP: merge, split and compress PDFs, run OCR, extract document text.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to perform 13 PDF operations (merge, split, compress, watermark, encrypt, and more) on local files via MCP.3-
- AlicenseAqualityCmaintenanceEnables AI agents to parse PDFs and search local document context through multimodal extraction and vector-based retrieval, all exposed as MCP tools.7MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible agents to convert PDFs and images into Markdown, JSON, HTML, LaTeX, DOCX, or ZIP by wrapping a document parsing service's REST API as callable tools, including uploads, parsing jobs, progress polling, and result downloads.1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables extracting text and metadata from local PDF files, inspecting page and file information, merging multiple PDFs, and splitting PDFs into single-page documents through MCP tools.74 npmMIT