
ocular
io.github.xyun1996Published by GitHub account xyun1996v0.1.0Updated Oct 24, 2026
Vision tools for coding agents: screenshots, OCR, UI diffs, errors, tables, and charts.
Overview
Gives text-only coding agents vision tools to analyze screenshots, OCR text, UI mockups, errors, tables, and charts through an OpenAI-compatible vision model.
- What you can do
- Ocular exposes eight vision tools to an MCP client: general image analysis, OCR with layout awareness, UI screenshot review, error screenshot diagnosis, UI comparison, table extraction, chart analysis, and upload session creation. Tools return structured JSON rather than prose, so an agent can reason over visual evidence. It supports local stdio use and remote HTTP deployments, where images can be uploaded as binary and referenced by a content-addressed file_id instead of inline base64. Uploads are deduplicated and results can be cached.
- When to use it
- Use it when a coding agent needs to interpret visual evidence that source code alone does not capture, such as a broken layout, a terminal or browser error screenshot, a design reference, a table, or a chart. It fits workflows that compare an expected UI against an implementation or extract structured data from images.
- Requirements
- Runs locally as an npm package (ocular-mcp, CLI command ocular) over stdio, or as an HTTP deployment. Requires an OpenAI-compatible multimodal endpoint and three environment variables: OCULAR_BASE_URL, OCULAR_API_KEY, and OCULAR_MODEL. Remote HTTP mode adds MCP_TRANSPORT, host, port, path, and MCP_AUTH_TOKEN settings. Network access to the chosen provider is needed.
Installation
In SourceWeft
- Open ocular in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
ocular
[CI] [npm] [License: MIT] [Node.js] [TypeScript] [MCP]
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.
Why ocular?
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.
- Agent-oriented output — tools return structured JSON instead of prose-only descriptions.
- 8 focused vision tools — general analysis, OCR, UI inspection, error diagnosis, UI comparison, table extraction, chart analysis, and upload orchestration.
- OpenAI-compatible provider interface — point ocular at a compatible multimodal endpoint and model; reproducibly tested configurations are tracked in Provider compatibility.
- Remote-friendly uploads — binary
PUT /uploadflow for large images with content-addressedfile_idreferences. - Local or remote MCP — stdio for local clients, HTTP for hosted/private deployments.
- Caching and persistence — deduplicated uploads plus result caching for repeated agent workflows.
How it works
For remote HTTP deployments, the recommended path is:
See Architecture for the upload and caching model.
Demo
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.
Quick start
1. Install
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:
2. Configure a vision provider
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.
3. Run in stdio mode
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.
4. Connect an MCP client
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.
Example workflows
Diagnose a screenshot
Ask your coding agent to inspect an error screenshot and extract the exact message, likely cause, and next checks.
Review a UI implementation
Use analyze_ui_screenshot to turn a screenshot into implementation-oriented observations about hierarchy, alignment, spacing, typography, contrast, and likely visual defects.
Compare expected vs actual UI
Use compare_ui_screenshots with a reference screenshot and an implementation screenshot to identify regressions and layout differences.
See Screenshot debugging example.
Tools
Every vision tool accepts file_id; local workflows can also use inline image_base64 where appropriate.
Remote deployment
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.
Configuration
Common variables:
See .env.example for the full configuration surface.
Verification and benchmarks
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.
Development
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.
Security and privacy
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.
Roadmap
Near-term areas where contributions are useful:
- Real-world MCP client integration and usage reports
- Provider/model compatibility verification
- Published fixture-based benchmark results from real endpoints
- Community-driven tool and prompt improvements
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.
Contributing
Contributions are welcome. Start with CONTRIBUTING.md, run npm run check before opening a PR, and include reproduction details for behavior changes.
Release and registry
The npm package is ocular-mcp; the installed CLI is ocular. Release automation uses npm Trusted Publishing rather than a long-lived repository token. See Publishing.
ocular is published in the official MCP Registry as io.github.xyun1996/ocular. See MCP Registry for the live identity and release flow.
License
MIT — see LICENSE.
If ocular is useful in your agent workflow, a GitHub star helps other developers discover the project.
Source: README.md at commit e82e598
Tools
0Version history
1- v0.1.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
