Your supplier was acquired, and “ACME Corp” is now “Globex Ltd” in every contract, schedule, budget and slide deck that mentions it. With the GroupDocs.Editor MCP server running locally, Claude Desktop, Cursor or Copilot does it as a batch: for each file in the folder it calls replace_text, keeps the formatting, reports how many occurrences it changed, and writes nothing for the files that never mentioned the old name. Nothing is uploaded, and no original is overwritten:
Rename ACME Corp to Globex Ltd in every document in the contracts folder, keep the formatting, and give me a count per file.
The step-by-step version is in the documentation: How to find and replace text across a folder of documents without breaking the formatting.
Why is this a job for a tool and not for the model?
Because the result has to be checkable. Forty documents is too many to diff by eye, and a model that “updated all the contracts” gives you nothing to check against. A find-and-replace tool gives you a number per file. The numbers are the audit trail: you know which files changed, by how much, and which ones did not need to.
It also has to be boring in the right way. The bold party name stays bold, the fee table keeps its grid, the footer keeps its page numbers. The tool changes characters inside the existing formatting; it does not rebuild the document.
What the agent sees
Captured from GroupDocs.Editor.Mcp 26.10.0 against a small synthetic set: a services agreement, an NDA, a welcome letter, a three-sheet budget and a three-slide review deck.
-> replace_text {"file":{"filePath":"contracts/msa-northwind.docx"},
"find":"ACME Corp","replace":"Globex Ltd","wholeWord":true}
<- Replaced 6 occurrence(s) of 'ACME Corp' in 'msa-northwind.docx'
Saved to: …/msa-northwind_edited.docx
-> replace_text {"file":{"filePath":"contracts/nda-northwind.docx"}, ...}
<- Replaced 1 occurrence(s) of 'ACME Corp' in 'nda-northwind.docx'
-> replace_text {"file":{"filePath":"contracts/welcome-letter.docx"}, ...}
<- Text replacement found no matches for 'ACME Corp' in
'welcome-letter.docx'. No file was written.
-> replace_text {"file":{"filePath":"budget.xlsx"}, ..., "worksheet":1}
<- Replaced 1 occurrence(s) of 'ACME Corp' in worksheet 1 of 3 of
'budget.xlsx'
-> replace_text {"file":{"filePath":"review.pptx"}, ..., "slide":1}
<- Replaced 1 occurrence(s) of 'ACME Corp' in slide 1 of 3 of
'review.pptx'
The agent’s report writes itself: six in the agreement, one in the NDA, none in the welcome letter, one on the budget summary, one on the first slide.
The loop
contracts/ + budget.xlsx + review.pptx
|
+-- for each file:
| replace_text {"find":"ACME Corp","replace":"Globex Ltd",
| "wholeWord":true} (+ "worksheet"/"slide")
| -> "Replaced N occurrence(s) ..." -> <name>_edited.<ext>
| -> "found no matches ... No file was written."
|
'-- report: file -> count; files with 0 listed separately
Two habits make the loop reliable. Use wholeWord: true for names, so “ACME Corp” does not match inside “ACME Corporation Holdings”. And ask the agent to list the files with zero matches, because a zero in a file you expected to change is the one thing worth a second look.
Checking the batch before you replace anything
The edited copies sit next to the originals until you decide otherwise, and that is the moment to check. Three cheap checks catch nearly every problem. Compare the per-file counts with what you expected: an agreement that names the supplier on every page should not report one occurrence. Run the same replacement once more on the edited copies: “found no matches … No file was written.” is the all-clear, and any other answer points straight at what the first pass missed, such as a phrase split across formatting. Variant spellings (“Acme Corp.” with a full stop, “ACME Corporation”) deserve their own pass with matchCase: false or a regular expression. And open one edited file of each type, a contract, a workbook and a deck, to confirm the formatting survived. Only then move the _edited files over the originals, or let your document system version them.
Patterns, case and format in the same call
The rename is the common case, but the same tool covers the rest of the “make the wording consistent” family. In the same test run:
-> replace_text {"file":{"filePath":"contracts/nda-northwind.docx"},
"find":"v2\\.3\\b","replace":"v2.4","regex":true,
"outputName":"nda-northwind-v2.4.docx"}
<- Replaced 1 occurrence(s) of 'v2\.3\b' in 'nda-northwind.docx'
-> replace_text {"file":{"filePath":"contracts/nda-northwind.docx"},
"find":"acme corp","replace":"Globex Ltd","matchCase":false,
"format":"pdf"}
<- Replaced 1 occurrence(s) of 'acme corp' in 'nda-northwind.docx'
Saved to: …/nda-northwind_edited.pdf
regex: true takes a .NET regular expression, which is how a version bump or a date format change goes through a folder. matchCase: false catches inconsistent capitalisation. format: "pdf" edits and converts in one step, for the copy that goes to the other side.
An aside for coding agents
The same pattern works in a repository. Release notes in DOCX and specs in XLSX are invisible to sed; Claude Code with this server can bump the version string in both as part of the release task. Put the rule in the project instructions so the agent uses the tool instead of trying to unzip Office files:
To change wording in .docx/.xlsx/.pptx/.pdf files in this repo, use the
groupdocs-editor MCP server's replace_text (wholeWord for names, regex for
versions). Report the count per file. Never rewrite an Office file by hand.
Honest limits
- Matching happens within one formatting run. In our agreement, a seventh “ACME Corp”, with “ACME” in italics, was not replaced, and the count of six showed it. Phrases split across styles need the HTML round-trip.
- Every result lands in the root of the storage folder as
<name>_edited.<ext>, even when the original sat in a subfolder. GiveoutputNamewhen names could collide. - Spreadsheets and presentations are edited one worksheet or slide per call. In evaluation mode only the first two can be edited, and the server says so: “Evaluation mode edits only the first 2 slides of a presentation; slide 3 is beyond them.”
- Evaluation mode also adds a banner line to every output.
FAQ
Can it replace text in Word, Excel and PowerPoint in one batch?
Yes. The agent calls the same tool per file and adds worksheet or slide for workbooks and decks.
How do I know which files were changed? Each call returns the count, and files without a match are not written at all. Ask the agent for a per-file table.
Will the originals be overwritten? No. Each edit writes a new file; the originals stay as they were until you replace them yourself.
Go deeper
- Documentation, canonical how-to: How to find and replace text across a folder of documents without breaking the formatting
- Documentation hub: GroupDocs.Editor MCP Server
- Start here: Why an AI agent should not rewrite your document to change three words
- Related: Fill Word forms from a spreadsheet with an AI agent, locally
- Related: Edit one worksheet, keep the workbook: surgical edits with an HTML round-trip
- Related: Edit a PDF with an AI agent? Turn it into Word first, locally
- On-premise and security model: 3 architectures for AI document processing, and the one that keeps files inside your network
- Questions: GroupDocs Editor forum
- Source: GroupDocs.Editor.Mcp on GitHub · NuGet package