How to annotate documents with AI agents using MCP

Annotating with an AI agent works because the two halves do what each is good at: the agent understands “flag anything that shifts risk to us”, and the engine writes a real annotation into a real document, locally.

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

  1. Put the document in the storage folder the server can see.
  2. Ask in plain language: “Highlight the payment clause on page 2 and add a note asking legal to confirm.”
  3. The agent calls add_annotation with the type, text, page, and position.
  4. The engine writes contract_annotated.pdf next to your original — the original is never modified.
  5. Optionally the agent calls generate_pages_preview and looks at the result.

The one thing that trips people up

Every writing tool saves a new file named <name>_annotated.<ext>. So a second annotation must be applied to that file, not to the original — otherwise the first annotation is silently left behind in a file nobody opens again.

A well-instructed agent chains them:

Highlight the payment clause, then on the resulting file strike out the old delivery date, then show me page 2.

If you are scripting the calls yourself, pass the file name returned by the previous call. If an annotation “disappears”, this is almost always why.

Placement, honestly

x/y are document coordinates. An agent asked to “highlight the payment clause” has to guess where that clause is unless something tells it. Three ways to get placement right:

  • Read firstget_annotations returns bounding boxes of existing annotations to anchor against.
  • Look first — render the page with generate_pages_preview and let a vision-capable model locate the text.
  • Check after — annotate, render, and let the agent adjust with update_annotation if the box landed badly.

Use get_document_info for the page box before placing anything near an edge.

Setup

dnx GroupDocs.Annotation.Mcp --yes

with GROUPDOCS_MCP_STORAGE_PATH pointing at your documents folder — exact per-client config, or run the installer.

Where to go next