Skip to content
Get the free beta

Color Tools: Agent Access

Five deterministic operations are available through browser controls, JavaScript, HTTP, command line, and MCP. No account or API key is required. The WordPress plugin is specific to caifrazier.com; the downloadable calculation kit can run offline.

Start here

Choose how you want to run one contrast check. Every example below checks black text on white: expect status ok, ratio 21, and all four text thresholds passing. Inspect the result status before using its values.

Quick start: browser

Open the prepared contrast checker. The ratio is 21:1. Choose Show JSON or Copy JSON to inspect the same result. Change a color and use Copy link to preserve the new pair. You can reveal Advanced / JSON from the normal interface without losing unfinished edits.

https://caifrazier.com/tools/wcag-contrast-checker/?text=000000&bg=FFFFFF&agent=1

Quick start: HTTP

Run this in a shell with curl. No credentials are needed. The response has operation checkContrast, status ok and result.contrast.ratio equal to 21.

curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast?text=000000&background=FFFFFF'

Quick start: offline

Use Node.js 22 or newer, curl and unzip. Run these commands in an empty working folder. The download step needs network access; the calculation runs locally without an account, npm install or telemetry. The output is the same checkContrast envelope with ratio 21.

curl -fsS 'https://caifrazier.com/wp-content/plugins/cf-color-tools/assets/access/color-tools-sdk.zip' -o color-tools-sdk.zip
unzip color-tools-sdk.zip
cd color-tools
node access/cli.cjs checkContrast --text 000000 --background FFFFFF

Quick start: MCP

For a compatible Streamable HTTP client, use the endpoint below with no authentication. Ask it to call checkContrast with text 000000 and background FFFFFF. Inspect structuredContent.status and structuredContent.result.contrast.ratio; expect ok and 21. Client configuration differs, so this is an endpoint, not a universal client configuration file.

https://caifrazier.com/wp-json/cf-color-tools/v1/mcp

To try the complete remote lifecycle directly, run these three shell requests in order. The first returns protocolVersion 2025-11-25, the notification returns an empty HTTP 202 body, and the last returns the contrast result in structuredContent.

curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/mcp' -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"color-tools-quickstart","version":"1"}}}'
curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/mcp' -H 'Content-Type: application/json' -H 'MCP-Protocol-Version: 2025-11-25' --data '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/mcp' -H 'Content-Type: application/json' -H 'MCP-Protocol-Version: 2025-11-25' --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"checkContrast","arguments":{"text":"000000","background":"FFFFFF"}}}'

For local MCP, download the offline kit and follow the stdio setup. Local MCP also runs without telemetry.

Discovery and downloads

Browser controls and automation

Use the labeled hex fields and ordinary buttons. The normal interface offers Copy link, a selectable Share URL, Reset and an Advanced / JSON action that reveals the current report in place. Add agent=1 to the page query string to reveal Show JSON, Copy JSON and the API documentation link on entry (for example, ?agent=1&text=FFFFFF&bg=888888). These agent controls are hidden until requested. Copy failures expose a labeled manual-copy textarea. Canvas interaction is optional: the picker has numeric Hue, Saturation and Lightness controls. Its canvas and repair target AA normal text (4.5:1); a failing selection remains inspectable and has a repair button.

The root IDs are cf-contrast-checker, cf-color-picker and cf-color-scale. Wait for data-state="ready" or data-state="invalid" and aria-busy="false". In agent=1 mode, read the textarea with ID ROOT-json after clicking Show JSON, or locate its label, JSON result. DOM-capable clients can read the same textarea value without opting in; it is populated but hidden in the normal UI. Other stable IDs are ROOT-show-json, ROOT-copy-json, ROOT-copy-link, ROOT-share-url and ROOT-reset. JSON contains the operation envelope plus tool and shareUrl. Invalid input clears result and shareUrl. An unfinished scale draft is invalid until corrected even though existing scales remain visible. The scale report contains committed colors. Reset restores defaults without changing the address bar.

Links prefill checker text/bg, picker base/selected, and repeated scale color parameters. Hex values can omit #. Scale order and duplicates are preserved, up to 20 colors. Editing does not update browser history. Use the current Share URL, not the address bar, to capture edits. Malformed URL values produce notices and safe defaults; inspect notices before assuming every requested color was loaded.

Contextual tool links carry the current pair or selected seed. The scale grid uses text colors in rows and background colors in columns; select a cell to see its exact pair and open it in the checker with the same AA-normal target. Copy palette exports every committed scale as CSS, JSON or CSV using the existing format contracts. A draft that is invalid must be corrected before export.

