You can compare two versions of a document with an AI agent and get a short answer, a marked-up file, or both, while the files stay on your machine. Install the GroupDocs.Comparison.Mcp server, put both versions in one folder, and ask Claude Desktop, Claude Code, Cursor or GitHub Copilot locally:

Compare contract-v1.docx with contract-v2.docx. Summarize what changed, then give me a marked-up copy.

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

Why shouldn’t an AI agent compare documents by reading them?

A language model that “compares” two documents by reading their text produces a description of differences, not a measurement of them. It can report a change that is not there and skip one that is. The MCP server moves that job to a comparison engine. The agent still does what it is good at: understanding your question and explaining the result. The engine does the format-aware comparison and returns each change as data: its type, page, component, the changed fragment, the surrounding text, and the table cell when the change is inside a table. Style changes, such as a clause that went from regular to bold, are reported as changes.

Which of the three ways below you use depends on one question: do you want an answer or a document?

Way 1: Ask for an answer and get analyze_changes

When the question starts with “what”, “did” or “how many”, the agent calls analyze_changes. The tool returns the differences as structured data and writes no file.

What changed between proposal-draft.docx and proposal-final.docx? Keep it short.

The response begins with <N> change(s) detected (or No changes detected) followed by a JSON array. The agent filters and summarizes that array, so follow-ups such as “only the deletions” or “did any number change?” do not touch the files again. Use this way by default: it skips rendering, so it is faster and cheaper than the alternative.

Way 2: Ask for a document and get compare

When the request is “give me a file”, the agent calls compare. The tool renders a marked-up result document and saves it to your output folder as <source-stem>_compared<ext>, for example contract-v1_compared.docx. An existing file is never overwritten; a new name is used instead.

Give me a marked-up copy of contract-v1.docx and contract-v2.docx that I can send to legal.

Your reviewers open the result in Word or any other viewer. They need no MCP client and no AI tool. The same change list is returned to the agent, so you can still ask questions about it.

Way 3: Ask for both and let the agent chain the calls

A capable agent makes two calls from one prompt: analyze_changes for the summary and compare for the file. This is the prompt from the start of this post. Use it when you want to read a short summary now and hand a file to someone else afterwards.

Before comparing, you can also ask the agent to inspect a file:

How many pages is contract-v2.docx?

That triggers get_document_info, which returns file type, page count, size and per-page dimensions without comparing anything.

How do you set it up?

Run dnx GroupDocs.Comparison.Mcp --yes (with the .NET 10 SDK) or the Docker image ghcr.io/groupdocs-comparison/comparison-net-mcp, register the server in your client, and set GROUPDOCS_MCP_STORAGE_PATH to the folder that holds both versions.

What does it look like in a client?

Example session (abridged and illustrative; the real wording depends on your client and model):

You:    Compare contract-v1.docx with contract-v2.docx. Summarize
        what changed, then give me a marked-up copy.

Agent:  [calls analyze_changes: contract-v1.docx, contract-v2.docx]
        [calls compare: contract-v1.docx, contract-v2.docx]

        The engine detected changes, including the payment schedule
        in a table on page 4 and a clause that changed from regular
        to bold. The marked-up copy is saved as
        contract-v1_compared.docx in your output folder.

What are the limits?

  • Evaluation cap. Without a license the server runs in evaluation mode: only the first 2 pages are compared, and the result carries a watermark. On a long document that gives a short, reassuring change list. Ask “what is the license status of the comparison server?” first; the agent calls get_license_status, and "mode": "evaluation" means the cap applies.
  • Same format on both sides. Compare like with like; convert first if the two files differ in format.

FAQ

Can Claude compare two PDFs without uploading them? Yes, with the MCP server the comparison runs in a local process against files in a folder you choose. Your prompt and any fragments the agent quotes back still go to the model your client uses.

What is the difference between analyze_changes and compare? Both detect the same changes. analyze_changes returns them as data and writes no file; compare also renders a marked-up document.

Does it only work with Word files? No. The tools accept PDF, DOCX, XLSX, PPTX, ODT, RTF, TXT, HTML and more than 30 other formats.

Go deeper