# c2n Web Components

> c2n Web Components is an open-source MCP server for developer tools. Exact component APIs, examples, theme tokens and markup checks for c2n Lit web components. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://code2nguyen.github.io/web-components/guides/ai-tools
- **Repository:** https://github.com/code2nguyen/web-components/tree/HEAD/packages/tools/mcp
- **MCP Registry name:** io.github.code2nguyen/c2n
- **Categories:** developer tools
- **Listing updated:** 2026-11-14

## About

A coding agent often guesses attribute names for a component library; this server answers from the installed @c2n/* packages instead, so the API it reports matches the version in your project. Set C2N_PROJECT_ROOT to point it at a different project.

Ten tools run from listing and searching components to fetching full APIs with CSS variables grouped by part and state, browsing gallery looks, applying curated presets and reading the --c2-theme tokens. generate_variant produces a CSS class, HTML with style, a Lit subclass or JSON from overrides, and validate_markup flags native controls that should be replaced plus unknown tags, attributes, slots, events and variables.

It pairs with a separate @c2n/skill package that teaches workflow conventions; when MCP is unavailable the skill falls back to a bundled catalog and each package's custom-elements.json manifest. Setup commands are given for Claude Code, Codex and GitHub Copilot in VS Code.

## Features

- **Version-aware APIs:** Reports component APIs from the packages installed in your project.
- **Gallery and presets:** Browse looks, search examples and apply curated presets.
- **Theme tokens:** Reads the --c2-theme tokens with install and mapping snippets.
- **Variant generation:** Emits CSS, HTML, Lit subclasses or JSON from overrides.
- **Markup validation:** Flags unknown tags, attributes, slots, events and variables.

## Good for

- Build a page with c2n components without guessing attributes
- Restyle a component through theme tokens
- Check hand-written markup for invalid c2n usage
- Turn a repeated style into a reusable variant

## Install

### Claude Code (Terminal)

```sh
claude mcp add c2n -- npx -y @c2n/mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "c2n": {
      "command": "npx",
      "args": [
        "-y",
        "@c2n/mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "c2n": {
      "command": "npx",
      "args": [
        "-y",
        "@c2n/mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "c2n": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@c2n/mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "c2n": {
      "command": "npx",
      "args": [
        "-y",
        "@c2n/mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "c2n": {
      "command": "npx",
      "args": [
        "-y",
        "@c2n/mcp"
      ]
    }
  }
}
```

## Tools

- `list_components`
- `search_components`
- `get_component`
- `get_examples`
- `search_examples`
- `get_presets`
- `get_theme`
- `generate_variant`
- `validate_markup`
- `get_workflow_guide`

## FAQ

### How do I add it to Claude Code?

Run claude mcp add --transport stdio c2n -- npx -y @c2n/mcp.

### Do I need the skill too?

MCP can run alone, but the skill adds conventions for applying components; installing both is recommended.

### Which project does it read?

The one in C2N_PROJECT_ROOT, defaulting to the working directory.

### Is c2n Web Components free?

Yes. c2n Web Components is open source, so you can use and self-host it for free.

### How do I add c2n Web Components to Claude Code?

Run this command in your terminal: claude mcp add c2n -- npx -y @c2n/mcp

### What are the best alternatives to c2n Web Components?

The closest alternatives to c2n Web Components are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/c2n-web-components
