How to compare documents with AI agents using MCP
Leave feedback
On this page
Comparing documents with an AI agent works because the two halves do what each is good at: the agent understands “check whether the payment terms moved”, and the engine does the actual format-aware comparison locally. The agent never guesses at differences from reading text — it calls a tool and reports what the engine found.
Note
The commands and config snippets on this page are for the .NET build of the server — the only platform available today. Installation and client setup: MCP server for .NET. Other platforms will expose the same tools with their own launch command; everything else on this page applies unchanged.
The pattern
You put both versions in the storage folder the server can see.
You ask in plain language: “What changed between contract-v1.docx and contract-v2.docx?”
The agent calls analyze_changes — or compare if you asked for a file — with the two names.
The engine compares them on your machine and returns the change list as JSON.
The agent summarizes it, quotes the fragments that matter, and answers follow-up questions from the same data.
Which tool answers which question
Your prompt
Tool
What comes back
“What changed?”
analyze_changes
Change list as data; no file written
“Summarize the differences”
analyze_changes
Same data, summarized in chat
“Give me a marked-up copy”
compare
Rendered result document and the change list
“How many pages is this?”
get_document_info
Type, pages, size — no comparison
The rule of thumb: ask for an answer, get analyze_changes; ask for a document, get compare. Rendering is the expensive part, and analyze_changes skips it.
What the engine actually detects
Each change in the returned array carries its type (inserted, deleted, style change), the component and page it belongs to, the changed fragment itself, the surrounding source and target text, and — when the change is inside a table — the specific cell. Style changes count: if a clause went from regular to bold, that is a change, not noise.
That structure is why an agent can answer “did anything change in section 7?” without re-reading the documents: it filters the array it already has.
Setup
Any MCP client works. The shortest path:
dnx GroupDocs.Comparison.Mcp --yes
with GROUPDOCS_MCP_STORAGE_PATH pointing at the folder holding both versions — see Register in AI clients for the exact per-client block, or run the installer and let it write the config.
Try it
Drop two versions of any document into your storage folder and ask:
Compare contract-v1.docx with contract-v2.docx. Summarize what changed, then give me a marked-up copy.
A capable agent will make two calls — analyze_changes for the summary, compare for the file — and hand you both in one turn.