list_components
List components
Lists every c2n component (tag, package, category, one-line description, installed version in the current project).
formatkeywordcategoryinstalledOnly
io.github.code2nguyenPublished by GitHub account code2nguyenv1.0.23Updated Nov 7, 2026
Exact APIs, examples, theme tokens and markup validation for the c2n (c2-*) Lit web components.
Local MCP server that gives an assistant the APIs, examples, theme tokens and markup validation for the c2n (c2-*) Lit web components.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
Model Context Protocol server that exposes the c2n web components to AI agents: component APIs (attributes, slots, events, native CSS parts, CSS variables with their theme tokens), usage and gallery examples, curated presets, the @c2n/theme tokens, variant code generation and the application workflow guides. Everything is bundled in data/registry.json, so it works offline in any project.
[c2n Web Components MCP server]
The server uses stdio and can be launched by any MCP host:
Claude Code project .mcp.json:
Codex project .codex/config.toml:
Google Antigravity project .agents/mcp_config.json uses the same mcpServers command/args structure as the Claude example. The @c2n/skill package can install the skill and merge these configurations automatically.
Run the server from a project directory: it reports which @c2n/* packages are installed and serves the bundled API when the installed version differs. The registry is packaged locally, so tool calls do not require network access after installation.
Use c2n-mcp --version to inspect the installed server version and c2n-mcp --help for CLI usage.
The MCP server supplies structured component facts; it does not install component packages or edit an application by itself. Pair it with @c2n/skill when you also want the agent to follow c2n's application, theming and variant conventions. See the AI tools guide for the complete setup and example prompts.
Restart the agent after adding its MCP configuration, then ask it to use the c2n MCP server to list components or inspect c2-button. A connected client should expose the tools below and report @c2n/* packages installed in the current project. If the server cannot start, run npx -y @c2n/mcp --version in that project to distinguish an npm/runtime problem from an MCP client configuration problem.
Gallery cards are served with a generated summary of what they change and CSS whose colours follow the --c2-theme--* tokens wherever a literal equals a token's value (var(--c2-theme--color-outline, #d4d4d8)), so a copied card follows the application's theme and dark mode. Each card also links light and dark PNG captures hosted with the docs site (gallery-shots/<component>/<slug>.<theme>.png, written by apps/ui/scripts/gallery-shots.mjs in the Pages deploy).
validate_markup is also a CLI, for CI and editor hooks. It reads HTML, JSX/TSX, Vue, Svelte, Astro, Angular and Lit templates and CSS, and checks them against the API of the @c2n/* packages the project has installed:
It reports native <button>/<input>/<select>/<textarea>/<dialog>/<details>/<progress> elements that a c2-* element replaces, unknown c2-* tags, attributes, slots and --c2-* variables (with "did you mean"), events a c2-* element does not fire (with its event list), a static camelCase attribute the element ignores (rowKey for row-key), and box styling on a c2-* host (border, padding, background, box-shadow, outline; a radius alone is fine). A line holding c2n-ignore, or the line after a comment holding it, is skipped. In hook mode the findings go to stderr with exit code 2, which Claude Code hands back to the agent; npx -y @c2n/skill install registers that hook in .claude/settings.json.
Resources: c2n://components, c2n://components/{tag}, c2n://theme, c2n://guide/{topic}.
data/registry.json is an ignored build artifact. npm run build:tools (repo root) regenerates it from the component manifests, docs content, presets and theme, then compiles dist/ and refreshes the committed skill fallback.dev, inspect, smoke and npm pack automatically build the registry when needed.npm run smoke -w packages/tools/mcp spawns the server over stdio and checks every tool.npm run inspect -w packages/tools/mcp opens the MCP Inspector against the source entry (node src/cli.ts, Node 24 type stripping).Source: packages/tools/mcp/README.md at commit 14ff619
List components
Lists every c2n component (tag, package, category, one-line description, installed version in the current project).
formatkeywordcategoryinstalledOnlyGet component API
Full API of one component: install/import lines, attributes, slots, events, native CSS parts, CSS variables grouped by semantic target and state (with the theme token each follows), composition and preset names. Examples are served by get_examples.
tagrequiredformatincludeSearch components
Free-text search across component names, descriptions, attributes, slots, events, example labels and icon names. Use it to find the component for a UI need ("dropdown", "dialog", "avatar with status", "arrow icon").
limitqueryrequiredGet examples
Markup examples of a component: usage rows from the docs, styled gallery cards (the looks shown on the docs site, each with a summary of what it changes and light/dark screenshots) and the landing preview. Start with `view: "index"` to see every look on one page, then fetch the chosen card by its slug.
tagrequiredkindviewlabellimitqueryformatoffsetsectionSearch gallery looks
Search every component's gallery for a look or a use case ("compact", "glass", "pill", "danger", "underline input", "KPI"): returns matching cards across components with their summary and screenshot. Fetch one with get_examples `label: <slug>`.
taglimitqueryrequiredGet presets
Curated presets of a component ("inspiration" looks): base markup plus each preset as CSS variable values and attributes.
tagrequirednameformatGet theme tokens
The @c2n/theme design tokens (--c2-theme--*) with light/dark defaults, how to install and map your own tokens, and dark mode. With `tag`: which of that component's variables follow which token.
tagformatGenerate a variant component
Turns CSS variable / attribute overrides of a component into copy-paste code: a CSS class, HTML + <style>, a Lit subclass registered under your own tag, or JSON. Validates variable and attribute names against the component API. Start from a curated preset with `preset`, or from a gallery card with `example` (its slug or label).
csstagrequiredhtmlnamerequiredformatpresetexampleattributesValidate markup
Checks HTML, JSX, Vue, Svelte, Astro, Angular or Lit markup and CSS you wrote against the installed c2n API: native controls a c2-* element replaces (<button>, <input>, <select>, <textarea>, <dialog>, <details>, <progress>), unknown c2-* tags, attributes, slots, events and --c2-* variables (with "did you mean"), and box styling on a c2-* host. Lists the imports that register the elements used. Call it on every file you write before finishing.
coderequiredformatfilenameGet workflow guide
The c2n application workflow guides: `workflow` (theme once, use tags, name what repeats), `theming`, `variant-components`, `frameworks` (plain HTML, Lit, Astro, React, Vue, SSR).
topic90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
npx -y @c2n/mcp{ "mcpServers": { "c2n": { "type": "stdio", "command": "npx", "args": ["-y", "@c2n/mcp"] } } }[mcp_servers.c2n]command = "npx"args = ["-y", "@c2n/mcp"]npx -y @c2n/mcp validate src # exit 1 on errorsnpx -y @c2n/mcp validate src --strict # warnings fail too (native controls, box styling on a c2 host)npx -y @c2n/mcp validate --hook # Claude Code PostToolUse hook: reads the payload on stdin