Operations and result contract

  • checkContrast: input {"text":"FFFFFF","background":"888888"}. Returns contrast.ratio and aaNormal, aaLarge, aaaNormal, aaaLarge.
  • suggestCorrections: same pair plus optional numeric targetRatio from 1 to 21, default 4.5. Returns contrast, suggestionStatus and the closest final-hex verified suggestion per role when available (up to two total) with role, hex, direction, ratio and lightnessDistance.
  • generateScale: input {"color":"3C6FD1"}. Returns color, readable name, cssPrefix, anchor and 13 stops with name, hex and textColor.
  • generateScales: input {"colors":["010101","FEFEFE"]}. Returns ordered scales. Empty arrays are valid.
  • comparePalette: input {"colors":["000000","FFFFFF"]}. Returns matrix; row is text and column is background. Empty arrays are valid.

Each operation returns schemaVersion:1, operation, status (ok or invalid), normalized inputs, result, and errors. Invalid results are null; errors contain field, code and message. Unknown fields are rejected. Ratios use full precision; do not decide pass/fail from a rounded display. Colors accept only opaque sRGB three- or six-digit hex with optional # and outer whitespace, at most 32 characters. No alpha, gradients or wide gamut. Arrays contain at most 20 colors.

The four text thresholds are AA normal 4.5, AA large 3, AAA normal 7 and AAA large 4.5. Results do not establish complete WCAG conformance. Corrections search HSL lightness, not perceptual nearest colors. Scales preserve the exact input anchor and can repeat stops near black or white; they are not perceptually uniform.

HTTP: curl, Python, fetch or any client

Base URL: https://caifrazier.com/wp-json/cf-color-tools/v1

GET uses the operation name as path and named query parameters. For arrays use colors[]=000000&colors[]=FFFFFF. Prefer POST application/json for arrays and batches. JSON input is the operation input object, without an extra wrapper. For POST, the body supplies all calculation inputs; query inputs are ignored. The format query parameter still selects the export format.

curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast?text=FFFFFF&background=888888'
curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/generateScale?color=3C6FD1&format=css'
curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/comparePalette?format=csv' -H 'Content-Type: application/json' --data '{"colors":["000000","FFFFFF"]}'
curl -fsS 'https://caifrazier.com/wp-json/cf-color-tools/v1/batch' -H 'Content-Type: application/json' --data '{"requests":[{"operation":"checkContrast","input":{"text":"fff","background":"000"}},{"operation":"generateScale","input":{"color":"abc"}}]}'
import json, urllib.request
url = 'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast'
request = urllib.request.Request(url, data=json.dumps({'text':'fff','background':'000'}).encode(), headers={'Content-Type':'application/json'})
with urllib.request.urlopen(request) as response:
    print(json.load(response)['result']['contrast'])
const response = await fetch('https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast', {
  method: 'POST', headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({text: 'fff', background: '000'})
});
const report = await response.json();
if (!response.ok) throw new Error(JSON.stringify(report));

format=json is default. All five operations offer CSV; scale operations also offer CSS. Batch only offers JSON. Invalid input returns HTTP 422 JSON even when an export was requested. Transport errors return WordPress {code,message,data:{status}}. Malformed JSON/unsupported format: 400; wrong content type: 415; oversized input: 413; unavailable/busy engine: 503. Retry 503 with backoff or use the offline kit. Batch accepts 1 to 20 {operation,input} requests, preserves order, and returns status ok or partial plus results; inspect each result even after HTTP 200.

HTTP body limit is 60000 bytes and query limit is 4096 bytes. The engine has four concurrent slots, a three-second execution budget and a 4 MiB response cap. These are resource bounds, not a traffic quota or an availability guarantee. Use batch or offline execution for volume. Public computation routes allow cross-origin browser requests. MCP has a separate origin policy.

Browser controls and the offline kit compute locally. HTTP calls send supplied colors to caifrazier.com. The plugin stores hourly aggregate usage counts, not colors or request bodies; normal hosting logs can record URLs and request metadata. Do not put sensitive data into URLs.

Offline CLI and shell pipelines

Unzip color-tools-sdk.zip, then run cd color-tools to enter the extracted directory. Use a supported Node.js LTS release (22 or newer); there are no npm dependencies and no install step. Paths below are relative to that directory.

