
Cornea, deterministic visual inspection
io.github.AbduljabbarBXRPublished by GitHub account AbduljabbarBXRv0.2.2Updated Oct 24, 2026
Deterministic visual inspection for AI agents. Overlap, overflow, contrast, quality.
The publisher's own server: Deterministic
Overview
Cornea gives a coding agent deterministic, token-cheap layout inspection of HTML pages: overlaps, overflow, WCAG contrast and a quality score.
- What you can do
- Run a full visual inspection of a page and get a compact geometry model plus report
- List colliding element boxes and clipped, collapsed or off-screen elements
- Check WCAG AA contrast ratios for text elements
- Get a 0..1 layout health score with an issue list
- See which CSS features are handled exactly versus approximated
- Inspect a local HTML file or a live URL, optionally running inline scripts first
- When to use it
- Useful when an agent builds or edits web pages and needs to verify layout without screenshots or raw DOM in context, for example checking a local dev server page at a given viewport width during a coding loop.
- Requirements
- Runs as a local stdio process. Install via cargo (Rust toolchain) or the npm package that provides the cornea command; no browser or Node needed for the Rust build. No accounts, API keys or environment variables are declared. URL capture needs network access to the target page; HTTPS pages need a TLS stack the binary does not carry.
Installation
In SourceWeft
- Open Cornea, deterministic visual inspection 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
Cornea
Deterministic visual inspection for AI agents. The eyes a coding agent never had.
Cornea gives a coding agent that builds web pages a real way to see them. As a token-cheap, deterministic structural model it can reason over exactly, instead of megabytes of screenshots and raw DOM dumped into context.
An agent doesn't need a photo of a page. It needs to know is my layout broken, and how. Cornea computes an abstract visual geometry model of every element (box, position, z-order, computed styles) and derives inspection conclusions. overlap, overflow, contrast, quality. Then exposes them as native tools on three surfaces: CLI, MCP, and HTTP API.
One promise holds everything together: same input → byte-identical output. No Chromium, no sub-pixel variance, no server. A single ~1.4 MB binary.
Quick start
Requires only
cargo. No browser, no Node, no system dependencies. Builds fine on a phone-class device.
Or install the cornea command from npm (no Rust toolchain needed):
Visual guide: what Cornea does
Take this page below. It looks fine as source. But it's hiding four layout bugs. Cornea finds every one.
Run it and Cornea reports the damage instantly:
Each finding is precise and actionable:
That is the value: hundreds of tokens, not hundreds of kilobytes, and a deterministic answer the agent can act on and re-verify.
Visual guide: the three surfaces
Cornea is one engine, three doors. All three returns identical inspection JSON because they funnel through a single shared dispatch.
1. CLI. Inspect a file
2. MCP. Native agent tools over stdio
An agent calls layout.* tools directly; it passes the page source, or a
live URL (see URL capture below), per call:
3. HTTP API. Call from anything
Watching a live page (URL capture)
Every surface accepts a URL where the HTML would go. Cornea fetches the page, inlines its external stylesheets and external scripts (relative URLs resolved against the page), then inspects what a browser would actually show. That is the live coding session loop: run your dev server, point cornea at it, read the layout verdict.
Honesty around capture:
- Failed fetches leave the original tag in place and record a note, so the report warnings still flag what did not load.
- A positive
heightemulates a fixed viewport (screenshot frame, iframe, email) and enables below the fold clipping checks. Default 0 means an unbounded scrolling page. - Capture is a snapshot in time. Determinism holds engine side: the same fetched bytes always produce the same report.
- Plain HTTP is supported natively. HTTPS pages need a TLS stack, which the binary does not carry; capture from a local http dev server or pre inline the page with a fetch layer of your own.
Architecture
Read the full technical spec: CORNEA-ARCHITECTURE.md
Fidelity. Honest about what's approximate
Cornea never silently fakes precision. layout.fidelity tells an agent exactly what it can trust, and every report carries its own warnings for sources the engine saw but did not apply (external stylesheets, external scripts, media queries, unresolved colors):
JavaScript built-in pages (Phase A)
Cornea can execute inline <script> that builds its DOM via a minimal shim,
then run the result through the same deterministic layout engine:
- Static HTML is mirrored into the shim before scripts run, so scripts can
attach to existing nodes via
document.getElementById, andinnerHTMLparses real markup into elements. Static content survives script runs. style.*assignments are serialized back tostyle="…"and participate in overlap/contrast checks.- Async APIs are rejected (
setTimeout,fetch, …) rather than hung. Any such use is surfaced in the report'sjs_notes, so determinism stays a guarantee. - External
<script src>runs only when a capture layer (URL capture) inlined its body first. - Full React/SPA mounting is Phase B (experimental). Tracked in
ROADMAP-JS.md.
Visual guide: testing (battle-tested)
54 tests run clean with cargo test; CI enforces fmt, clippy -D warnings, release build, tests, and a CLI smoke test on every push.
- Determinism. Same page inspected twice gives byte-identical JSON (the core thesis).
- Bug detection. The fixture's overlaps, overflows, and contrast failures are all asserted.
- End-to-end. The compiled binary is spawned and
layout.*is called over real stdio MCP. - HTTP. The TCP server boots on an ephemeral port and real requests are made.
- Live capture. A real page is served over a local socket; linked CSS must change a contrast verdict.
- Edge cases. Empty HTML, deep nesting (no crash),
display:none, long text, flex row/col, inline wrapping.
Layout support (v1 scope)
Repository layout
Status
Working MVP, hardened and battle-tested. Deterministic inspection engine with CLI + MCP + HTTP API, live URL capture, below the fold checks, report warnings, 54 passing tests, green CI, plus Phase A inline-script rendering (--js). The roadmap builds toward giving Cornea (and the sibling Crayon text-to-image project) an even richer perception over subsequent phases.
Publishing
Cornea is distributed four ways: npm (npm install -g optrex, gives the cornea command), crates.io (cargo install cornea), GitHub Release + Homebrew (brew install), and the MCP Registry (layout.* tools discoverable by agents). All are staged in this repo. See PUBLISHING.md for the tokens, server.json manifest, and the release/tag recipe.
mcp-name: io.github.AbduljabbarBXR/cornea
License
MIT. See LICENSE.
Source: README.md at commit 97cae15
Tools
0Version history
1- v0.2.2LatestSep 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
Other Deterministic integrations
Deterministic
sh.deterministicOfficial publisher
A remote MCP server that gives an assistant physics-based validation of simulation results, returning receipts with per-check verdicts.
EU EN-16931 & XRechnung Deterministic Validator
eu.iotpay
Remote MCP endpoint that validates EN 16931 and XRechnung e-invoice XML and issues signed Ed25519 verifiable credentials.

Website Change Monitor & Deterministic Diff
Published by GitHub account industrial-platform-ai
Paid remote MCP service that detects deterministic changes in public web pages, returning hashes and text diffs for recurring monitoring.

SQAI — deterministic, read-only structured data
Published by GitHub account thyn-ai
A local stdio MCP server that gives an assistant governed, deterministic, read-only query and computation tools over structured data sources such as CSV files.

Deterministic
Published by GitHub account archradhq
ArchRAD Deterministic validates architecture graphs (IR) against deterministic lint rules, drafts IR from repos, and checks design-versus-code drift.