To batch convert a folder with an AI agent, point the GroupDocs.Conversion.Mcp server at the folder and describe the job in one sentence. The agent works through the files, calls the conversion engine once per document, and reports what it produced, all locally in Claude, Cursor or GitHub Copilot. It is batch processing driven by a sentence:

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

The step-by-step version with config and troubleshooting is in the documentation: How to batch-convert a folder of documents with an AI agent. This post walks through the same job as a short session, from the first prompt to handling failures.

Where do you start: the storage folder or the prompt?

Start with the storage folder. A batch job succeeds or fails on the folder mapping, and the mapping is set once in the server entry, not in each prompt. Two environment variables control it:

{
  "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"
      }
    }
  }
}

GROUPDOCS_MCP_STORAGE_PATH is the folder the agent can read. GROUPDOCS_MCP_OUTPUT_PATH is where converted files land. With both set, the source folder stays untouched and every result goes to converted. This is the cleanest layout for a batch. The dnx command needs the .NET 10 SDK; the Docker image ghcr.io/groupdocs-conversion/conversion-net-mcp:latest mounts the folder as /data. Restart Claude Desktop, Claude Code, VS Code or Cursor after you register the server.

What does the first prompt do?

Give the agent the simple case first:

Convert everything in this folder from DOCX to PDF.

The agent enumerates the folder and calls the convert tool for each file with format: "pdf". Each call takes a file name from storage and returns the saved file name. Run it twice and the second run creates new, distinctly named files next to the first.

How do you add a filter or a rule?

The prompt is the orchestration layer. Filtering, sequencing and an error policy are plain language:

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.

For sequencing, the agent can call get_document_info first, which returns file type, page count and basic properties without converting:

Check the page count of each PDF first, and only convert the ones with more than 10 pages.

The decision “more than 10 pages” is the agent’s. The conversion remains the engine’s.

What happens when one file fails?

When the engine cannot convert a file, for example because the source format is unsupported or the password is wrong, the response text for that file starts with the operation and the reason. A file name that does not exist returns the list of files the server can see so the agent can correct itself. For protected files, convert accepts an optional password parameter.

That is why a failure policy belongs in the prompt: “list any file that failed” asks the agent for a report at the end of the run, so a failure does not pass unnoticed. Read the report and re-run only the failures.

Example session

This is an abridged, illustrative session. The file names are invented and the reply is built from documented behavior, not a screenshot.

You:    Convert the invoices to PDF/A for archiving, and list any file that failed.
Agent:  [enumerates the invoice files]
Agent:  [calls convert for each file, one at a time]
Agent:  Converted 11 files to the output folder.
        Failed: invoice-0412.docx (password-protected, no password given).

How do you follow progress on a large folder?

The agent usually processes files one after another, so run time grows with the number of files and their size. For progress reporting, ask for it in the prompt: “tell me after every ten files” or “summarize at the end”. A few hundred documents work fine, and the final report tells you what happened. Start with a copy of a small subset, check two or three outputs by eye, and then run the full folder.

What if the batch must run unattended?

An agent session needs a person to start it. For scheduled pipelines, the n8n walkthrough shows a workflow tool driving the same server, and the engine is also scriptable through the GroupDocs.Conversion .NET library. Use the chat for ad hoc batches where you want to read the report.

What are the limits?

  • Evaluation mode caps a batch at 15 documents. Without a license, one server process can open at most 15 documents and the output carries an evaluation watermark. After that, further calls fail until the server restarts. Check the mode with get_license_status before you start a real batch, or ask “what is the license status of the conversion server?”.
  • Metered licensing needs outbound access. With metered keys, usage is reported to GroupDocs servers, so a firewalled machine should use a license file. Document content is never sent.
  • Scans stay images. OCR is not part of the server, so a batch of image-only PDFs will not gain a text layer.

FAQ

How do I convert all DOCX files in a folder to PDF with AI? Set the storage folder, then ask your agent for exactly that in one sentence. It converts the files one by one through the local server and nothing is uploaded.

Can an AI agent process an entire folder locally? Yes. The agent and the conversion server both run on your machine, and the files are read from and written to your own folders.

What is the best way to automate a document conversion pipeline? Use the chat for ad hoc batches you want to review. For a pipeline that runs on a schedule, drive the same server from a workflow tool such as n8n, or script the .NET library.

Go deeper