CI-friendly accessibility audit for chart color palettes: WCAG contrast, CVD simulation, OKLab ΞE.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Accessibility audit for chart color palettes. Answers one question with math: can everyone still tell your data series apart?
Plenty of tools check text contrast. This one checks the thing dashboards actually break: whether your palette survives colorblindness. It simulates deuteranopia, protanopia, and tritanopia with the published Machado, Oliveira & Fernandes 2009 matrices, measures pairwise separation in OKLab, checks WCAG 2.2 contrast against your background, and fails your build when a change quietly breaks any of it.
| you are | you want | go to |
|---|---|---|
| a designer with a palette in hand | a verdict right now, nothing installed | 1 Β· Try a palette |
| a team with tokens in a repo | the build to fail when a color change breaks accessibility | 2 Β· Gate your CI |
| an engineer building tooling | the audit as a typed function | 3 Β· Call it from code |
| working with Claude or another agent | the audit as an MCP tool | 4 Β· Wire it into an agent |
Those three colors separate cleanly under every colorblind simulation. The orange still fails: 2.42:1 against white, below the 3:1 floor for chart marks. Pale bars on white is one of the oldest dashboard sins, and this is it, caught in numbers.
Exit codes: 0 pass, 1 fail, 2 bad input. That is the whole CI
contract.
ΞE is perceptual color distance (OKLab Γ 100). About 2 is the edge of what a human eye can tell apart.
| reading | min ΞE | meaning |
|---|---|---|
| clearly distinct | β₯ 10 | survives a projector and a hallway glance |
| distinguishable | β₯ 2 | a careful reader separates the series |
| patterns carry identity | < 2 | color alone is not enough; dash/shape must carry it |
| COLLISION | β 0β1 | two series are the same color for these viewers |
closest pair names the two slots (1-based) that came nearest. Fix those
two, re-run, repeat.
| flag | what it does |
|---|---|
--colors <list> | comma-separated palette, any CSS color syntax: hex, hsl(), rgb(), oklch(), named, raw triples ("222 47% 6%") |
--bg <color> | background the marks render on |
--mode <mode> | perceptual (default) Β· redundant-encodings Β· strict (see Floors) |
--config <path> | config file, default ./chartaudit.config.json |
--json | full result as JSON: verdict, failures[], perVision[], contrast[], semantic[], text[] |
--version, --help | the usual |
Two files, no dependencies added.
Step 1. Put chartaudit.config.json in your repo root, pointed at the
tokens you already have:
Step 2. Add the workflow:
Done. A token edit that breaks a floor now exits 1 with named findings, in the PR, before anyone screenshots anything.
Prefer a pinned dependency? npm i -D chart-color-audit and call it from a
package script. Same behavior.
That is Tableau 10, one of the most-shipped chart palettes on earth, on a white dashboard:
Its red and green sit ΞE 0.7 apart under deuteranopia simulation. Roughly 1 in 12 men has red-green color vision deficiency; for most of them, series 3 and series 5 on that chart are the same color. Nothing in code review catches this. Math does.
Fully typed. Two data dependencies (culori for color math, the MCP SDK for the server). No DOM, no network.
Let an agent audit colors mid-conversation:
Two tools: audit_palette (paste colors) and audit_tokens (point at a
config). Ask "is this palette colorblind-safe on white?" and the answer
comes back with measurements instead of vibes.
| mode | fails when | for |
|---|---|---|
perceptual (default) | any pair lands below ΞE 2, the edge of human perception, under any simulation; or contrast < 3:1 | palettes where color alone carries identity |
redundant-encodings | outright collision only (ΞE < 1 normal / < 0.1 CVD) | design systems pairing every color with a dash/decal/shape channel |
strict | below ΞE 10 normal / ΞE 4 CVD | control rooms, projectors, hallway glances |
Text tokens are checked at 4.5:1 in every mode. Changing default floors is a major version, always: a CI gate that tightens defaults in a patch release breaks builds and trust.
Tokens in, findings out. This audits declared palette colors. It does not render charts, screenshot pixels, or crawl pages. Contrast checkers for text exist in plenty; what this adds is the part I could not find anywhere else: CVD-simulated series separation, as a build gate and an MCP tool.
The engine was extracted from a chart color system whose own history proves the point: an "accuracy fix" commit once replaced the correct deuteranopia matrix with confident, plausible, fabricated values, and review passed it. Only a pinned regression test would have caught it, so this package pins the matrices against the published paper in its test suite, permanently.
The full story: docs/POSTMORTEM.md: nine weeks of a wrong matrix, the AI-co-authored commit that forged it, and why the math now checks the math.
I audit dashboards and design systems for exactly these failures. 30 years of UX practice, and the math above to prove findings instead of arguing them. micah@conscious-shell.com
MIT Β© Micah Boswell
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/chart-color-audit)<a href="https://allmcps.com/mcp/chart-color-audit"><img src="https://allmcps.com/api/badge/chart-color-audit?style=directory" alt="Chart Color Audit on AllMCPs" /></a>