pymupdf4llm-mcp ships as a Python package and can be run instantly withDocumentation 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.
uvx — no virtual environment setup, no global install. The steps below take you from zero to a working PDF-to-Markdown tool inside your MCP client.
Prerequisites
You need two things before you start:
- Python 3.10 or later — check with
python --version - uv — the fast Python package manager that powers
uvx. Install it from docs.astral.sh/uv/getting-started/installation if you don’t have it yet
uvx downloads and runs pymupdf4llm-mcp in an isolated environment on first use, so there is nothing else to install globally.Launch the MCP server
Choose the transport mode that fits your workflow and run the corresponding command:
- stdio — starts the server and keeps it attached to the current terminal process. Most local MCP clients (Cursor, Windsurf, Claude Desktop) manage this process for you automatically — you typically don’t need to run this command manually.
- sse — starts an HTTP server on
http://localhost:3000that clients connect to over the network. Keep this process running in the background while your client is active.
Configure your MCP client
Open your MCP client’s configuration file and add the pymupdf4llm-mcp server block. The exact file location varies by client (e.g. With the stdio config, the client spawns the server process automatically each session — no manual launch needed. With the sse config, the client connects to the already-running HTTP server you started in the previous step.Restart your MCP client after saving the configuration so it picks up the new server.
.cursor/mcp.json for Cursor, ~/.config/windsurf/mcp.json for Windsurf, ~/Library/Application Support/Claude/claude_desktop_config.json for Claude Desktop on macOS), but the JSON structure is the same.Invoke the tool
Once the server is registered, ask your LLM client to convert a PDF using plain language:You can also direct the model to extract images or save the output to a file:
“Convert /home/alice/docs/report.pdf to Markdown.”The client resolves this to the following tool call behind the scenes:
Check the output
The tool returns different responses depending on whether you supplied A successful inline response looks like this:A successful file-save response looks like this:
save_path:Without save_path (inline) — The Markdown content is returned directly in the tool response under the markdown_content key. The model can read it immediately and answer questions about the document.With save_path (file) — The tool writes the full Markdown to the specified file and returns the resolved absolute path under markdown_path. Use this for anything you want to keep on disk or process further.Inline responses are truncated at 10,000 characters. If your PDF produces more Markdown than that, the response will end with
... (truncated) and a tip instructing you to use save_path. Pass an absolute save_path to get the complete, un-truncated output in a file that you or the model can read in parts.Next steps
With the server running and your client configured, you’re ready to go deeper:- Browse the Tool Reference for the full parameter and response schema
- Learn about persistent SSE Deployment for shared or server-side setups
- Explore the upstream pymupdf4llm documentation to understand how the PDF extraction works under the hood