
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
MCP server that gives coding agents vision through OpenAI-compatible multimodal models, with reliable binary image uploads for remote deployments.
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.
git clone https://github.com/xyun1996/ocular.git
cd ocular
npm install
npm run build
cp .env.example .env
Minimal OpenAI-compatible configuration:
OCULAR_BASE_URL=https://api.openai.com/v1
OCULAR_API_KEY=your_api_key
OCULAR_MODEL=gpt-4o-mini
A local OpenAI-compatible endpoint also works:
OCULAR_BASE_URL=http://localhost:11434/v1
OCULAR_API_KEY=ollama
OCULAR_MODEL=qwen2.5-vl-7b
node dist/index.js
Claude Code example:
claude mcp add ocular -- node /absolute/path/to/ocular/dist/index.js
For a generic MCP client:
{
"mcpServers": {
"ocular": {
"command": "node",
"args": ["/absolute/path/to/ocular/dist/index.js"],
"env": {
"OCULAR_BASE_URL": "https://api.openai.com/v1",
"OCULAR_MODEL": "gpt-4o-mini",
"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.
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, and tool execution.
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, opening an issue describing the client, provider, and use case is especially useful — even when nothing is broken.
Contributions are welcome. Start with CONTRIBUTING.md, run npm run check before opening a PR, and include reproduction details for behavior changes.
MIT — see LICENSE.
If ocular is useful in your agent workflow, a GitHub star helps other developers discover the project.
FAQs
MCP server that gives coding agents vision through OpenAI-compatible multimodal models, with reliable binary image uploads for remote deployments.
The npm package ocular-mcp receives a total of 28 weekly downloads. As such, ocular-mcp popularity was classified as not popular.
We found that ocular-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.