Optical Context Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Optical Context Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<!-- mcp-name: io.github.ChrBoebel/optical-context-mcp -->
<p align="center"> <img src="./assets/optical-context-logo.png" alt="Optical Context MCP logo" width="680"> </p>
<h1 align="center">Optical Context MCP</h1>
<p align="center"> Compress OCR-heavy PDFs into dense packed images so agents can work with long visual documents. </p>
<p align="center"> <a href="https://pypi.org/project/optical-context-mcp/"><img src="https://img.shields.io/pypi/v/optical-context-mcp.svg" alt="PyPI version"></a> <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.11%2B-blue.svg" alt="Python 3.11+"></a> <a href="https://gofastmcp.com/"><img src="https://img.shields.io/badge/MCP-FastMCP-111111.svg" alt="FastMCP"></a> <a href="https://github.com/ChrBoebel/optical-context-mcp/actions/workflows/ci.yml"><img src="https://github.com/ChrBoebel/optical-context-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a> </p>
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.
<p align="center"> <img src="./assets/original-vs-packed-comparison-straight-arrow.png" alt="Side-by-side comparison of original pages and the generated packed output" width="980"> </p>
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-mcpInstall with the adaptive sizing runtime:
python -m pip install "optical-context-mcp[ml]"Run without installing:
uvx optical-context-mcpMISTRAL_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.4 optical-context-mcpDefault transport is stdio:
optical-context-mcpRegister the server in a project:
claude mcp add -s project optical-context -- uvx optical-context-mcpTypical 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.
uv venv --python /opt/homebrew/bin/python3.11 .venv
uv pip install --python .venv/bin/python -e ".[dev]"
.venv/bin/python -m pytest~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.