How to convert PDF to Markdown with an MCP server

Convert PDF files to clean, LLM-ready Markdown for your RAG pipeline or knowledge base — locally via MCP, with headings, tables, and lists preserved, and no document ever uploaded to a cloud service. Install the server and ask your agent:

dnx GroupDocs.Conversion.Mcp --yes

Convert report.pdf to Markdown

The agent calls the convert tool with format: "md"; report.md appears in your output folder.

Why local matters here

Every RAG pipeline starts with document → Markdown. Doing that through a cloud parser means every contract, patient record, and internal report transits someone else’s infrastructure — precisely the documents you are building a private knowledge base for. The MCP server runs the conversion on your machine through the GroupDocs engine: local-first by architecture, not by policy.

Setup

Any MCP client works — per-client reference. Claude Desktop:

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

Prompts that work

  • “Convert report.pdf to Markdown.”
  • “Turn every PDF in this folder into Markdown for my knowledge base.” (see batch conversion)
  • “Check how many pages whitepaper.pdf has, then convert it to Markdown.”

What the output looks like

Structure is preserved as real Markdown constructs: headings become #/##, tables become pipe tables, lists become list items — the format your embedding pipeline and your LLM read natively. The output is a plain .md file next to your documents; feed it straight to your chunker.

Beyond PDF

The same one-prompt pattern converts DOCX, XLSX, PPTX, HTML, and the rest of the supported formats to Markdown — and the reverse direction turns Markdown back into polished PDF or Word.

Troubleshooting

  • Output missing structure? Scanned (image-only) PDFs have no text layer to convert — OCR is not currently part of this server; see the OCR question in Troubleshooting & FAQ.
  • Server not visible in the client? Restart the client after registration; see Troubleshooting.

FAQ

Does PDF to Markdown work offline? Yes — after the one-time package/image download, conversion runs fully locally; no network is used at runtime.

Are tables preserved in the Markdown? Yes, as Markdown pipe tables; complex layouts are where the commercial engine earns its keep versus basic extractors.

Can I convert Markdown back to PDF or Word? Yes — Export Markdown to PDF or Word.