Every organization runs on documents — and on the brittle scripts that move them between formats. Word reports become PDFs, spreadsheets become CSVs, scans become searchable files. Each new format or rule means rewriting a pipeline. There’s a more flexible way: let an AI agent do the conversions, on your own infrastructure, using the tools you give it. This article shows how to build exactly that with n8n, the Model Context Protocol (MCP), and the GroupDocs.Conversion MCP server — keeping your documents (and optionally your AI model) entirely on‑premise.

De pipelines codificados em código rígido para automação agêntica

Traditional automation encodes how a task is done: detect the file type, branch, call the converter, handle errors, write the output. Every new requirement is a code change.

An agentic workflow encodes what you want. You state the goal — “convert these reports to PDF, but check the page count first” — and expose a set of tools. The AI agent decides which tools to call and in what order, and adapts to the result. Add a tool and the agent can use it immediately, with no rewiring. That adaptability is the whole point.

O que é MCP e por que isso importa aqui

The hard part of tool‑using agents has always been integration — every agent talked to every tool differently. The Model Context Protocol is an open, vendor‑neutral standard that fixes this: any MCP‑aware agent can discover and call any MCP server’s capabilities. Think of it as “USB‑C for AI tools.”

GroupDocs publishes document operations as MCP servers. The GroupDocs.Conversion server exposes three tools an agent can call:

Ferramenta O que faz
convert Converte um documento para outro formato (PDF, DOCX, XLSX, PPTX, HTML, PNG, CSV… mais de 70 formatos)
get_document_info Inspeciona um arquivo — tipo, contagem de páginas, propriedades — antes de agir
get_supported_formats Descobre quais conversões são possíveis

Because it speaks MCP, your agent needs no custom GroupDocs integration. It just sees tools.

A arquitetura (todo código aberto, traga seu próprio LLM)

Camada Componente Função
Orquestração n8n (auto‑hospedado) gatilhos, o nó AI Agent, roteamento de arquivos
Raciocínio Seu LLM, via nó Chat Model do n8n decide quais ferramentas chamar — totalmente intercambiável
Ferramentas GroupDocs.Conversion MCP (stdio) atrás do supergateway convert, get_document_info, get_supported_formats
Armazenamento um volume Docker compartilhado como os arquivos fluem de entrada e saída

A key design choice: the LLM is pluggable. n8n’s Chat Model node is provider‑agnostic, so the agent and the MCP tools never change when you swap models. The example below uses OpenAI, but the same workflow runs on Azure OpenAI, Anthropic, AWS Bedrock — or a fully self‑hosted model (Ollama, vLLM) when you need an air‑gapped deployment where the documents and the AI stay inside your network.

One integration note: the Conversion MCP is a lightweight stdio server (the secure, no‑network default). Since n8n connects to MCP tools over a URL, a small open‑source stdio‑to‑SSE bridge (supergateway) exposes it on a port. The server itself is unchanged.

Como o fluxo de trabalho é executado

  1. Trigger — um webhook, e‑mail de entrada, upload de formulário ou pasta monitorada recebe um documento.
  2. Stage — n8n grava o arquivo na pasta de armazenamento compartilhado que o servidor MCP lê.
  3. Reason — o AI Agent do n8n (seu Chat Model + o Conversion MCP como ferramenta) recebe uma instrução como “Convert report.docx to PDF and report the page count.” Ele chama autonomamente get_document_info, depois convert.
  4. Deliver — n8n pega o arquivo convertido do armazenamento compartilhado e o encaminha — e‑mail, armazenamento de objetos, SharePoint ou a resposta original.

The agent chooses the tools and the order. That’s what lets a single workflow handle “just convert this,” “convert only if it’s over 10 pages,” or “convert and summarize.”

Implante em minutos

A minimal stack is two services sharing one volume — the converter (behind the bridge) and n8n:

services:
  conversion-mcp:                    # GroupDocs.Conversion MCP, exposed over SSE
    build: ./bridge                  # supergateway --stdio "groupdocs-conversion-mcp" --port 8000
    environment:
      GROUPDOCS_MCP_STORAGE_PATH: /data
      GROUPDOCS_LICENSE_PATH: /license/GroupDocs.Total.lic
    volumes: [ ./data:/data, ./gd-license:/license:ro ]
  n8n:
    image: n8nio/n8n:latest
    ports: ["5678:5678"]
    volumes: [ ./data:/data ]        # SAME folder — the file hand‑off

Then in n8n, build the agent in four nodes: a Chat Trigger, a Chat Model (your OpenAI credential), an MCP Client tool pointing at http://conversion-mcp:8000/sse, and an AI Agent that wires them together. Drop a file in ./data, open the chat, and ask the agent to convert it.

The complete, runnable setup — docker-compose.yml, the bridge image, and an importable n8n workflow — is in the companion open‑source repository (see below).

Licenciamento

Without a license, GroupDocs.Conversion runs in evaluation mode: output is watermarked and usage may be limited. For production, drop a GroupDocs.Total.lic file into the mounted license folder — output is then clean and unrestricted. You can request a temporary license to try licensed output.

Por que isso se encaixa na empresa

  • Data sovereignty — documents and the conversion engine stay on your infrastructure. Choose a self‑hosted model and the AI does too.
  • No lock‑in — every layer is open source or standards‑based (MCP). Swap the LLM, the orchestrator, or the tools freely.
  • Auditability — every agent decision and tool call is a visible, replayable n8n execution.
  • Composability — this is the compounding benefit. Point the same agent at the other GroupDocs MCP servers — Redaction, Watermark, Metadata — and one natural‑language request becomes a full pipeline: *“red