How to let an AI agent see the document page it annotated

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Annotation MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-annotation -- dnx GroupDocs.Annotation.Mcp --yes
Folders, licensing and more →

Most document tools are write-only: the agent calls them and reports success because the call returned. generate_pages_preview breaks that pattern — it renders pages as PNG images returned inline, with annotations baked in, so a vision-capable model can actually look.

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 loop

Highlight the payment clause on page 2, then show me the page.

  1. add_annotation writes contract_annotated.pdf to the output folder.
  2. generate_pages_preview on that file with pages: "2" returns the rendered page as an image block.
  3. The agent sees where the highlight landed — and if it landed on the wrong paragraph, update_annotation moves it without starting over.

That third step is the difference between “I added a highlight” and “the highlight is on the payment clause”.

Step 3 is a second write on the produced file. Set GROUPDOCS_MCP_OUTPUT_PATH to a folder other than the storage folder before chaining edits on a produced file (configuration). With the default — outputs land in the storage folder — the second write fails with being used by another process; with a separate output folder add_reply, update_annotation and remove_annotations on the produced file all succeed.

What you need for it to work

  • Windows for PDF, for now. generate_pages_preview currently fails for PDF files on Linux, including the Docker image, with a TypeInitializationException for Gdip (System.Drawing.Common is not supported on non-Windows platforms); Word and other Office documents render, and on Windows with dnx every format renders. The other 10 tools are unaffected.
  • A client that renders image content. Claude Desktop does; a terminal client may only report that an image was returned. The tool behaves the same either way — the images simply may not be displayed.
  • A model that can see. The images are only useful to a vision-capable model.
  • Patience for big pages. Rendering is the most expensive call this server makes, and one call renders at most five pages. Ask for pages: "2" or "1-3", not a fifty-page document.

Other things the preview is good for

  • Locating text before annotating — render first, let the model read the page, then place the annotation with coordinates it derived rather than guessed.
  • Showing a reviewer the result in chat, without opening the file.
  • Checking a merge — after import_annotations onto a re-flowed draft, a preview shows whether imported notes still sit where they mean to.
  • Sanity-checking the licence state — a trial badge is visible in the rendered page, which is a blunt but effective check.

Prompts that work

Render pages 1-3 of the annotated contract so I can check the comments. Show me page 2, then tell me whether the highlight covers the whole clause. Preview the first page and describe what is on it.

A note on cost and privacy

The rendering happens locally — the PNG is produced by the engine on your machine. But the image then travels to your model provider like any other message content: with a cloud-hosted model, previewing a page means sending a picture of that page. For sensitive documents, that is the moment to use a local model. See On-premise architecture.

Read more