
Contrast Checker Mcp
io.github.ogSINGHPublished by GitHub account ogSINGHv1.0.1Updated Oct 24, 2026
MCP - WCAG 2.1 color contrast checker - contrast ratios, compliance and accessible color suggestions
Overview
A local MCP server that lets an assistant check WCAG 2.1 color contrast ratios, test accessibility compliance, and suggest accessible replacement colors.
- What you can do
- Check the contrast ratio between a foreground and background color and see WCAG 2.1 AA/AAA pass or fail results, including alpha-composited effective colors and parsed values. Suggest a replacement foreground or background color that meets an AA or AAA target while staying close to the original hue. Parse a color string into hex, rgb and hsl formats. Accepts hex, rgb/rgba, hsl/hsla and CSS named colors.
- When to use it
- Useful when designing or reviewing UI colors, text and backgrounds and you want quick, WebAIM-consistent WCAG 2.1 accessibility checks and concrete fix suggestions without leaving the assistant.
- Requirements
- Runs as a local process over stdio, typically launched with npx from the npm package contrast-checker-mcp, so Node.js and network access for the package are needed. No authentication, environment variables or headers are declared.
Installation
In SourceWeft
- Open Contrast Checker Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
contrast-checker-mcp
An MCP server that provides color contrast checking tools for AI assistants. Verify WCAG 2.1 accessibility compliance, compute contrast ratios with alpha transparency support, and get accessible color suggestions — all via the standard Model Context Protocol.
Contrast calculations match WebAIM's contrast checker — including alpha compositing, WCAG 0.03928 sRGB threshold, and truncated (not rounded) ratios.
Tools
check_contrast
Check the contrast ratio between two colors and evaluate WCAG 2.1 compliance.
Inputs:
foreground— Foreground color (e.g.#333,rgb(0,0,0),rgba(0,0,0,0.5),navy)background— Background color (e.g.#fff,rgb(255,255,255),white)
Output: Contrast ratio, WCAG 2.1 pass/fail results (AA normal, AA large, AAA normal, AAA large), parsed color values. When the foreground has alpha, shows the effective composited color used for the calculation.
suggest_accessible_color
Suggest a replacement color that meets a WCAG contrast target, keeping the hue as close to the original as possible.
Inputs:
foreground— Foreground colorbackground— Background colortarget_level—"AA"or"AAA"(default:"AA")fix—"foreground"or"background"(default:"foreground")
Output: A suggested replacement color (in hex, rgb, hsl) that meets the target level, along with the new contrast ratio.
parse_color
Parse a color string and return it in multiple formats.
Inputs:
color— Color to parse (e.g.#ff6600,rgb(255,102,0),tomato)
Output: The color in hex, rgb, and hsl formats.
Supported Color Formats
- Hex:
#rgb,#rrggbb,#rgba,#rrggbbaa - RGB:
rgb(r, g, b),rgba(r, g, b, a) - HSL:
hsl(h, s%, l%),hsla(h, s%, l%, a) - CSS named colors:
red,cornflowerblue,rebeccapurple, etc.
Setup
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code
Cursor / VS Code
Add to .cursor/mcp.json or .vscode/mcp.json:
From source
Examples
Black on white — 21:1 ratio, all WCAG levels pass:
Semi-transparent text — alpha composited onto background before checking:
Fix a failing color pair:
License
Apache-2.0
Source: README.md at commit 03d231e
Tools
0Version history
1- v1.0.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts