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.
Где начинать: папка хранилища или запрос?
Начните с папки хранилища. Пакетная задача succeeds или fails в зависимости от сопоставления папки, а сопоставление задаётся один раз в записи сервера, а не в каждом запросе. Два переменных окружения управляют этим:
{
"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 — это папка, из которой агент может читать. GROUPDOCS_MCP_OUTPUT_PATH — это место, куда попадают конвертированные файлы. При установленном обоих пути исходная папка остаётся нетронутой, а каждый результат попадает в converted. Это самая чистая организация для пакетной обработки. Команда dnx требует .NET 10 SDK; Docker‑образ ghcr.io/groupdocs-conversion/conversion-net-mcp:latest монтирует папку как /data. Перезапустите Claude Desktop, Claude Code, VS Code или Cursor после регистрации сервера.
Что делает первый запрос?
Сначала дайте агенту простую задачу:
Convert everything in this folder from DOCX to PDF.
Агент перечисляет файлы в папке и вызывает инструмент convert для каждого файла с параметром format: "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.
Для последовательности агент может сначала вызвать get_document_info, который возвращает тип файла, количество страниц и базовые свойства без конвертации:
Check the page count of each PDF first, and only convert the ones with more than 10 pages.
Решение «более 10 страниц» принимает агент. Конвертация остаётся задачей движка.
Что происходит, если один файл не удаётся конвертировать?
Когда движок не может конвертировать файл, например из‑за неподдерживаемого формата источника или неверного пароля, текст ответа для этого файла начинается с операции и причины. Несуществующее имя файла возвращает список файлов, которые сервер видит, чтобы агент мог исправить запрос. Для защищённых файлов convert принимает необязательный параметр password.
Поэтому политика ошибок должна быть включена в запрос: «list any file that failed» заставит агента предоставить отчёт в конце выполнения, и ошибка не останется незамеченной. Прочитайте отчёт и повторно запустите только неудавшиеся файлы.
Пример сеанса
Это сокращённый, иллюстративный сеанс. Имена файлов вымышлены, а ответ построен на документированном поведении, а не на скриншоте.
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).
Как отслеживать прогресс при работе с большой папкой?
Агент обычно обрабатывает файлы последовательно, поэтому время выполнения растёт с количеством файлов и их размером. Чтобы получать отчёт о прогрессе, укажите это в запросе: «tell me after every ten files» или «summarize at the end». Несколько сотен документов обрабатываются без проблем, а финальный отчёт сообщает, что произошло. Начните с копии небольшого подмножества, проверьте два‑три результата вручную, а затем запустите полную папку.
Что делать, если пакет должен работать без присмотра?
Сеанс агента требует человека для его запуска. Для запланированных конвейеров см. n8n walkthrough, где инструмент workflow управляет тем же сервером, а движок также можно вызвать через библиотеку GroupDocs.Conversion .NET. Используйте чат для ад‑hoc пакетов, когда хотите получить отчёт.
Каковы ограничения?
- 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_statusbefore 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
- Documentation, canonical how‑to: How to batch-convert a folder of documents with an AI agent
- Documentation hub: GroupDocs.Conversion MCP Server
- Start here: Why your AI agent should not convert documents by itself
- Related: 3 ways to turn PDFs into LLM-ready Markdown (and why local wins)
- Related: Automate report delivery: let the agent write Markdown and ship Word
- Announcement: Your AI Agent Can Now Convert Documents — Locally. Introducing GroupDocs.Conversion MCP
- On‑premise and security model: 3 architectures for AI document processing, and the one that keeps files inside your network
- Questions: GroupDocs Conversion forum
- Source: GroupDocs.Conversion.Mcp on GitHub