node access/cli.cjs checkContrast --text FFFFFF --background 888888
node access/cli.cjs generateScales --color 010101 --color FEFEFE --format css
printf '%s\n' '{"colors":["000000","FFFFFF"]}' | node access/cli.cjs comparePalette --stdin --format csv
printf '%s\n' '{"operation":"checkContrast","input":{"text":"fff","background":"000"}}' | node access/cli.cjs --stdin --compact
printf '%s\n' '{"operation":"generateScale","input":{"color":"abc"}}' '{"operation":"checkContrast","input":{"text":"fff","background":"000"}}' | node access/cli.cjs --ndjson
node access/cli.cjs --catalog

The CLI also accepts an inline JSON input object after the operation. Batch uses operation batch and {requests:[...]}. Exit code 0 means success; 2 means invalid input, partial batch or usage failure. NDJSON and MCP report errors per message. Stdin and individual lines are bounded to 64 KiB. Standard output contains only results; diagnostics go to standard error. Redirect output to save files or pipe JSON to jq.

JavaScript module and browser globals

// Node ESM, browser module or module worker, using the unzipped files:
import {checkContrast, generateScale} from './assets/js/color-engine.mjs';
console.log(checkContrast({text:'fff', background:'000'}));
// Catalog, strict dispatch, batch and exporters:
import access from './assets/js/color-access.mjs';
console.log(access.format(access.execute('generateScale', {color:'abc'}), 'css'));
// Node CommonJS:
const access = require('./assets/js/color-access.js');
console.log(access.execute('checkContrast', {text:'fff', background:'000'}));

On a tool page, window.CFColorAccess provides execute(), batch(), format(), tools() and the version string. window.CFColorUtils exposes the underlying engine. Pure calls return results without changing the visible tool. Use the UI for visible interaction. Browser modules loaded from another origin depend on that host's module/CORS policy; serving the downloaded files with your application avoids that dependency.

MCP: remote HTTP or local stdio

Remote MCP endpoint: https://caifrazier.com/wp-json/cf-color-tools/v1/mcp

Use a client that supports Streamable HTTP with JSON responses. No authentication is required. The server is stateless and issues no session ID. Supported protocol versions are 2025-06-18 and 2025-11-25. Initialize, send notifications/initialized, then tools/list and tools/call. Each call returns text content and structuredContent. Invalid tool arguments produce isError:true; unknown methods/tools use JSON-RPC errors. Accepted notifications return HTTP 202 with an empty body. The retired 2025-03-26 version is not supported; an explicit header requesting it returns 400. GET returns 405 with Allow: POST because this service does not offer an SSE stream. Send the negotiated MCP-Protocol-Version header on subsequent requests. MCP requests with an Origin header are accepted only from https://caifrazier.com or https://www.caifrazier.com; normal non-browser clients omit Origin.

For a local MCP client, configure a stdio server using absolute paths to Node and the unzipped CLI. The exact configuration wrapper varies by client:

{"mcpServers":{"cf-color-tools":{"command":"/absolute/path/to/node","args":["/absolute/path/to/color-tools/access/cli.cjs","--mcp"]}}}

Local and remote MCP expose the same five catalog operations. Stdio uses one JSON-RPC message per line and reserves stdout for protocol traffic. The server has no resources, prompts, filesystem access tools or site administration actions.

Experimental WebMCP

On tool pages, the same five calculations register as cf_color_OPERATION when document.modelContext.registerTool or the earlier navigator.modelContext interface exists. Registration failures do not interrupt the UI. Calls return calculations without changing visible inputs. This is optional support for an evolving browser API, not a claim that every browser or agent supports WebMCP. HTTP, offline modules and browser controls remain available independently.

Temporary overload

HTTP 503 responses include `Retry-After: 1`. Wait at least that long, then retry with exponential backoff and random jitter; stop after three retries. Do not retry validation errors. For sustained or bulk office workflows, use the downloadable offline kit, which performs the same calculations without contacting the site. The hosted worker allows four concurrent calculations with a three-second deadline. This is an MVP service without a published availability guarantee.

Version 1.3 CSS export migration

The default CSS export now uses stable seed-based identifiers, such as --color-3c6fd1-500. This is a breaking change from 1.2 naming. Update existing references when adopting the new default. Adding or reordering colors does not rename variables. JSON exposes cssPrefix (for example --color-3c6fd1) and a separate readable name. Duplicate seeds share identifiers and identical values; their records remain present and ordered in JSON and CSV.

