# Brandsystem MCP server

> Converts websites, PDFs, and Figma libraries into a portable brand runtime that AI agents use to generate on-brand content and design tokens.

- Repository: https://github.com/Brandcode-Studio/brandsystem-mcp
- Page: https://hostedmcp.org/servers/brandcode-studio/brandsystem-mcp
- Transport: stdio
- Stars: 15
- License: MIT
- Latest version: 0.18.0

## Install

### Claude Code

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

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

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

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

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

### VS Code CLI

```sh
code --add-mcp '{"name":"brandsystem-mcp","type":"stdio","command":"npx","args":["-y","@brandsystem/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex

```sh
codex mcp add brandsystem-mcp -- npx -y @brandsystem/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.brandsystem-mcp]
command = "npx"
args = ["-y", "@brandsystem/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user brandsystem-mcp npx -- -y @brandsystem/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BRANDSYSTEM_PROJECT_DIR` | no | no |  |

## Tools (12)

- `brand_start`: Adopt a brand into a portable .brand/ runtime from whatever source already exists: existing brand guidelines (PDF), a website URL, a Figma library, or a hosted Brandcode Studio brand. THE entry point when the user says 'use my existing brand guidelines with AI', 'I have a PDF brand guide', 'use our Figma library', 'create a brand system', 'extract brand from website', or 'set up brand guidelines'. Pass website_url, guideline_pdf, figma_file_key, or brandcode_url — or pass no source and it discovers local candidates and presents a menu with a privacy explanation. Set mode='auto' with a website_url to run the full pipeline (extract, compile DTCG tokens + design-synthesis.json + DESIGN.md + brand runtime + interaction policy, generate HTML report) in one call. If .brand/ already exists, returns current status with next steps. NOT for reading an already-compiled brand (use brand_runtime or brand_context) or for sharing an existing brand with a team (use brand_brandcode_connect).
- `brand_status`: Check brand system progress and get next steps. Shows what has been extracted (colors, fonts, logo), confidence levels, session completion status, and what to do next. Use when resuming a previous session, checking readiness, or when the user asks 'what's the state of my brand?' If no .brand/ exists, returns a full getting-started guide with all available tools. Returns structured status data. (read-only)
- `brand_compile`: Generate DTCG design tokens, design-synthesis.json, DESIGN.md, brand runtime, and interaction policy from extracted brand data. Transforms core-identity.yaml into tokens.json, brand-runtime.json (single-document brand contract for AI agents), and interaction-policy.json (enforceable rules). When Session 2+ data exists, also generates visual-identity-manifest.md and system-integration.md. Use after brand_extract_web, brand_extract_site, brand_extract_visual, or brand_extract_figma. Returns token counts, clarification items, and file list.
- `brand_clarify`: Resolve an ambiguous brand value interactively. After brand_compile, some values need human confirmation — wrong primary color, unknown font, unassigned color roles. Pass the clarification item ID and the user's answer (hex color, role name, font name, or 'yes'/'no'). Supports natural language: 'the purple one is accent' or '#5544f2 is secondary'. Returns updated identity and remaining clarification count.
- `brand_report`: Generate a portable HTML brand identity report with embedded logos, color swatches, typography, and tokens. The HTML is self-contained and works offline — upload it to any AI chat (Claude, ChatGPT, Gemini) as instant brand guidelines. Written to .brand/brand-report.html. Use after brand_compile. Returns file path, report summary (color/font/logo counts), and a ready-to-copy Brand Instructions text block.
- `brand_preflight`: Check HTML/CSS against brand rules — catches off-brand colors, wrong fonts, missing logo, and anti-pattern violations (drop shadows, gradients, etc.). Pass an HTML string or file path. Mode 'check' (default) runs static source checks. Add render=true to render the page in sandboxed headless Chrome (all network blocked) and verify the COMPUTED result: actual colors vs palette (CIEDE2000), the font face that really renders, WCAG AA text contrast, logo presence, optional screenshot to .brand/checks/. Use after building any page or component, or when the user asks 'does this look on-brand?', 'check my page', or 'verify the design'. Mode 'rules' lists active rules. Returns overall PASS/WARN/FAIL, a score, and per-finding details (locator, measured value, nearest brand value, severity). NOT for scoring content copy — use brand_audit_content. NOT for brand directory validation — use brand_audit.
- `brand_runtime`: Read the compiled brand runtime contract (brand-runtime.json). Returns the brand system that AI agents load as context for on-brand output. Supports slicing: 'full' (~1200 tokens, everything), 'visual' (~200 tokens, colors + fonts + anti-patterns), 'voice' (~400 tokens, tone + vocabulary + perspective), 'minimal' (~100 tokens, primary color + heading font). Use slices when passing brand context to sub-agents — smaller context reduces token cost and agent satisficing. Live Mode aware: when enabled via brand_brandcode_live, the runtime refreshes from the hosted Brandcode runtime on each call (subject to cache TTL). Falls back silently to the local mirror on network error. Read-only. Run brand_compile to refresh. (read-only)
- `brand_context`: Select a task-scoped brand context from the compiled runtime. THE tool to call first when the user says 'write this in our voice', 'write this LinkedIn post in our brand voice', 'make an on-brand social graphic', or 'build a landing page' — it returns only the governed rules relevant to that task instead of the full runtime. Deterministic: task_type maps to sections via a fixed table, audience matches governed personas exactly or reports no-match — no inference. Returns context (the selected brand slices), output_contract (required delivery shape), matched_selectors (what was chosen and why), and no_governed_match. NOT for reading the entire runtime (use brand_runtime) or checking finished content (use brand_check). (read-only)
- `brand_check`: Inline brand linter — call this WHILE writing content or code, the way you call a type-checker. <50ms pass/fail on any combination of text (voice/never-say/AI-isms), color (palette match with ΔE distance), font (typography match), or css (anti-pattern violations). Designed for tight loops: write a sentence, brand_check it, fix, continue. Returns specific actionable fixes per failed input. Requires brand_compile to have run first. NOT a publish-time gate — use brand_check_compliance for the single PASS/FAIL verdict before shipping. NOT for 0-100 scoring — use brand_audit_content. NOT for HTML/CSS rule violations — use brand_preflight. (read-only)
- `brand_brandcode_auth`: Activate Brandcode Studio connection for saving and pushing brands. Preferred mode: "activate" displays a short code (e.g. BRAND-7K4X) for the user to enter at brandcode.studio/activate — no copy-paste of tokens needed. Also supports: "status" (check auth), "login" (magic link fallback), "set_key" (manual token), "logout" (clear credentials). Use when the user wants to save their brand to Studio or says "activate", "connect to Brandcode", or "save my brand online". NOT needed for extraction, preview, or brand_check — those work without auth.
- `brand_brandcode_connect`: Connect a local .brand/ to Brandcode Studio. Two modes: "pull" (default) downloads an existing hosted brand by URL/slug. "save" uploads the local .brand/ to Studio (requires prior auth via brand_brandcode_auth). THE tool when the user says "make our brand available to my whole team", "share our brand with the team", "connect to Brandcode", "pull from Studio", "save brand to Studio", or "upload my brand". Returns brand name, slug, sync token, and connection details.
- `brand_export`: Bundle the compiled brand system into a portable artifact in a destination's native format. Use when asked 'share my brand', 'export for ChatGPT/Cursor/Codex/team', 'add the brand to AGENTS.md', 'Cursor rules', 'CSS variables', 'Tailwind theme', 'shadcn theme', 'generate brand guidelines', or 'create a brand PDF'. Targets: 'chat' (markdown for any AI conversation), 'code' (MCP config + CLAUDE.md snippet), 'team' (human guidelines), 'email' (~500-word summary), 'claude-skill' (SKILL.md with embedded logo), 'pdf' (branded guide), 'agents-md' (AGENTS.md section), 'cursor-rules' (.cursor/rules/brand.mdc), 'css-variables' (:root --brand-* + dark block), 'tailwind' (v4 @theme CSS), 'shadcn' (shadcn/ui :root/.dark variables). CSS targets are generated from the compiled DTCG tokens. Writes to .brand/exports/<file> and returns the full content (text targets) or a generation summary (pdf). Requires brand_compile to have run first. NOT for previewing one section — use brand_preview.

## FAQ

### How do I use my brand guidelines with AI?

You can install the server for your specific client (like Claude Code, Cursor, or Windsurf) and then use commands to extract brand identity from websites, PDFs, or Figma libraries.

### Do I need an account to use this?

No, the local-first workflow allows you to build and use your brand runtime without an account.
