
ocular
io.github.xyun1996由 GitHub 帳號 xyun1996 發布v0.1.0更新於 Oct 24, 2026
Vision tools for coding agents: screenshots, OCR, UI diffs, errors, tables, and charts.
概覽
為純文字程式助理提供視覺工具,透過相容 OpenAI 的視覺模型分析截圖、OCR 文字、介面稿、錯誤、表格與圖表。
- 可以做什麼
- Ocular 向 MCP 用戶端提供八個視覺工具:一般影像分析、具版面感知的 OCR、介面截圖檢視、錯誤截圖診斷、介面截圖比對、表格擷取、圖表分析,以及上傳工作階段建立。工具回傳結構化 JSON 而非純文字描述,方便助理根據視覺證據推理。它同時支援本機 stdio 執行與遠端 HTTP 部署;遠端模式下影像可以二進位上傳,並以內容定址的 file_id 引用,不必內嵌 base64。上傳會去重,結果可快取。
- 適用情境
- 當程式助理需要理解原始碼無法呈現的視覺證據時使用,例如跑掉的版面、終端機或瀏覽器錯誤截圖、設計參考、表格或圖表。也適合比對預期介面與實際實作,或從圖片擷取結構化資料的工作流程。
- 執行需求
- 以 npm 套件(ocular-mcp,指令為 ocular)在本機透過 stdio 執行,或部署為 HTTP 服務。需要一個相容 OpenAI 的多模態端點,以及三個環境變數:OCULAR_BASE_URL、OCULAR_API_KEY、OCULAR_MODEL。遠端 HTTP 模式還需設定 MCP_TRANSPORT、主機、連接埠、路徑與 MCP_AUTH_TOKEN。需要能連線到所選模型供應商。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ocular,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:README.md,提交 e82e598
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
