27.0.0-preview.2 (most recent)27.0.0-preview.1

AI agent support

When a developer asks their AI assistant to find or use a web component library, Chameleon is legible to that assistant. An assistant that can't read a library cleanly gets it wrong: it invents props, misses events, and guesses at theming. Every page of this documentation is available as plain markdown, and Chameleon publishes the whole corpus in the formats coding agents already read.

Every page, as markdown⁠

The site mirrors each documentation page as markdown at its own path with a .md suffix. This page lives at /get-started/ai-agents; its markdown source is at /get-started/ai-agents.md. Append .md to any documentation URL to get the same content without the site chrome.

The same content is content-negotiable: request a page with an Accept: text/markdown header and you get the markdown representation of that exact URL, no suffix required. Either way, an agent fetching a page reads clean prose, code blocks, and tables rather than parsing rendered HTML.

The MCP server⁠

Chameleon's documentation is also a Model Context Protocol server, at https://chameleonui.io/mcp. An assistant queries it as a tool instead of fetching pages, and gets only the part it asked for. It's open to everyone, with no sign-in, and it has nine read-only tools:

  • check_code: verifies code against Chameleon's real API before the assistant gives it to you. It checks a snippet's component, attribute, property, event, method, and enum value names against the API for your framework, and returns each name it can't find with the nearest real one as the fix. It also flags common React and Razor mistakes.
  • docs_get: a component's API for one framework: properties, events, methods, slots, and design tokens, with the page's usage guidance. An assistant can narrow the answer to one section or one member, and pass its task to get the most relevant guidance and code first.
  • list_components: every documented component, with its web, React, and Blazor names.
  • docs_search: a ranked search across every page, one section at a time.
  • get_example: the code for a page's examples, in your framework.
  • get_product_facts: facts for evaluating Chameleon as a product: who it is for, the release, capabilities, what each component lets you vary, and the dated roadmap. It returns the same JSON as /product-facts.json.
  • generate_theme: a color theme from one seed color: every color token's light and dark value, and the stylesheet the theming page builds with generateThemeCssFromHex. It takes the variant and contrast level the theming page describes.
  • check_contrast: the WCAG 2 contrast ratio of two colors, with the AA and AAA verdicts for normal and large text. Each color is a hex value or a token, such as on-primary, and a token is checked in light and dark. It also says whether Chameleon computes the pair to be legible, as it does on-primary on primary.
  • nearest_tokens: maps raw colors, such as the hex values in a stylesheet you are converting, to the nearest color tokens of your theme, light and dark, with how far apart they look.

The three color tools run Chameleon's own color utilities, the WebAssembly the published package runs, so they give the values your app will get.

docs_search, docs_get, get_example, and check_code answer for the framework the assistant chooses: web, React, or Blazor. Each answers in that framework's names: cw-* elements for web, Cr* components for React, and Cb* components for Blazor.

Every tool also takes an optional version: the Chameleon release your app uses, such as 27.1. The server drops a patch number, so 27.1.3 gets the 27.1 docs, and 27 gets the newest 27 minor. A preview must match its full version. Without version, the server answers from the most recent release, the highest version, previews included. An unknown version gets an error that lists the available ones. An answer for an older release links that release's markdown pages, under /releases/, and every answer names its release in its _meta.

Every answer is at most 19,000 characters. A longer answer comes in pages: it carries a nextCursor, and the assistant passes it back as cursor to read the next page. So no answer floods an assistant's context.

The server allows each address 60 calls a minute. Every response states that limit in a RateLimit-Policy header, following the IETF RateLimit header fields draft. Past the limit it answers HTTP 429 with Retry-After and RateLimit headers and a JSON-RPC error that says how long to wait. It answers over HTTPS only: a call to http://chameleonui.io/mcp is refused with a JSON-RPC error that names the HTTPS address. Browser-based clients, such as the MCP Inspector, can call it from any site: it answers cross-origin requests with Access-Control-Allow-Origin: * and never accepts cookies or credentials.

Connect your agent⁠

The server needs its URL, https://chameleonui.io/mcp, and nothing else: no key and no sign-in. Each button opens its app, which must be installed, and asks it to add the server.

Add to Cursor Add to VS Code Add to VS Code Insiders Add to LM Studio

From a terminal, one command adds it:

  • Claude Code: claude mcp add --transport http chameleon https://chameleonui.io/mcp
  • Codex: codex mcp add chameleon --url https://chameleonui.io/mcp
  • Gemini CLI: gemini mcp add --transport http chameleon https://chameleonui.io/mcp, or "httpUrl": "https://chameleonui.io/mcp" under mcpServers.chameleon in its settings.json.

Any other client takes the same URL as a Streamable HTTP server; the setting's name differs from client to client. A tool that discovers servers by itself finds this one through /.well-known/ai-catalog.json, which lists its server card at /mcp/server-card.

The whole corpus, in one place⁠

Two files follow the llms.txt convention:

  • /llms.txt: a curated index: sections and links that point an assistant at the pages that matter, so it can decide what to fetch.
  • /llms-full.txt: the full documentation corpus concatenated into a single file, for tools that prefer to load everything at once.

/product-facts.json holds Chameleon's product facts: who it's for, the release, each capability with the page that shows it, what each component lets you vary, and the dated roadmap. Chameleon measures its figures from the published packages and dates them.

What an assistant should know⁠

  • Color theming: one seed color generates the whole theme, light and dark. Chameleon computes every on- color against its own background, so text stays legible at standard, medium, and high contrast. The color math runs in WebAssembly.
  • React: React apps use Chameleon's typed React components, such as CrButton and CrTextField, not the raw custom elements. Blazor apps use the Cb* Razor components. All of them render the same cw-* elements.

Rules to follow⁠

  • What renders when: components inside a closed menu, popover, dialog, tooltip, or hidden navigation render when first shown. A select's options and value answer at once.
  • Inside a hidden element: components render when the hidden attribute is removed, never because page CSS shows the element. await updateComplete to reach one sooner.
  • Reaching hidden content from code: before a component is first opened, its open part (a menu's list, a dialog's panel) doesn't exist, though the elements the app put inside it do. Open it, await updateComplete, then query, measure, or focus.
  • Starting each opening empty: a component keeps the app's content between openings; reset that content on toggle when event.newState === "closed" if each opening should start empty.