To retain 1.2 export naming, request format=css-legacy over HTTP, pass --format css-legacy to the CLI, or use access.format(report, 'css-legacy'). That compatibility mode intentionally retains the old positional names and their limitations. Browser Copy as CSS uses the stable default.

CSV headers remain compatible: input maps to the scale color, stop maps to stops[].name, and labelColor maps to stops[].textColor. scaleIndex is zero-based.

Correction suggestionStatus is available, already_passes, or no_single_role_lightness_solution. The last means no passing result was found by varying one color's HSL lightness while holding the other fixed; choose a different color pair. Suggestions may involve a large visual change.

Aggregate usage reporting

The site counts requests by UTC hour, tool, transport, outcome and agent family. No colors, bodies, raw user agents, IP addresses or client IDs are stored in these counters. Aggregates are retained for 90 days, with daily scheduled cleanup. This does not change normal hosting logs.

For attribution, send X-Color-Tools-Agent: scout (or claude-code, codex, claude, chatgpt, gemini, copilot, deepseek, other). Use the header on every HTTP or MCP request; stateless MCP initialization does not identify later calls. Declared identity is unverified. Recognizable user-agent family matches are labeled inferred; other clients are unknown. Model names and versions are not inferred.

On hosted tool pages, agent=1 records browser result publications; JavaScript global calls and WebMCP calls also submit bounded, best-effort counters. Optionally add agent_name=claude using the same family list. Reports contain only method, tool, outcome and count and omit credentials and the referring URL. Browser observations are self-reported and may be lost, duplicated or forged; they are not server request counts or unique users. Direct low-level utility calls and hidden JSON reads are not measurable. Ordinary human UI calculations are not counted.

The downloadable CLI/SDK and local MCP remain fully offline with no telemetry. Usage totals therefore describe observed hosted activity, not every use of the tools.

Microsoft Scout, Claude Code and Codex

Identify the application making the call, not the model behind it. Use scout for Microsoft Scout, claude-code for Claude Code, and codex for Codex. Keep claude for other Claude clients and copilot for other Copilot clients. Scout and Claude Code attribution requires an explicit declaration; we do not guess their identity from generic browser, curl or provider user-agent strings. Existing historical rows retain their original labels.

For Microsoft Scout, start with HTTP from PowerShell or a shell, or follow the browser links below. Network access may require your organization's approval. These are standard HTTP examples, not a claim of a completed Scout client qualification. A downloadable offline kit is available when hosted requests are unsuitable; it reports no usage.

For Claude Code or Codex, use the same HTTP requests with your application's header value. If your MCP client supports custom HTTP headers, supply that value on every request to the documented remote MCP endpoint. Initialization alone does not identify subsequent stateless requests. No special MCP setup is required for the HTTP path.

Scout: PowerShell

$headers = @{ 'X-Color-Tools-Agent' = 'scout' }
$body = @{ text = 'FFFFFF'; background = '777777' } | ConvertTo-Json
$result = Invoke-RestMethod -Method Post `
  -Uri 'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast' `
  -Headers $headers -ContentType 'application/json' -Body $body
$result.result.contrast

The expected ratio is about 4.478089; AA normal fails. This is a boundary example, not an error response.

Claude Code and Codex: shell

# Claude Code
curl --fail-with-body --silent --show-error \
  'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast' \
  -H 'Content-Type: application/json' -H 'X-Color-Tools-Agent: claude-code' \
  --data '{"text":"FFFFFF","background":"777777"}'

# Codex
curl --fail-with-body --silent --show-error \
  'https://caifrazier.com/wp-json/cf-color-tools/v1/checkContrast' \
  -H 'Content-Type: application/json' -H 'X-Color-Tools-Agent: codex' \
  --data '{"text":"FFFFFF","background":"777777"}'

Scout shell requests use the same command with X-Color-Tools-Agent: scout. Use only the label matching the actual calling application. Attribution is optional, self-declared and unauthenticated. Tools still work without it; unknown must remain visible in reporting. Observed request share is not user share or total adoption, especially when offline use differs by client.

Qualification workflow

In each actual client, start at the homepage and discover the Color Tools automation reference through HTML links. Check the boundary pair above, obtain and independently recheck a passing correction, then generate and export a palette. Confirm that reordering preserves CSS identifiers. Exercise the browser path if available and verify the declared application in private usage reports. Honor Retry-After with bounded retries; do not loop or run load tests. Record permission blocks and unavailable interfaces as client-environment limitations. Scout is the priority client for this qualification; HTTP simulations alone do not establish Scout compatibility.