Skip to content

feat: MCP server so AI agents can proof colors - #42

Merged
CodeBrauer merged 3 commits into
mainfrom
feat/mcp-server
Dec 2, 2026
Merged

CodeBrauer merged 3 commits into
mainfrom
feat/mcp-server

Conversation

@CodeBrauer

Copy link
Copy Markdown
Owner

Closes #39

What

hueproof-mcp, an MCP server that brings Hueproof's checks to AI agents
(Claude Code, Claude Desktop, Codex, Cursor and other MCP clients). It lives in mcp/ as a pnpm workspace
package, runs on the agent's machine over stdio and reuses src/lib/color/ without color logic of its own.
The site stays a static export.

Tool Returns
check_contrast WCAG 2 ratio and APCA Lc per text/background pair, the level reached, fixes for near misses
analyze_palette Contrast of every pair, confusable and marginal pairs under each simulated vision type with fixes (locked colors stay), largest safe set, warm/cool balance, roles, a Hueproof link
fix_contrast The smallest OKLCH lightness change of text or background that reaches a level
simulate_vision The colors under normal vision and seven deficiencies
color_info Name, family, temperature, notations, readable text color, shades, tints, tones, harmonies

Server instructions ask the agent to check colors before it presents them. Prompts: review-palette,
audit-project-colors, chart-palette.

Notes

  • src/lib/site.ts gets LIVE_SITE_URL for the palette link, since SITE_URL falls back to localhost outside a
    site build.
  • tsdown bundles the package; dependencies stay regular npm dependencies, except color-name-list (19 MB),
    of which only the list the server reads is bundled.
  • The package has the site's version. docs/recipes.md now bumps both and publishes with
    pnpm --filter hueproof-mcp publish; npx -y hueproof-mcp works after that first publish.
  • CI also builds the package.

Testing

  • mcp/src/server.test.ts calls every tool and prompt through an in-memory client, including invalid input.
  • Installed from the packed tarball and spoke to the binary over stdio with protocol version 2025-06-18.
  • In Claude Code with a local build: asked for six chart colors on white without naming Hueproof; the agent
    called analyze_palette, check_contrast, fix_contrast and simulate_vision on its own and returned the
    link.
  • Lint, typecheck, tests, site build and package build pass.

🤖 Generated with Claude Code

CodeBrauer and others added 2 commits November 30, 2026 23:36
Adds the npm package hueproof-mcp in mcp/, a pnpm workspace package that runs over stdio and reuses src/lib/color/. Tools: check_contrast, analyze_palette, fix_contrast, simulate_vision, color_info. Server instructions ask agents to check colors before presenting them; prompts review-palette, audit-project-colors and chart-palette. The site stays a static export.

Refs #39

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #39

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CodeBrauer CodeBrauer added the enhancement New feature or request label Nov 30, 2026
@CodeBrauer
CodeBrauer marked this pull request as ready for review December 2, 2026 22:57
@CodeBrauer
CodeBrauer merged commit 7e5db74 into main Dec 2, 2026
7 checks passed
@CodeBrauer
CodeBrauer deleted the feat/mcp-server branch December 2, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP server so AI agents can proof colors

1 participant