Listed from the MCP registry; nobody on Odel publishes it.
Compress OCR-heavy PDFs into dense packed images so agents can work with long visual documents.
Runs on your machine from its package; the steps are below.

At most: creates or changes data: records, files, settings.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
uvx optical-context-mcp
MCP client config
{
"mcpServers": {
"optical-context-mcp": {
"command": "uvx",
"args": [
"optical-context-mcp"
]
}
}
}
Compress OCR-heavy PDFs into dense packed images so agents can work with long visual documents.
Optical Context MCP is built for one specific job: turning large, visually structured PDFs into a smaller set of retrievable packed images for agent workflows.
It reads a local PDF, runs OCR with Mistral, recomposes the extracted text and figures into dense PNGs, and exposes those artifacts over MCP for batch retrieval.
Use it for:
Skip it for:
The image below shows a real local validation run on a public research paper with dense text, figures, charts, and page-level visual structure. The packed image on the right consolidates the seven source pages shown on the left.
Example local run facts from the generated manifest:
986x1084536,697 bytesThis example shows the intended workflow: take a long, visually structured PDF and compress it into a smaller set of retrievable packed images that still preserve the visual structure of the source.
python -m pip install optical-context-mcp
Install with the adaptive sizing runtime:
python -m pip install "optical-context-mcp[ml]"
Run without installing:
uvx optical-context-mcp
MISTRAL_API_KEY is required for compress_pdfcompress_pdf returns up to 30 packed images inline by defaulttorch and torchvision are availableOPTICAL_CONTEXT_DISABLE_ADAPTIVE_SIZING=1 to force the legacy fixed sizingOPTICAL_CONTEXT_ADAPTIVE_MODEL_PATH=/path/to/model.pt to override the bundled checkpointFor pinned shared setups:
uvx --from optical-context-mcp==0.1.5 optical-context-mcp
Default transport is stdio:
optical-context-mcp
Register the server in a project:
claude mcp add -s project optical-context -- uvx optical-context-mcp
Typical use:
compress_pdfget_packed_imagescompress_pdf: run OCR plus recomposition and create a stored jobget_job_manifest: load metadata for an existing jobget_packed_images: fetch one or more packed PNGs from an existing jobflowchart LR
A["Local PDF"] --> B["Mistral OCR"]
B --> C["Page markdown + embedded images"]
C --> D["Recomposition engine"]
D --> E["Dense packed PNG images"]
E --> F["Stored job artifacts"]
F --> G["Agent fetches manifest or image batches over MCP"]
For many vision-capable agents, that is a better intermediate format than a plain OCR dump.
Tried Optical Context in a document workflow? You can voluntarily share what worked and what got in the way using the feedback form. Include your package version, MCP client and a brief description of the document type. Do not attach private PDFs or API keys. Feedback is public on GitHub.
See the changelog for changes between published versions.
uv venv --python /opt/homebrew/bin/python3.11 .venv
uv pip install --python .venv/bin/python -e ".[dev]"
.venv/bin/python -m pytest
Keep pyproject.toml and both versions in server.json synchronized. Run the
Publish PyPI workflow on the reviewed release commit. It checks the wheel,
runs tests against the installed distribution, publishes to PyPI, then publishes
the same version to the MCP Registry. Both use GitHub OIDC; no local publishing
token is required. If only the registry job fails, rerun that failed job rather
than republishing the immutable PyPI version.
When a workflow correction requires a new run, select registry_only to retry
registry publication without uploading the existing PyPI version again.
Create the matching GitHub release from that same commit and attach the workflow's
python-distributions artifact.