To merge documents with an AI agent, let the agent call a merge engine; do not ask the LLM to read the files and write the combined one. The GroupDocs.Merger.Mcp server gives clients such as Claude Desktop, Claude Code and Cursor a merge tool that combines the files locally, on your machine, and leaves the originals untouched:

Combine part-one.pdf, part-two.pdf and appendix.pdf into one document, appendix last.

The step-by-step version with config and troubleshooting is in the documentation: How to merge documents with AI agents using MCP.

What goes wrong when an LLM regenerates a document?

Without a merge tool, a model typically works from the extracted text of each file and writes new content. What you get back is a new document that resembles the inputs. Layout, styles, tables and embedded objects are not guaranteed to survive regeneration, and nothing in the process checks the output against the originals, so dropped or reworded content can go unnoticed.

None of this is specific to one model. It follows from the method: regeneration is a rewrite, and a rewrite is not a merge.

What does a merge engine do differently?

The engine opens each source in its own format and combines the documents. The GroupDocs.Merger troubleshooting page states the result: the engine merges documents in their own format, preserving layout, styles and structure; it is not a print-to-PDF concatenation. Fonts and styles that differ between sources stay different in the result.

The model’s job shrinks to what it is good at: understanding your request, choosing the files, deciding the order, and checking the outcome. The engine does the document-level work.

Which MCP server merges PDF files?

The merge tool of GroupDocs.Merger.Mcp is described to the agent as “Merges 2–4 documents into a single file and saves the result to storage.” It supports PDF, DOCX, XLSX, PPTX and 30+ more document, image and archive formats. The input is file1 and file2, with optional file3 and file4. The result is saved in your output folder, and the sources are not modified.

Four tools make up the whole server:

Tool What it does
merge Combines two to four documents into one
split Extracts the pages you name, each as its own document
get_document_info Returns file type, page count, size and per-page dimensions
get_license_status Reports the licensing mode: evaluation, licensed or metered

How do you merge PDFs with Claude locally?

Run the server with Docker or, with the .NET 10 SDK installed, with dnx:

dnx GroupDocs.Merger.Mcp --yes

Set GROUPDOCS_MCP_STORAGE_PATH to the folder that holds your documents and register the server in your client. The documentation lists the configuration for Claude Desktop, Claude Code, VS Code with GitHub Copilot, Cursor, Windsurf and more. Over MCP’s stdio transport, the client starts the server as a child process. The data path is agent, local server, local filesystem; no document is uploaded to a merge website.

What are the rules of the merge tool?

Rule What it means in practice
Order is slot order file1 comes first and file4 last. Say “appendix last” in the prompt.
Two to four files per call For nine PDFs, ask the agent to merge four at a time and chain each result into the next call.
One format family All PDFs, or all DOCX. A mixed set has no defined merge result.
Mixed formats Convert first with GroupDocs.Conversion.Mcp, then merge the matching set.

Example session (abridged)

An illustration based on the documented tool behavior, not a captured screenshot.

You:   Combine part-one.pdf, part-two.pdf and appendix.pdf into one
       document, appendix last.

Agent: [calls merge with file1 = part-one.pdf, file2 = part-two.pdf,
        file3 = appendix.pdf]
       Merged the three PDFs in that order. The combined file is in
       your output folder and the three sources are unchanged.
       Want me to check the page count of the result?

Honest limits

  • Evaluation mode trims the result silently. Without a license, the result is trimmed to the first 3 pages, with a trial badge on each page. A merge of four ten-page PDFs comes back as three pages and looks like it worked. Ask “What is the license status of the merger server?” so the agent calls get_license_status before a real run.
  • No mixed-format merge in one call. A PDF and a Word file need a conversion step first.
  • Not an editor. The server combines and extracts whole pages. It does not edit content inside a page.
  • Page counts are yours to check. Ask for the page count of the result with get_document_info and compare it with the sum of the parts.

FAQ

Can Claude merge PDFs without uploading them? Yes, with a local MCP server. The server runs on your machine and reads and writes local folders, so the documents themselves are not uploaded. Your prompts and the agent’s replies still go to whichever model provider your client uses.

Why not let the LLM combine the files itself? A model that regenerates a document produces new content, and layout and styles are not guaranteed to match. An engine combines the original documents in their own format.

Why is my merged file only three pages? The server is running in evaluation mode, which trims the result to the first 3 pages. Apply a license file or metered keys and run the merge again.

Go deeper