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.

Dalle pipeline hardcoded all’automazione agenziale

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.

Cos’è MCP e perché è importante qui

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:

Strumento Cosa fa
convert Converte un documento in un altro formato (PDF, DOCX, XLSX, PPTX, HTML, PNG, CSV… oltre 70 formati)
get_document_info Ispeziona un file — tipo, numero di pagine, proprietà — prima di agire
get_supported_formats Scopre quali conversioni sono possibili

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

L’architettura (tutto open‑source, porta il tuo LLM)

Livello Componente Ruolo
Orchestrazione n8n (self‑hosted) trigger, il nodo AI Agent, routing dei file
Ragionamento Il tuo LLM, via nodo Chat Model di n8n decide quali strumenti chiamare — completamente sostituibile
Strumenti GroupDocs.Conversion MCP (stdio) dietro supergateway convert, get_document_info, get_supported_formats
Archiviazione un volume Docker condiviso come i file fluiscono dentro e fuori

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 a deployment air‑gapped 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.

Come funziona il workflow

  1. Trigger — un webhook, email in ingresso, upload da form, o cartella monitorata riceve un documento.
  2. Stage — n8n scrive il file nella cartella di storage condivisa che il server MCP legge.
  3. Reason — l’AI Agent di n8n (il tuo Chat Model + il Conversion MCP come tool) riceve un’istruzione tipo “Converti report.docx in PDF e segnala il numero di pagine.” Chiama autonomamente get_document_info, poi convert.
  4. Deliver — n8n prende il file convertito dallo storage condiviso e lo inoltra — email, object storage, SharePoint, o la risposta originale.

L’agente sceglie gli strumenti e l’ordine. È questo che permette a un unico workflow di gestire “solo converti questo”, “converti solo se supera le 10 pagine”, o “converti e riassumi”.

Mettilo in piedi in pochi minuti

Uno stack minimale è costituito da due servizi che condividono un volume — il convertitore (dietro il bridge) e 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).

Licenza

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.

Perché è adatto all’impresa

  • 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: “redact the PII, convert to PDF, then watermark it ‘Confidential’.”

Inizia

  • Companion open‑source demo: GroupDocs.Conversion.Agentic —