Skip to content

v2 truth layer: accessibility MCP tool (WCAG contrast) — works on Claude and Gemini#28

Closed
Owl-Listener wants to merge 1 commit into
mainfrom
claude/v2-mcp-accessibility
Closed

v2 truth layer: accessibility MCP tool (WCAG contrast) — works on Claude and Gemini#28
Owl-Listener wants to merge 1 commit into
mainfrom
claude/v2-mcp-accessibility

Conversation

@Owl-Listener

Copy link
Copy Markdown
Owner

What this is

The first piece of v2's architecture: turning a checkable claim from narrative into evidence. Designpowers asserts designs are "accessible"; this measures it. It's the first "truth-layer" tool — and it's built as an MCP server, so it works with any MCP client: Claude and Gemini (the hard constraint you set).

Why it matters (the "seam")

Most of Designpowers is prose an LLM performs — and most of that should stay prose, because it's judgment (taste, craft). But some claims have a checkable answer, and contrast is the sharpest example. This replaces "the reviewer says it's accessible" with "the Save button is 2.19:1 — FAIL AA," no guesswork. That's the v2 principle in one tool: prose for judgment, real tools for truth.

What's here (mcp-tools/accessibility/)

  • wcag.js — pure, zero-dependency WCAG 2.2 logic (relative luminance, contrast ratio, AA/AAA thresholds incl. the 3.0 large-text/UI rule). The truth, deliberately split from the protocol plumbing so it's unit-testable on its own.
  • server.js — thin MCP adapter exposing two tools:
    • check_contrast — one fg/bg pair → ratio + AA/AAA pass/fail
    • check_palette — many pairs (a whole screen or a DESIGN.md palette) → results + summary
    • both return human-readable text and structuredContent
  • README — wiring instructions for both Claude (.mcp.json) and Gemini CLI (settings.json) — identical command, because nothing is Claude-specific.

Model-agnostic by construction

This is the proof that v2 can satisfy "must work on Gemini and Claude": the tool speaks MCP, which both clients support. The orchestration-engine choice (Claude SDK vs. LangGraph vs. per-runner) is still open and deferred — but the valuable truth-layer is portable today.

Verification (16/16, and it really speaks MCP)

  • 11 pure-logic tests — verified against WCAG reference values (black/white = 21:1) and the exact by-hand numbers from our earlier smoke-tests (Save grey = 2.19, FAIL).
  • 5 live MCP round-trip tests — a real MCP client launches server.js over stdio, lists the tools, and calls them, asserting correct evidence. This proves it speaks the protocol, not just that the file parses.
  • CI added (check-mcp-tools.yml); repo nets (consistency, routing) still pass; node_modules gitignored, lockfile committed.

Also

  • Wired design-md's accessibility overlay to measure via this tool rather than estimate contrast from hex.

Honest notes

  • This is additive and changes no existing user behavior — the tool is opt-in (wire it into your MCP config to use it).
  • It covers the checkable slice of accessibility (contrast). ARIA/focus/target-size are future tools; "is the hierarchy clear" stays judgment. The win is that the contrast slice stops being faked.
  • I verified the MCP round-trip locally; CI will confirm it on a clean runner (first run of this workflow).

Generated by Claude Code

The first piece of v2's 'seam' — turning a checkable claim from narrative into
evidence. Designpowers asserts things are 'accessible'; this measures it.

mcp-tools/accessibility/:
- wcag.js — pure, zero-dependency WCAG 2.2 contrast logic (relative luminance,
  contrast ratio, AA/AAA thresholds incl. large-text/UI 3.0). The 'truth',
  deliberately separate from the protocol plumbing so it's unit-testable.
- server.js — thin MCP adapter exposing check_contrast (one pair) and
  check_palette (many). Returns human-readable text + structuredContent.
- Tests: 11 pure-logic checks (verified against WCAG reference values — black/
  white=21:1 — and the by-hand smoke-test numbers) + 5 live MCP round-trip
  checks (real client launches the server over stdio, lists tools, calls them).
  16/16 green.

Speaks MCP, so it works with ANY MCP client — Claude AND Gemini (README shows
identical wiring for both). This satisfies the hard 'must work on both'
constraint: the tool is model-agnostic by construction, nothing Claude-specific.

Also: wired design-md's accessibility overlay to MEASURE via this tool rather
than estimate contrast from hex; added CI (check-mcp-tools.yml); gitignore for
node_modules. Repo nets (consistency, routing) still pass.
@Owl-Listener Owl-Listener marked this pull request as ready for review May 31, 2026 17:05
@Owl-Listener Owl-Listener deleted the claude/v2-mcp-accessibility branch June 2, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants