Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pymupdf/pymupdf4llm-mcp/llms.txt

Use this file to discover all available pages before exploring further.

pymupdf4llm-mcp is a Model Context Protocol (MCP) server built on top of pymupdf4llm. It exposes a single, powerful tool — convert_pdf_to_markdown — that LLM clients can call to extract structured Markdown (including images) from any PDF file. Launch it in seconds with uvx, or run it as a persistent SSE server or Docker container.

Introduction

Learn what pymupdf4llm-mcp is, how it works, and when to use it.

Quickstart

Install and connect to your MCP client in under 5 minutes.

Tool Reference

Full parameter and response documentation for the MCP tool.

Deployment

Run as stdio, SSE server, or Docker container.

How It Works

pymupdf4llm-mcp wraps the pymupdf4llm.to_markdown() function and exposes it as an MCP tool. When an LLM client calls the tool, the server:
1

Receives a file path

The client passes an absolute path to a PDF file on disk.
2

Converts to Markdown

pymupdf4llm processes the PDF, extracting text with layout-aware formatting and converting tables, headings, and code blocks into Markdown.
3

Extracts images

Embedded images are written to a configurable directory alongside the Markdown output.
4

Returns the result

For small documents, Markdown is returned inline. For large PDFs, the content is written to a file and the path is returned — so the LLM can read it in chunks.

Key Features

Zero-install launch

Run instantly with uvx pymupdf4llm-mcp@latest stdio — no virtual environment setup required.

Two transport modes

Choose stdio for local LLM clients or sse for networked, persistent server deployments.

Image extraction

Embedded PDF images are automatically saved to disk and referenced in the Markdown output.

Large PDF handling

Use save_path to write output to a file for large PDFs, avoiding response size limits.

Build docs developers (and LLMs) love