A document review workflow with an AI agent can follow the same steps every round: list what is open, reply in threads, resolve, carry the comments to the next draft, and produce a clean copy. The GroupDocs.Annotation.Mcp server exposes each step as a tool, so an LLM in Claude, Cursor or GitHub Copilot can run the round locally while a person approves the outcome:
List the annotations in output/contract_annotated.pdf. Which ones have no replies?
The step-by-step version with config and troubleshooting is in the documentation: How to run a document review cycle with an AI agent.
Why do review rounds drift without a fixed sequence?
A round of review is rarely “add a comment”. It is: what is still open, who raised it, an answer, a resolution, and a clean copy for the next audience. When people do this by hand, the order varies, replies go unsigned, and the next draft loses the comments from the last one.
An agent that follows the same sequence every time removes that variation. It also leaves a trail inside the document instead of in a chat transcript, which is where an audit would look.
The workflow, step by step
Each step has one prompt and one tool.
- Find what is open. Prompt: “List the annotations in output/contract_annotated.pdf. Which ones have no replies?” The agent calls
get_annotations, which returns each annotation with itsid, type, message, page, bounding box, user and replies. An unanswered comment is one with an emptyrepliesarray, so the agent filters the list it already holds. - Reply in the thread. Prompt: “Reply to Maria’s comment that finance approved the terms on 12 March. Sign it as Alex.” The agent calls
add_replywith theannotationId, thecommentand auserName. The name defaults tomcp-user, so ask for a real one. - Resolve what is done. Choose a convention and state it in the prompt: reply and leave the thread as the record, remove the annotation with
remove_annotations, or edit the message withupdate_annotationto start with[RESOLVED]. - Carry the round to the next draft. Prompt: “Export the annotations from the reviewed copy, then import them into contract-v3.pdf.” The agent calls
export_annotations, which writes an XML file, thenimport_annotations. - Hand back a clean copy. Prompt: “Remove all annotations and give me a clean copy for the counterparty.”
remove_annotationswithoutidsclears every annotation into a new file.
What does the agent decide, and what does the engine do?
| Decision or action | Agent | Engine |
|---|---|---|
| Which comments need an answer | Reads the get_annotations result and filters it |
Returns every annotation with ids, authors and replies |
| What the reply says | Drafts it from your instruction | Stores it under the userName you supplied |
| Which resolution convention applies | Follows the rule in your prompt | Applies the edit or removal it is asked for |
| Whether the round is finished | Reports the counts; the human approves | Saves the result of each change back to storage |
The engine never decides what counts as resolved. The annotation model has no resolved flag to set; resolution is a convention you choose and name in the prompt.
Where does the human stay in the loop?
Two places. Before step 5, ask the agent to state how many annotations it is about to remove and wait for your answer. The removal of all annotations is the one call in the workflow without an undo. Before anything goes outside the team, read the replies the agent drafted. Annotation text comes from other people, so treat a comment as content to summarize, not as instructions for the agent to follow.
Example session (abridged)
This is an illustration built from the documented behavior of the tools, not a captured screenshot.
You: List the annotations in output/contract_annotated.pdf. Which ones have no replies?
Agent: [calls get_annotations on output/contract_annotated.pdf]
Found 4 annotations. Two have no replies:
- id 2, page 2, Maria: "Confirm the payment terms with finance."
- id 4, page 5, Maria: "Delivery date conflicts with Schedule B."
You: Reply to the first one that finance approved the terms on 12 March.
Sign it as Alex.
Agent: [calls add_reply: annotationId=2, userName="Alex",
comment="Finance approved the terms on 12 March."]
Added reply to annotation 2 in output/contract_annotated.pdf.
(The agent uses the saved file name in the next call.)
How do I run the server for Claude, Cursor or Copilot?
Run the Docker image with your documents folder mounted, and an output folder that differs from the storage folder:
docker run --rm -i -v $(pwd)/documents:/data \
-e GROUPDOCS_MCP_OUTPUT_PATH=/data/output \
ghcr.io/groupdocs-annotation/annotation-net-mcp:latest
The same command and the dnx GroupDocs.Annotation.Mcp --yes alternative are explained in AI review that lands in the document, not in the chat log. The hub page has the registration for Claude Desktop, Claude Code, VS Code with GitHub Copilot, Cursor, Windsurf and other clients.
Honest limits
- Evaluation mode. Without a license, a trial badge is stamped at the top of every page, which is not something to send to a counterparty. Check
get_license_statusbefore a formal review. - Each writing tool saves its result back to storage. A round therefore produces a chain of files. Tell the agent to pass the file name from the previous result forward and to re-read that file with
get_annotationsbefore it edits anything, because ids belong to the document you just read. SetGROUPDOCS_MCP_OUTPUT_PATHto a folder other than the storage folder before chaining edits on a produced file. With the default (outputs land in the storage folder) the second write fails withbeing used by another process; with a separate output folderadd_reply,update_annotationandremove_annotationson the produced file all succeed. - Coordinates carry over as they are. On a re-flowed draft an imported note may land near its original text, not on it. Check the placement afterward.
- Preview on Linux.
generate_pages_previewcurrently fails for PDF files on Linux, including the Docker image (TypeInitializationExceptionforGdip:System.Drawing.Commonis not supported on non-Windows platforms); Word and other Office documents render, and on Windows withdnxevery format renders. The other ten tools are unaffected. The review tools in this post do not use the preview renderer.
FAQ
Can an AI reply to comments in a PDF automatically? Yes. The agent reads the comments with get_annotations and answers with add_reply, which takes the annotation id, the reply text and an author name.
Is there a resolved status for comments? No. The tools have no resolved flag, so you pick a convention such as keeping the thread, removing the annotation or prefixing the message with [RESOLVED].
Can I keep the comments when the document is revised? Yes. Export the annotations to XML from the reviewed copy and import them into the new draft. The same pair of tools merges two reviewers’ copies into one.
Go deeper
- Documentation, canonical how-to: How to run a document review cycle with an AI agent
- Documentation hub: GroupDocs.Annotation MCP Server
- Start here: AI review that lands in the document, not in the chat log
- Related: 3 ways to extract every comment from a document set with MCP
- Related: Show the agent what it did
- On-premise and security model: 3 architectures for AI document processing, and the one that keeps files inside your network
- Questions: GroupDocs Annotation forum
- Source: GroupDocs.Annotation.Mcp on GitHub