How to batch-convert a folder of documents with an AI agent

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.Conversion 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-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

Convert an entire folder of documents with a single prompt — the agent orchestrates, the GroupDocs engine batch-converts locally; nothing is uploaded and your originals are kept. Point the server at the folder and ask:

Convert every DOCX in my documents folder to PDF, keep the originals

The agent enumerates the files, calls convert per document, and reports what it produced. No uploads, no per-file clicking, no script to maintain.

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 key setting: the storage folder

Batch scenarios live or die on the folder mapping. Set it once and the whole folder is in scope for every prompt:

{
  "mcpServers": {
    "groupdocs-conversion": {
      "type": "stdio",
      "command": "dnx",
      "args": ["GroupDocs.Conversion.Mcp", "--yes"],
      "env": {
        "GROUPDOCS_MCP_STORAGE_PATH": "/path/to/invoices",
        "GROUPDOCS_MCP_OUTPUT_PATH": "/path/to/invoices/converted"
      }
    }
  }
}

With a separate GROUPDOCS_MCP_OUTPUT_PATH, originals stay untouched in storage and every converted file lands in the output folder — the cleanest batch layout. (Installer users: this is storagePath / outputPath in one config.)

Prompts that scale

  • “Convert everything in this folder from DOCX to PDF.”
  • “Turn all the PDFs into Markdown; skip files that are already converted.”
  • “Convert the invoices to PDF/A for archiving, and list any file that failed.”
  • “Make PNG previews of every presentation.”

The prompt is the orchestration layer: filtering (“only the 2025 ones”), sequencing (“check page counts first”), and error policy (“list failures at the end”) are all plain language — the deterministic conversion stays in the engine.

Practical notes

  • Existing files are never overwritten — re-running a batch produces distinctly-named files rather than clobbering earlier output.
  • Large batches: agents typically process files sequentially; a few hundred documents work fine, and the report at the end tells you exactly what happened. For scheduled/unattended pipelines beyond agent sessions, the same engine is scriptable via the .NET library.
  • Evaluation mode caps a single server process at 15 opened documents — a license lifts this for real batches.
  • Failures are reported per file. When a file cannot be converted — an unsupported source format or a wrong password — the response for that file starts with the operation and the reason, and convert accepts an optional password. Put “list any file that failed” in the prompt so a failure does not pass unnoticed.

FAQ

Can Claude convert an entire folder at once? Yes — one prompt; the agent iterates the folder through the local MCP server. You never upload files one by one.

How do I keep originals? They are kept by default — conversion writes new files. A separate output folder (above) keeps the source folder pristine.

Can I filter which files get converted? Say it in the prompt — by extension, name pattern, or even content questions the agent checks via get_document_info.

Read more