Free · Offline · MIT licensed · Rust CLI + MCP

uivalid — Free Open-Source UI Layout Validator CLI for AI Agents

uivalid — Figma Layout Checker for AI Agents: Check any Figma layout in one command instead of pasting the whole Figma JSON into the chat — overlap, contrast, spacing and text-overflow errors as machine-readable JSON, using 13.9× fewer tokens, offline and free.

Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/uivalid. Validate and export run 100% offline — only fetch calls the Figma API, with a token you supply.

Note: uivalid's Figma fetch needs your own Figma token; everything else is 100% offline, no key needed.

A layout debugger that talks to your agent

validate reports sibling overlap, WCAG 2.1 contrast, 4pt-grid and gap spacing, text overflow, children outside their parent frame and zero-size nodes — as machine-readable JSON the agent can act on, not a screenshot to squint at. Exits 1 on errors, so it works in CI as-is.

# Validate a layout tree you already have
uivalid validate examples/layout.json --json

# Or validate a Figma file directly (see fetch below)
uivalid validate layout.json --from-figma

Real output of validate on the broken sample layout:

[ERROR] out-of-bounds Badge — child extends past its parent 'Screen'
[WARN ] overlap Card A ↔ Card B — siblings overlap by 24×120pt (15% of the smaller node)
[WARN ] spacing-gap Chip 2 ↔ Chip 3 — gap 32pt differs from the row median 8pt by more than 4pt
[ERROR] contrast Hint — contrast 2.85:1 is below WCAG AA (4.5:1) — text 'Optional' on #FFFFFF
[ERROR] text-overflow Long heading — text needs ~120pt of height (5 line(s) at 20pt) but the box is only 20pt tall
[INFO ] spacing-grid Badge — x = 350.0 is not on the 4pt grid
[WARN ] zero-size Divider — node has zero size (340×0)
12 node(s): 3 error(s), 3 warning(s), 2 info

Reads Figma the supported way

fetch calls the official Figma REST API with your own Personal Access Token and returns the document JSON; validate --from-figma checks it directly. No .fig files, ever — .fig is Figma proprietary and Figma advises against third-party tools reading it.

# Fetch a Figma file through the official REST API (your own token)
export FIGMA_TOKEN=<your-personal-access-token>
uivalid fetch --file-key abc123 -o layout.json

# Then validate it
uivalid validate layout.json --from-figma

# Or export the checked layout as React, HTML or normalized JSON
uivalid export examples/layout.json --format react -o Screen.jsx

Only fetch touches the network (api.figma.com, with your token). validate and export are 100% local.

Install in one minute

Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:

cargo install --git https://github.com/creatorops-studio/uivalid

Prefer a ready-made binary? Download the Release v0.1.0 binary for Linux x86_64 (2,744,392 B) from github.com/creatorops-studio/uivalid/releases/tag/v0.1.0. Check it runs: uivalid --version prints 0.1.0.

Measured numbers, not marketing

Measured 5 December 2026 on Linux x86_64, release build, with uivalid benchmark. Timings are single-operation runs on the sample layouts (tests/fixtures/good.json, 9 nodes; bad.json, 12 nodes); each command was run 4 times and the range is shown. Tokens ≈ characters / 4 (standard approximation, same rule both sides); the Figma JSON is the real GET /v1/files/:key response shape for the sample file, kept verbatim in the repo so the comparison is reproducible.

What was measuredResult
Token cost to check one screen40 tokens (2 commands + report) vs 555 tokens (pasting the Figma JSON) — 13.9× saving
Validate 9-node clean layout0.030–0.063 ms
Validate 12-node broken layout0.032–0.043 ms
Peak RSS3,736–3,768 KB (~3.7 MB)
Binary size (release, stripped)2,744,392 B (2.62 MiB)

Built for AI agents first

MCP server with three tools (validate_layout, fetch_figma_file, export_layout). Add this to your MCP config — no browser, no cloud:

{
  "mcpServers": {
    "uivalid": {
      "command": "uivalid",
      "args": ["mcp"]
    }
  }
}

Checking one screen used to cost an agent 555 tokens of pasted Figma JSON; with uivalid it costs 40 tokens (two commands + the report, 13.9× saving, measured — see the repo README for the full benchmark). Example agent flow: fetch_figma_file → validate_layout → fix the issues → export_layout to React.

Built with: Rust, a single static binary, and an MCP server — clap + serde_json (plus ureq, used only by fetch to call the Figma REST API).

Free, offline, MIT

Single static binary, no cloud, no account. Validate and export are 100% local — only fetch calls api.figma.com, and only with a Figma token you supply yourself. Free core is 80% of a real layout tool; Pro (coming later, $10–29/month) adds rule packs, a Cloud API check per PR/commit and a Figma plugin companion.

Frequently asked questions

Is uivalid really free?

Yes — MIT licensed, free core forever. Pro is a separate paid tier for rule packs / API features.

Does it work offline?

Yes. Validate and export are 100% local; only fetch calls api.figma.com, with a token you supply.

Does it read .fig files?

No — .fig is Figma proprietary. It reads Figma through the official REST API instead.

Does it write Figma files?

No — the REST API cannot write design content. It exports React, HTML and JSON.

How do I use it with Claude Code?

Add the MCP server block from the repo README to your MCP config; the agent gets validate_layout, fetch_figma_file, export_layout.

How do I install it?

Run cargo install --git https://github.com/creatorops-studio/uivalid (needs a Rust toolchain), or download the Release v0.1.0 binary for Linux x86_64 (2,744,392 B) from the v0.1.0 release. The crate is not on crates.io yet.

Validate a layout in one command.

Free, offline, MIT licensed — get the source on GitHub.