Vision tools for coding agents: screenshots, OCR, UI diffs, errors, tables, and charts.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Vision for coding agents.
ocular is an MCP server that lets text-first coding agents analyze screenshots, UI mockups, terminal errors, documents, tables, and charts through OpenAI-compatible vision models.
It is designed for both local stdio use and remote HTTP deployments. For remote agents, image bytes can travel through a binary upload side channel while MCP tool calls carry only a lightweight file_id, avoiding large inline base64 payloads.
Project status: early-stage and actively evolving. Feedback, bug reports, integrations, and real-world usage reports are welcome.
Coding agents are good at reading source code but often lose context when the important evidence is visual: a broken layout, a terminal screenshot, an error dialog, a chart, or a design reference.
ocular turns those visual inputs into structured data an agent can reason about.
PUT /upload flow for large images with content-addressed file_id references.For remote HTTP deployments, the recommended path is:
See Architecture for the upload and caching model.
Want to see the full handoff from screenshot to coding-agent evidence? Read the end-to-end demo.
It walks through a remote image upload, a diagnose_error_screenshot call, the structured fields returned to the agent, and how that evidence is combined with repository context. Example model output is explicitly marked representative rather than presented as a benchmark.
The published npm package is ocular-mcp. It installs the CLI command ocular.
Global install:
Or run it without a global install:
To build from source instead:
ocular requires an OpenAI-compatible multimodal endpoint, API key, and model name:
For a local compatible endpoint, use that server's base URL and vision-capable model name. Compatibility depends on the endpoint/model combination; see Provider compatibility for the reproducible smoke-test procedure and verified configurations.
With a global install:
Or:
The server communicates over stdio, so it may appear idle when started directly. In normal use an MCP client launches it and exchanges protocol messages over stdin/stdout.
Claude Code example:
Avoid putting long-lived API keys directly in shell history on shared machines. Use your client's environment/secret-management mechanism when available.
For a generic MCP client:
See Claude Code setup for a fuller walkthrough.
Ask your coding agent to inspect an error screenshot and extract the exact message, likely cause, and next checks.
Use analyze_ui_screenshot to turn a screenshot into implementation-oriented observations about hierarchy, alignment, spacing, typography, contrast, and likely visual defects.
Use compare_ui_screenshots with a reference screenshot and an implementation screenshot to identify regressions and layout differences.
See Screenshot debugging example.
| Tool | Purpose |
|---|---|
analyze_image | General structured image analysis |
extract_text_from_image | OCR with reading-order/layout awareness |
analyze_ui_screenshot | UI hierarchy, spacing, typography and accessibility review |
diagnose_error_screenshot | Extract and diagnose terminal/browser/build errors |
compare_ui_screenshots | Compare reference and implementation screenshots |
extract_table_from_image | Extract table data into structured output |
analyze_chart_image | Analyze chart labels, values, trends and uncertainty |
create_upload_session | Return upload endpoint and instructions for remote clients |
Every vision tool accepts file_id; local workflows can also use inline image_base64 where appropriate.
Set HTTP transport and authentication:
Upload raw bytes:
The server returns a content-addressed file_id; pass that id to a vision tool instead of sending a large base64 string through MCP.
For reverse proxy and systemd examples, see Deployment.
Common variables:
| Variable | Purpose |
|---|---|
OCULAR_BASE_URL | OpenAI-compatible API base URL |
OCULAR_API_KEY | Provider API key |
OCULAR_MODEL | Vision-capable model name |
OCULAR_HEADERS | Optional custom provider headers as JSON |
OCULAR_TEMPERATURE | Generation temperature |
OCULAR_MAX_TOKENS | Maximum generated tokens |
OCULAR_TIMEOUT_MS | Provider timeout |
OCULAR_MAX_IMAGE_MB | Maximum image size |
OCULAR_CACHE_ENABLED | Enable result cache |
OCULAR_CACHE_DIR | Cache directory |
OCULAR_UPLOADS_DIR | Persistent upload directory |
OCULAR_UPLOAD_URL_BASE | Public base URL used in upload instructions |
See .env.example for the full configuration surface.
Provider compatibility claims are based on real endpoint/model smoke tests, not on API naming alone. See Provider compatibility.
The repository also includes synthetic, redistributable visual fixtures for repeatable project-level measurements. See Benchmark fixtures. The benchmark measures execution, structural JSON output, and timing; it is not presented as a broad model-quality ranking.
The repository includes tests for authentication, caching, image handling, MCP server behavior, provider payloads, tool execution, npm packaging, Registry metadata consistency, and release smoke checks.
Do not commit provider API keys or MCP authentication tokens. Public HTTP deployments should sit behind HTTPS and a reverse proxy; the Node process should generally bind to a private interface.
See SECURITY.md for vulnerability reporting guidance.
Near-term areas where contributions are useful:
If you are using ocular in a real workflow, open a Usage report issue describing the client, provider/model, and use case. Public reports are useful even when nothing is broken and help keep compatibility/adoption claims grounded in real usage.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ocular)<a href="https://allmcps.com/mcp/ocular"><img src="https://allmcps.com/api/badge/ocular?style=directory" alt="Ocular on AllMCPs" /></a>