Docker gives you a self-contained, reproducible environment for pymupdf4llm-mcp with no host Python installation required. The repository ships a production-ready Dockerfile that builds a slim image based on Python 3.12, usesDocumentation 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.
uv for fast, deterministic dependency installation, and supports both stdio and SSE transport modes via the command passed at runtime.
The Dockerfile
The repository ships with a production-ready Dockerfile. Here is the full contents:- Base image:
python:3.12-slimkeeps the image small while providing a supported Python runtime. - Dependency manager:
uvis copied from its own official image, giving fast, lock-file-based installs. - Entrypoint:
tiniacts as PID 1, ensuring clean signal handling and proper zombie-process reaping inside the container. - Default command:
stdio— override it atdocker runtime to switch to SSE mode.
Building the Image
Clone the repository and build the image with a memorable tag:There is no pre-built image published to Docker Hub or any other registry. You must build the image from the repository source using the command above.
Running the Container
SSE Mode (recommended for Docker)
SSE mode is the most practical choice for Docker because it exposes a stable HTTP endpoint that survives container restarts and can be reached from the host or other containers. Bind to0.0.0.0 inside the container so that Docker’s port mapping works correctly:
http://localhost:3000/sse from the host machine.
Mounting a Local PDF Directory
By default the container has no access to files on your host. Use a volume mount (-v) to share a directory of PDFs with the container. Files placed in that directory become available at the mount point inside the container:
/data/document.pdf — as the file_path argument.
PDF file paths must be accessible inside the container, not on the host. If you pass a host path like
/Users/me/report.pdf the container will not find it and the tool call will fail. Always use volume mounts (-v) to expose the files you need, then reference them by their container-side path (e.g. /data/report.pdf).Connecting an MCP Client
Once the container is running in SSE mode, configure your MCP client to connect to it the same way as any other SSE server:url if you mapped the container to a different host port.