Accessible Color Contrast MCP

Accessible Color Contrast MCP

ryelle

Calculates WCAG color contrast ratios between color pairs and validates whether they meet accessibility standards for readable text.

Enables checking WCAG color contrast ratios and accessibility compliance between color pairs. Helps determine optimal text colors for backgrounds and validates color combinations meet accessibility standards.

2126 views1Local (stdio)

What it does

  • Calculate WCAG contrast ratios between any two colors
  • Test color combinations for AA/AAA accessibility compliance
  • Recommend light or dark text colors for given backgrounds
  • Accept colors in hex, RGB, HSL, or named color formats
  • Validate text readability at different font sizes

Best for

Web developers ensuring accessible color schemesUI/UX designers validating contrast complianceCreating WCAG-compliant themes and interfaces
No API key neededSupports multiple color formatsWCAG AA and AAA level testing

About Accessible Color Contrast MCP

Accessible Color Contrast MCP is a community-built MCP server published by ryelle that provides AI assistants with tools and capabilities via the Model Context Protocol. Quick color contrast checker to validate WCAG color contrast with a contrast ratio checker — find accessible color combo It is categorized under developer tools, design.

How to install

You can install Accessible Color Contrast MCP in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Accessible Color Contrast MCP is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Accessible Color Contrast MCP

README imageLink to npmjs.com README imageLink to github.com

A simple MCP (Model Context Protocol) server for checking accessible color pairings. This uses the WCAG (Web Content Accessibility Guidelines) contrast algorithm to calculate real contrast ratios, which can inform your AI when working with colors.

More about WCAG Contrast requirements

Setup

Add this to your AI platform:

{
	"mcpServers": {
		"accessibility": {
			"command": "npx",
			"args": ["-y", "a11y-color-contrast-mcp"]
		}
	}
}

Note, if you use nvm, you might need to use the path to the correct node and npx versions (24), for example:

"accessibility": {
  "command": "/path-user-home/.nvm/versions/node/v24.12.0/bin/node",
  "args": ["/path-user-home/.nvm/versions/node/v24.12.0/bin/npx", "-y", "a11y-color-contrast-mcp"]
}

Example Usage

  • What is the contrast between #481bef and #c3eecb?
  • If I have a background color #22d3ee, should I use light or dark text on it?
  • What color text should I use for a background #6a4ba7 if I need to meet WCAG AAA level support?
  • Can you suggest 3 color pairs that are accessible? The colors should not be black or white, and should be reminiscent of fall.

Available Tools

Get Color Contrast

Get the WCAG contrast value between two colors.

Parameters

  • colorA (required): First color (hex, rgb, hsl, or named color).
  • colorB (required): Second color (hex, rgb, hsl, or named color).

Are Colors Accessible

Test two colors for WCAG accessible contrast.

Parameters

  • colorA: First color (hex, rgb, hsl, or named color).
  • colorB: Second color (hex, rgb, hsl, or named color).
  • level: WCAG level to test against, AA or AAA. Default "AA".
  • size: Font size of text, larger font has a lower threshold. Can be small or large. Default "small".

Use Light or Dark

Detect whether to pair a light or dark color against a given color for best contrast.

Parameters

  • color: Color (hex, rgb, hsl, or named color).
  • level: WCAG level to test against, AA or AAA. Default "AA".
  • size: Font size of text, larger font has a lower threshold. Can be small or large. Default "small".

Development

This package contains a stdio and an http server, though the stdio is the recommended method for interacting with it.

Requirements

  • Node 18+

Install the dependencies with npm install. The MCP server itself lives in src/server.ts, with the stdio server in index.ts and the http server in http.ts.

Scripts

  • npm run build: Builds the src files into build.
  • npm run stdio: Builds the src files, then starts the stdio server.
  • npm run http: Builds the src files, then starts the http server.
  • npm run test: Run the Jest tests.

http server

This is a work in progress while I figure out if it's worth setting up as a remote server. For now, it's developer-only. Once running (see above), you can access this on port 3000.

Here's an example interaction you can test with a tool like Insomnia.

POST http://localhost:3000/mcp

{
	"jsonrpc": "2.0",
	"method": "tools/call",
	"params": {
		"name": "get-color-contrast",
		"arguments": {
			"colorA": "#ff0000",
			"colorB": "#ffffff"
		}
	},
	"id": 1
}
HTTP/1.1 200 OK
Content-Type: text/event-stream

event: message
data: {"result":{"content":[{"type":"text","text":"4.00"}]},"jsonrpc":"2.0","id":1}

Alternatives

Related Skills

Browse all skills
color-palette

Generate complete, accessible color palettes from a single brand hex. Creates 11-shade scale (50-950), semantic tokens (background, foreground, card, muted), and dark mode variants. Includes WCAG contrast checking for text accessibility. Use when: setting up design system, creating Tailwind theme, building brand colors from single hex, converting designs to code, checking color accessibility.

2
standards-accessibility

Build accessible user interfaces using semantic HTML, proper ARIA attributes, keyboard navigation, color contrast, and screen reader compatibility. Use this skill when creating or modifying frontend components, HTML templates, React/Vue/Svelte components, forms, interactive elements, navigation menus, modals, or any UI elements. Apply when working with HTML files, JSX/TSX components, template files, ensuring keyboard accessibility, implementing focus management, adding alt text to images, creating form labels, testing with screen readers, managing ARIA attributes, maintaining color contrast ratios, or building heading hierarchies. Use for any task involving UI accessibility compliance, WCAG standards, or inclusive design patterns.

1
penpot-uiux-design

Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".

19
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
elegant-design

Create world-class, accessible, responsive interfaces with sophisticated interactive elements including chat, terminals, code display, and streaming content. Use when building user interfaces that need professional polish and developer-focused features.

17
ui-styling

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.

9