GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
Vision tools for coding agents: screenshots, OCR, UI diffs, errors, tables, and charts.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
OCULAR_BASE_URL, OCULAR_API_KEY, OCULAR_MODEL标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"ocular": {
"command": "npx",
"args": [
"-y",
"ocular-mcp"
],
"env": {
"OCULAR_BASE_URL": "your-value",
"OCULAR_API_KEY": "your-value",
"OCULAR_MODEL": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add ocular --env OCULAR_BASE_URL=your-value --env OCULAR_API_KEY=your-value --env OCULAR_MODEL=your-value -- npx -y ocular-mcp运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"ocular": {
"command": "npx",
"args": [
"-y",
"ocular-mcp"
],
"env": {
"OCULAR_BASE_URL": "your-value",
"OCULAR_API_KEY": "your-value",
"OCULAR_MODEL": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"ocular": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ocular-mcp"
],
"env": {
"OCULAR_BASE_URL": "your-value",
"OCULAR_API_KEY": "your-value",
"OCULAR_MODEL": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 xyun1996 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:OCULAR_BASE_URL, OCULAR_API_KEY, OCULAR_MODEL
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.1.0)于3个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
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.flowchart LR
A[Coding agent] -->|MCP tool call| B[ocular] C[Image / screenshot] -->|binary upload or base64| B B -->|OpenAI-compatible request| D[Vision model] D -->|multimodal response| B B -->|structured JSON| A
For remote HTTP deployments, the recommended path is:
image bytes -> PUT /upload -> file_id -> MCP vision tool -> structured result
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:
npm install -g ocular-mcp
Or run it without a global install:
npx -y ocular-mcp
To build from source instead:
git clone https://github.com/xyun1996/ocular.git
cd ocular npm install npm run build
ocular requires an OpenAI-compatible multimodal endpoint, API key, and model name:
OCULAR_BASE_URL=https://your-openai-compatible-endpoint.example/v1
OCULAR_API_KEY=your_api_key OCULAR_MODEL=your_vision_model
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:
ocular
Or:
npx -y ocular-mcp
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:
claude mcp add ocular \
-e OCULAR_BASE_URL=https://your-openai-compatible-endpoint.example/v1 \ -e OCULAR_MODEL=your_vision_model \ -e OCULAR_API_KEY=your_api_key \ -- npx -y ocular-mcp
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:
{
"mcpServers": { "ocular": { "command": "npx", "args": ["-y", "ocular-mcp"], "env": { "OCULAR_BASE_URL": "https://your-openai-compatible-endpoint.example/v1", "OCULAR_MODEL": "your_vision_model", "OCULAR_API_KEY": "your_api_key" } } } }
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.
{
"file_id": "e21ba723...", "task": "Extract the exact error and suggest the next debugging checks", "project_context": "Node.js TypeScript project" }
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:
MCP_TRANSPORT=http
MCP_HTTP_HOST=127.0.0.1 MCP_HTTP_PORT=3000 MCP_HTTP_PATH=/mcp MCP_AUTH_TOKEN=replace_with_a_long_random_token MCP_AUTH_HEADER=authorization MCP_AUTH_SCHEME=Bearer
Upload raw bytes:
curl --request PUT \
--data-binary @/path/to/image.png \ "https://your.host/upload" \ -H "Content-Type: image/png" \ -H "Authorization: Bearer your_mcp_auth_token"
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.
npm install
npm run build npm test npm run check npm run dev
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.
Contributions are welcome. Start with CONTRIBUTING.md, run npm run check before opening a PR, and include reproduction details for behavior changes.
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.
MIT — see LICENSE.
If ocular is useful in your agent workflow, a GitHub star helps other developers discover the project.