v2 truth layer: accessibility MCP tool (WCAG contrast) — works on Claude and Gemini#28
Closed
Owl-Listener wants to merge 1 commit into
Closed
v2 truth layer: accessibility MCP tool (WCAG contrast) — works on Claude and Gemini#28Owl-Listener wants to merge 1 commit into
Owl-Listener wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/failcheck_palette— many pairs (a whole screen or aDESIGN.mdpalette) → results + summarystructuredContent.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)
server.jsover stdio, lists the tools, and calls them, asserting correct evidence. This proves it speaks the protocol, not just that the file parses.check-mcp-tools.yml); repo nets (consistency, routing) still pass;node_modulesgitignored, lockfile committed.Also
design-md's accessibility overlay to measure via this tool rather than estimate contrast from hex.Honest notes
Generated by Claude Code