OKLCH Studio
Developer tools: contrast API, MCP server and bookmarklet
The colour maths behind the contrast checker is available to code. A single GET endpoint returns WCAG and APCA results as JSON in the same shape as WebAIM's, an MCP server lets AI assistants call the same functions as tools, and a bookmarklet runs the same WCAG check on any page you are looking at. All three are free, need no key, and are documented here.
Contrast checker API: WebAIM-compatible JSON with WCAG and APCA
GET /api/contrast: WebAIM's response fields, plus APCA Lc and a lightness-only fix. No key, CORS open.
Colour and contrast MCP server: tools for AI assistants
POST /api/mcp: 9 colour and contrast tools for MCP clients. No key.
Contrast checker bookmarklet: find failing text on any page
Drag it to your bookmarks bar, click it on any page: failing text is outlined and listed. Runs locally.
Machine-readable descriptions
- openapi.json: OpenAPI description of the HTTP endpoints, including
/api/contrast. - MCP server card: discovery file for the MCP server.
- llms.txt: a map of the site for language models.
Contrast checker →WCAG 2.2 vs APCA →All guides →
FAQ
- Do I need an API key?
- No. Neither the contrast API nor the MCP server needs a key or an account. There is no service-level agreement, so cache results and fail soft.
- Which should I use, the API or the MCP server?
- Use the contrast API from scripts, CI jobs and web pages: it is a plain GET with CORS enabled. Use the MCP server when you want an AI assistant to call colour tools itself, including converting colours, fixing a failing pair and exporting palettes.
- Is the contrast API compatible with WebAIM's?
- The parameter names and the five result fields (ratio, AA, AALarge, AAA, AAALarge) match WebAIM's JSON mode. The response adds a colorise object with APCA Lc and a suggested fix.
- Are the results a legal accessibility audit?
- No. They are informational WCAG 2.x and APCA readouts. Which standard applies to you depends on your jurisdiction and contract.