# Brandrail

The Brandrail MCP server for Claude Code gives an agent a project’s design rules, tokens, and component details. It can validate generated UI code against the brand system.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 3 repo stars
- Author: brandrail-app
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/brandrail-app/brandrail/tree/HEAD/packages/cli
- Updated: 2026-11-13
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/brandrail

## What it does

Brandrail exposes a project’s design rules, tokens, and component documentation to an AI agent. The agent can look up a component for a task, retrieve a page template, or check a generated snippet and its required fixes. MCP tools are read-only.

The server runs locally with `npx brandrail mcp`; code snippets stay on the machine. Starter tokens work without an account. An account or `BRANDRAIL_KEY` connects the project’s own Brand Kit. `npx brandrail connect` configures MCP and writes rule files for AI tools.

Checking a live page with `scan` also requires `playwright` and Chromium. Results are sent only with `--upload`, and code snippets are never uploaded.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `BRANDRAIL_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add brandrail -e BRANDRAIL_KEY=<BRANDRAIL_KEY> -- npx -y brandrail
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add cli --env BRANDRAIL_KEY=<BRANDRAIL_KEY> -- npx -y brandrail
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cli": {
            "command": "npx",
            "args": [
                "-y",
                "brandrail"
            ],
            "env": {
                "BRANDRAIL_KEY": "<BRANDRAIL_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cli": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "brandrail"
            ],
            "env": {
                "BRANDRAIL_KEY": "<BRANDRAIL_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e BRANDRAIL_KEY=<BRANDRAIL_KEY> cli npx -y brandrail
```
Replace <…> with your own values

## When to use it
- check generated UI against a project’s design rules
- find a project component for a specific interface task
- retrieve the CSS variable for a design token
- map Material or MUI elements to project components

## Example prompts
- Check this UI snippet against the project’s design rules and list the fixes.
- Find the component for a date picker and show how to use it.
- Get a settings page template built from the project’s components.

## Similar
- [Soundside-ai](https://affpapa.org/en/nevibecode/mcp/soundside-ai.md) — MCP server · 815 installs
- [MU — say it, get it made](https://affpapa.org/en/nevibecode/mcp/mu-say-it-get-it-made.md) — MCP server · 744 installs
- [KRDS Design System](https://affpapa.org/en/nevibecode/mcp/krds-design-system.md) — MCP server · 531 installs
- [mermaid-diagrams](https://affpapa.org/en/nevibecode/skills/mermaid-diagrams.md) — skill · 1180 installs
- [video-editor](https://affpapa.org/en/nevibecode/agents/video-editor.md) — subagent · 1156 installs
- [finding-designers-and-creatives-on-twitter](https://affpapa.org/en/nevibecode/skills/finding-designers-and-creatives-on-twitter.md) — skill · 938 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
