ContrastKit

Check text and background colors against WCAG 2.x AA and AAA, get the nearest accessible color, convert CSS colors and check a whole palette of up to 12 colors. Free, with no sign-up and no API key; about 60 checks per minute per IP. Nothing you submit is stored. ContrastKit is not affiliated with the W3C or WebAIM.

Hosted MCP Server

npx add-mcp 'https://contrastkit.mike-tusa.workers.dev/mcp'

Installs into Claude Code, Codex, Cursor and more

Documentation

ContrastKit

Check a text color against its background for WCAG AA and AAA, and get the closest color that passes if it doesn't. Hex, rgb(), hsl() and color names all work. Nothing you type is stored.

How it's measured

Contrast ratio = (L1 + 0.05) / (L2 + 0.05) with WCAG 2.x relative luminance (sRGB). Levels: aa 4.5:1, aa-large 3:1, aaa 7:1, aaa-large 4.5:1, ui 3:1 (aa = SC 1.4.3 normal text, aa-large = 18pt / 14pt bold text, aaa = SC 1.4.6, ui = SC 1.4.11 non-text). Ratios are floored to 2 decimals and pass/fail uses the exact value, so 4.499:1 fails AA. A translucent foreground is blended over the background; a translucent background is blended over white. See WCAG 2.2 success criterion 1.4.3.

Colors: #rgb, #rgba, #rrggbb, #rrggbbaa (the # may be omitted; URL-encode it as %23), rgb()/rgba() and hsl()/hsla() in comma or space syntax with optional alpha (0-1 or %), the 148 CSS color names and transparent. Max 64 characters per color. Not supported: lab(), lch(), oklch(), color(), currentColor, system colors.

JSON API

curl -s 'https://contrastkit.mike-tusa.workers.dev/api/contrast?fg=%23777777&bg=%23ffffff'
curl -s 'https://contrastkit.mike-tusa.workers.dev/api/suggest?fg=%23777777&bg=%23ffffff&level=aa'

Routes: /api/contrast, /api/suggest, /api/convert and /api/palette (up to 12 colors). No key needed: about 60 requests per minute per IP. OpenAPI 3.1 spec

For AI agents

ContrastKit is also a remote Model Context Protocol (MCP) server with four read-only tools: check_contrast, suggest_accessible_color, convert_color and check_palette. Works with AI agents and assistants that can call an MCP server or a JSON API, for example Muse, Claude, ChatGPT or Cursor (descriptive only). Most MCP clients accept this config; some use a different format (for example, VS Code uses a servers key).

{ "mcpServers": { "contrastkit": { "type": "http", "url": "https://contrastkit.mike-tusa.workers.dev/mcp" } } }

Machine-readable docs: llms.txt · OpenAPI 3.1 spec · MCP server card. ContrastKit is not affiliated with, endorsed by or sponsored by the W3C, WebAIM, Meta, Anthropic, OpenAI or Anysphere. WCAG is a W3C standard; a passing ratio is one part of accessibility, not a full audit.