[CI]
[npm version]
[Node]
[brandsystem-mcp MCP server]
[npm downloads]
[MCP Badge]
Use your brand guidelines with AI
@brandsystem/mcp turns the brand material you already have into context AI agents can use. Give it a website, PDF guide, Figma library, local files, or a Brandcode Studio brand. It produces a portable .brand/ runtime with design tokens, voice rules, provenance, and compliance checks.
Local-first. No account required. The default Core profile exposes 12 tools covering the complete adopt → use → check loop.
Start here
Install it for your agent, then ask: “How do I use my brand guidelines with AI?”
Claude Desktop (one-click): download brandsystem-mcp-<version>.mcpb from the latest GitHub release and double-click it (or drag it into Settings > Extensions). Claude Desktop asks for the folder that holds your .brand/ directory — no Node install or JSON editing needed.
install is a dry run unless you pass --write. Replace claude-code with cline, cursor, windsurf, or claude-desktop as needed. JSON-file targets preserve existing settings; Cline and Codex setup delegate to their official MCP commands so their current schemas remain authoritative. Agents can follow the compact installation guide without reading this entire README.
Already configured? Tell your agent:
Use my existing brand guidelines with AI. Start from this website/PDF/Figma library and show me what needs human confirmation.
What It Solves
AI tools default to category-average output because they have no brand context. Brand guidelines live in PDFs, Figma files, and people's heads — none of which AI tools can read at the moment of creation. The dominant failure mode isn't "broken output"; it's "correct but generic" — output that passes mechanical checks but reads like a competent generalist could have made it.
This MCP server is the authoring half of the "Two MCPs, One Brand" model. It extracts brand identity from live sources, compiles it into a .brand/ directory with structured governance (anti-patterns, proof-point status, voice rules, application rules) plus DTCG tokens, brand-runtime.json, and interaction-policy.json. That directory is the portable brand runtime — the artifact that travels with your brand from surface to surface.
- Claude Design reads the
.brand/ directory natively when pointed at a governed repo
- Claude Code, Claude Desktop, Cursor, and Windsurf connect to this server directly over stdio and load
brand-runtime.json at generation time
- ChatGPT and other remote-first clients consume the same runtime as an uploaded artifact (
brand-report.html / brand-runtime.json) or via a remote MCP connection — see Compatibility
- @brandcode/mcp (the hosted Use MCP) serves the same runtime over HTTP for teams that want authenticated live reads at
mcp.brandcode.studio/{slug}
With brand-runtime.json loaded, agent prompts collapse from 200-400 tokens of inline brand context to just the delta. First output is on-brand. No review bottleneck.
Quick Start
1. Add to your MCP config
Copy this into .mcp.json (Claude Code), .cursor/mcp.json (Cursor), or Windsurf MCP settings. Codex users can run npx @brandsystem/mcp install --client codex --write instead:
For project-level configs committed to a repository, pin a version ("@brandsystem/mcp@<version>") so collaborators never auto-run an unreviewed release; npx @brandsystem/mcp install writes a pinned spec for you.
2. Create your brand system
Tell your AI tool:
Run brand_start with client_name="Acme Corp", website_url="https://acme.com", and mode="auto"
That single command extracts colors, fonts, and logo from the website, escalates to rendered or deeper multi-page extraction when the cheap pass is weak, compiles DTCG tokens, generates design-synthesis.json + DESIGN.md, and generates a portable HTML brand report -- all in under 60 seconds.
3. What you get
Load brand-runtime.json into any sub-agent's context. First output is on-brand. No per-prompt boilerplate.
4. Use it
Run brand_write for a social-graphic about "Q3 product launch"
The AI now has your full brand context — colors, typography, logo, anti-patterns, voice rules — and generates on-brand content.
Export to every tool's native format
Encode the brand once, then drop it into each tool in the format that tool already reads. brand_export writes to .brand/exports/:
Run brand_export with target="tailwind"
CSS targets are generated from the compiled DTCG tokens; brand strings are validated (hex colors, plausible font names, quoted families) so nothing extracted can break out of a declaration. Instruction targets (agents-md, cursor-rules) carry the provenance notice and keep brand values in a fenced data block.
5. Go deeper (optional)
Each session enriches brand-runtime.json. Stop at any point — Session 1 alone is valuable.
6. Share with your team
Run brand_brandcode_connect to save on Brandcode Studio
Your brand persists on brandcode.studio. Teammates pull the same brand into their tools. One source of truth.
What It Does
Session 1: Core Identity -- Extract colors, fonts, and logo from a website or Figma file. Compile into DTCG tokens, a structured design synthesis layer, a portable DESIGN.md, and an HTML report.
Session 2: Visual Identity -- Define composition rules, pattern language, illustration style, and anti-patterns through a guided interview. Anti-patterns become enforceable compliance rules.
Session 3: Messaging -- Audit existing website voice, then define perspective, voice codex (tone, vocabulary, AI-ism detection), and brand story through a guided interview.
Session 4: Content Strategy -- Build buyer personas, journey stages, editorial themes, and a persona x stage messaging matrix.
Each session builds on the previous. Stop anywhere -- you get value immediately.
Two Ways To Use It
Local-first MCP flow -- Start from a website or Figma file, build a .brand/ directory locally, and use it immediately in chat or code tools with no account required.
Brandcode Studio-connected flow -- Connect an existing hosted brand from Brandcode Studio, pull the packaged brand into .brand/, and keep it synced over time.
Two MCPs, One Brand
The .brand runtime is the product. Two MCPs serve it:
@brandsystem/mcp — Build (this package). Author and compile the .brand runtime locally. Extract from websites, Figma, and PDFs. Compile governance (anti-patterns, proof-point status, voice rules, application rules) plus DTCG tokens, brand-runtime.json, and interaction-policy.json into a single .brand/ directory. Portable, versionable, ready to commit to any repo.
@brandcode/mcp — Use (hosted). Connect authorized MCP clients to the live Full Brand Runtime at https://mcp.brandcode.studio/{slug} with Brandcode bearer-key auth. Agents fetch the current runtime, search approved knowledge, check drafts, retrieve package-safe assets, leave append-only review feedback, and, with explicit capture scope, queue taste captures for human review — no per-tool guideline copy, no stale snapshots, no canonical mutation from the MCP. Tagline: "Your brand, live in every AI tool."
Same .brand runtime artifact. Two consumption paths. Build authors it; Use serves it.
Phase 0 for Brandcode MCP is locked in specs/brandcode-mcp-phase-0-lock.md as the original 8-tool read/append-only surface. The current hosted implementation adds capture_taste as a scoped contribute-tier tool: it requires explicit capture scope, queues a review candidate for human review, and never promotes canon.
Hosted availability: Brandcode MCP is pre-release and available to approved clients only — it is not yet publicly launched or registry-listed. Brand data on the hosted service is client-owned; feedback is append-only; agent history is scoped and redacted. Deletion and export requests are handled through your Brandcode Studio contact. Until public launch, use @brandsystem/mcp for local build/sync, and Live Mode (brand_brandcode_live) for connected reads that refresh from the hosted runtime within a short cache TTL.
Maintainers can verify a hosted deployment end-to-end with the smoke harness (npm run smoke:hosted-mcp with BRANDCODE_MCP_SMOKE_URL and scoped test keys). It verifies MCP initialize, tools/list, the locked hosted tool order, core hosted tool calls, and read-only insufficient-scope behavior. It never hardcodes keys; missing proof inputs are reported as blocked or skipped.
Claude Design integration
The .brand/ directory is engineered as a first-class input for Claude Design. Point Claude Design at a repo that contains .brand/ — governance YAML, narrative library, proof-point files, taste notes, DTCG tokens — and it grounds on the governed brand instead of improvising from uploaded assets. This is the Deploy path: author once with @brandsystem/mcp, then every Anthropic surface (Claude Design, Claude Code, Chat via compile packs) consumes the same runtime.
Tools Reference
Tool Profiles (0.10+)
By default the server registers the Core profile — 12 tools covering the complete loop: adopt → runtime/context → create → check → export, plus the Studio connector entry points and the clarify/promote path. This keeps first-tool selection sharp for agents.
Core also offers brand_feedback automatically after a failure. It stays out of the tool list until a tool in the session errors, has to elide an oversized response, or reports a LOW or empty extraction. Then the server lists it (via notifications/tools/list_changed) and the failing response's next_steps points to it, for clients that don't refresh their tool list. Nothing is sent automatically: a report goes to the Brandcode team only when an agent calls brand_feedback, and it contains the note the agent writes, never .brand/ files. See docs/DATA-FLOWS.md.
The full profile registers the entire authoring system (all tools below). Opt in via env or args:
Or set BRANDSYSTEM_PROFILE=full. Core tools: brand_start, brand_status, brand_runtime, brand_context, brand_check, brand_preflight, brand_report, brand_export, brand_clarify, brand_compile, brand_brandcode_auth, brand_brandcode_connect.
Entry Points
Session 1: Core Identity
Session 2: Visual Identity
Session 3: Messaging
Session 4: Content Strategy
Content Scoring
Runtime + Utilities
Brandcode Studio Connector
Tool Flow
Tools auto-chain -- each tool's response tells the LLM what to run next:
brand_status can be called at any point. brand_preflight runs after any content generation.
Checking what you built
Static checks read the source. A page can declare the brand font and still render in a fallback, or use the right hex on a background that makes the text unreadable. brand_preflight with render: true checks the computed result in a real browser:
- Input: an HTML string, or a path to an
.html file inside the working directory (symlink-aware containment). Stylesheets, @imports, scripts, fonts, and images that live inside the working directory are inlined before rendering.
- Sandbox: the page renders in the same locked-down headless Chrome used for extraction (Chromium sandbox on, service workers bypassed), with all network egress denied. The egress proxy refuses every connection and the request interceptor aborts anything that is not
data:, blob:, or about:. Remote fonts and CDN stylesheets do not load. The response lists what was blocked so you can switch to local copies.
- What it measures: for every visible element, the computed text, background, and border colors (alpha-composited), the font face that actually renders (the first available family in the stack), font sizes and weights, and whether a logo renders.
- What it checks:
R-COLOR: CIEDE2000 distance to the nearest brand color. ≤2.3 matches, ≤6 is reported as info ("use the exact value"), above that is a warning, and above 15 is an error. Low-chroma neutrals are always allowed. While clarify-primary is open, color errors are advisory.
R-FONT: the rendered face must be a brand font. Generic and system fallbacks after the brand font are fine. A brand font that is declared first but cannot load is reported as info.
R-CONTRAST: WCAG AA (4.5:1, or 3:1 for large text), measured on the real foreground and background. Text over images or gradients is counted as indeterminate.
R-LOGO: the brand name renders as text but no logo SVG or image renders.
- Output:
overall (PASS/WARN/FAIL), a 0–100 score (color 40 / typography 30 / contrast 30), and findings sorted by severity. Each finding has a locator, the measured value, the nearest brand value or required threshold, and an occurrence count, capped by max_findings. The response also carries the measured palette and type scale, a compact static_preflight summary, and, with screenshot: true, a PNG path under .brand/checks/ to show the user. Hard anti-pattern failures from the static rules also fail the rendered check.
Requires a local Chrome or Chromium install. Without one, the tool says so and points you back to the static check.
CLI Commands
The npm package ships a CLI entrypoint for setup, diagnostics, and the hosted-brand connector:
install never overwrites other servers' entries: it deep-merges, backs up the existing file first, and refuses invalid JSON. It pins the spec to the version you ran (@brandsystem/mcp@<version>), including for Codex and Cline; pass --unpinned to write the floating @brandsystem/mcp instead. For protected hosted brands, add --share-token=TOKEN.
Trusted Studio origins. Credentials (session, admin, and share tokens) are only ever sent to a trusted Brandcode Studio origin — https://www.brandcode.studio and https://brandcode.studio by default — and only an approval declared by a package from a trusted origin can mark a brand production_approved. Other hosts can still be read for public packages (https only, SSRF-guarded, no credentials), but their approval claims are ignored. For local development or staging, add origins with BRANDCODE_STUDIO_TRUSTED_ORIGINS (comma-separated; https required, except http://localhost, http://127.0.0.1, or http://[::1] when listed explicitly).
Signed packages. When Brandcode Studio signs a package (Ed25519, keys pinned in src/connectors/brandcode/signing-keys.ts), the connector verifies the signature and stores it as .brand/brandcode-package.sig.json. A valid signature can confer production_approved from any origin, so a copied package stays verifiable. An invalid signature never does: tampered body, unknown key, or wrong key. brand_brandcode_connect and brand_brandcode_sync report package_signature as signed/verified, signed/invalid or unsigned, and brand_audit flags a signed package that was modified after the pull. Set BRANDCODE_REQUIRE_SIGNED_APPROVAL=true to refuse approvals on unsigned packages. See docs/SIGNED-PACKAGES.md.
The .brand/ Directory
After running the full pipeline, your .brand/ directory looks like this:
File Details
Platform Setup
Codex
Use the package installer, which delegates to Codex's official MCP configuration command:
Start a new Codex task after installation. Codex CLI, the Codex app, and the IDE extension share the same MCP configuration.
Cline
Use the package installer, which delegates to Cline's official non-interactive MCP command:
Start a new Cline task, then ask: “How do I use my brand guidelines with AI?” Cline CLI and the IDE extension share the same global configuration at ~/.cline/data/settings/cline_mcp_settings.json.
Claude Code
Create .mcp.json in your project root:
Cursor
Create .cursor/mcp.json in your project root:
Windsurf
Create ~/.codeium/windsurf/mcp_config.json:
Claude Desktop
One-click: install the MCP Bundle — download brandsystem-mcp-<version>.mcpb from the latest GitHub release and open it with Claude Desktop. You choose the brand project folder (where .brand/ lives) and the tool profile (core or full) in the install dialog. Maintainers build the bundle with npm run build:mcpb (→ build/brandsystem-mcp-<version>.mcpb); its manifest is generated from package.json and the registered Core tools.
Manual: open Settings > Developer > Edit Config (claude_desktop_config.json). Claude Desktop does not start servers in your project folder, so set BRANDSYSTEM_PROJECT_DIR to the folder that holds (or will hold) .brand/:
Compatibility at a glance
Three distinct ways to get your brand into an AI tool — don't conflate them:
Claude Chat (no MCP)
If you are using Claude Chat without MCP support:
- Run the pipeline in a code environment first to generate
brand-report.html
- Upload the HTML file to your Claude Chat conversation
- Say: "Use this as my brand guidelines for everything we create"
The report HTML is self-contained and works as a standalone brand reference in any AI tool.
Troubleshooting
"No .brand/ directory found"
Every tool except brand_start, brand_init, and brand_feedback requires a .brand/ directory. Run brand_start first.
If you are using the hosted-brand flow instead of local extraction, brand_brandcode_connect also scaffolds .brand/ automatically on first connect.
Empty extraction (no colors or fonts found)
This usually means the website loads CSS dynamically via JavaScript. brand_extract_web only parses static CSS from <style> blocks and linked stylesheets. Solutions:
- Run
brand_extract_visual to analyze a single rendered page with headless Chrome and computed styles
- Run
brand_extract_site to sample representative pages across desktop and mobile and save extraction-evidence.json
- Run
brand_generate_designmd after extraction or manual edits to regenerate design-synthesis.json and DESIGN.md
- Try a different page that uses more inline/linked CSS (e.g., the homepage, a blog post)
- Use Figma extraction (
brand_extract_figma) for higher accuracy
- Set values manually using
brand_clarify after extraction
brand_start in mode='auto' already tries this visual fallback when extraction quality is low and Chrome/Chromium is available, then generates design-synthesis.json and DESIGN.md from the best available evidence.
Figma extraction fails
brand_extract_figma doesn't connect to Figma directly. It works in two phases:
- Plan returns instructions for what data to fetch (variables, styles, logo)
- Ingest processes data you pass back from the Figma MCP tools
Make sure you have a separate Figma MCP server connected (e.g., @anthropics/figma-mcp) and pass the fetched data to brand_extract_figma in ingest mode.
Logo not detected
Web extraction looks for <img>, <svg>, and <link rel="icon"> elements. If your logo is rendered via JavaScript or embedded as a CSS background, use brand_set_logo to add it manually with SVG markup, a URL, or a data URI.
"Response size exceeds 5K target" (console warning)
This is a soft warning, not an error. Some tools (brand_write, brand_deepen_identity) return rich conversation guides that exceed 5K characters. The hard limit is 50K, which triggers truncation.
Server won't start
Reporting feedback
Use brand_feedback to report bugs, friction, or ideas:
For agent telemetry, use category="agent_signal" with signal, tool_used, and signal_context. Brand context is auto-populated from .brand/config.
How It Works
Confidence Scoring
Every extracted value carries a confidence level:
Source Precedence
When the same brand element is found in multiple sources, the higher-precedence source wins:
A Figma-sourced primary color will replace a web-extracted one. A manually confirmed value overrides both automated sources. Within the same source, higher confidence wins.
Web Extraction
brand_extract_web fetches the target URL and:
- Parses all
<style> blocks and up to 5 linked stylesheets
- Extracts color values from CSS properties and custom properties
- Infers color roles from property names (e.g.,
--primary, --brand-accent)
- Promotes the most-frequent chromatic color to "primary" if no explicit primary is found
- Extracts font families and ranks by frequency
- Finds logo candidates from
<img>, <svg>, and <link rel="icon"> elements
- Downloads and embeds logos as inline SVG or base64 data URIs
Visual Extraction
brand_extract_visual launches headless Chrome against the target URL and:
- Captures a 2x DPR screenshot of the rendered page
- Extracts computed styles from semantic elements such as body, header, hero, links, cards, and buttons
- Reads CSS custom properties from
:root
- Infers likely color roles from visual context (for example, button background → primary)
- Returns the screenshot as an MCP image block so the calling agent can do qualitative visual analysis
This is the fallback path for JS-rendered apps and page builders where static CSS parsing misses key brand signals.
Deep Site Extraction
brand_extract_site extends the rendered-path beyond the homepage:
- Discovers representative pages on the same domain
- Captures desktop and mobile screenshots for each selected page
- Samples multiple instances of buttons, cards, links, inputs, sections, and other components
- Persists the results to
.brand/extraction-evidence.json
- Feeds that evidence into
brand_generate_designmd / brand_compile to produce .brand/design-synthesis.json and .brand/DESIGN.md
- Merges additional colors and fonts back into
core-identity.yaml when merge=true
Use this when the homepage is not enough to understand the brand system, or when you want richer evidence before token compilation.
Figma Extraction
brand_extract_figma works in two steps to bridge between the Figma MCP and brandsystem:
- Plan mode -- Returns specific instructions for what data to fetch from Figma (variables, text styles, logo components)
- Ingest mode -- Processes the collected Figma data, maps variable names to roles, and merges into
core-identity.yaml at high confidence
DTCG Token Compilation
brand_compile transforms core-identity.yaml into Design Tokens Community Group format:
- Colors become
$type: "color" tokens keyed by role. When a site has two legitimate same-role colors in the same theme (for example a page surface and a muted panel surface), the runner-up is kept as a role variant (surface-alt, text-secondary, neutral-alt, border-alt, accent-alt, action-alt), compiled as a sibling token such as color.surface-alt with variantOf in its extensions. A variant needs at least medium confidence, the same source tier as the base color, and a visible difference from it. Each base role gets at most one variant per theme
- Typography becomes grouped tokens with
fontFamily, dimension (size), and fontWeight entries
- Spacing becomes
dimension tokens with scale values
- Each token includes
$extensions["com.brandsystem"] with source and confidence metadata
- Only values with
medium or higher confidence are included
The Bigger Picture
Four verbs stack — Build, Use, Evolve, Deploy. @brandsystem/mcp owns Build. The .brand runtime is what moves between them.
Build — this package. Extract identity. Compile governance. Produce a .brand/ directory.
Use — @brandcode/mcp hosted at mcp.brandcode.studio/{slug}. Authorized MCP clients fetch the live Full Brand Runtime by default.
Evolve — Brandcode Studio. Taste notes graduate from memory to formal governance. Anti-patterns accumulate. The runtime sharpens with every production cycle.
Deploy — the governed .brand repo travels with you. Point Claude Design at it. Compile packs for Claude Code, Chat, Gemini, NotebookLM. Every surface consumes the same runtime.
Progressive Depth
Each stage builds on the previous. Stop anywhere — you get value immediately.
Stages 1–4 are the standalone local MCP flow. Open source, fully portable, no account required.
Stages 5–7 are the Deploy path — where the .brand runtime becomes shared, served live, and consumed by every generation surface. Available through Brandcode Studio and Column Five Media.
What's Portable
Development
Project Structure
Agent Evaluation Suite
The eval/ directory ships fixtures, methodology, and a runnable harness measuring what matters to agents: first-tool selection on real prompts, response token budgets, envelope conformance, compliance-check accuracy against labeled cases, and whether a second agent can use a generated runtime with no explanation. Run the deterministic tier with npm run eval; the model-dependent tier (first-tool selection) is opt-in via ANTHROPIC_API_KEY. Results are published only from actual runs with stated model versions and dates — the repo ships evidence machinery, not claims. See eval/README.md.
Security
- Report vulnerabilities privately via the repository's Security page → Advisories → "Report a vulnerability". See SECURITY.md. Please don't open public issues for suspected vulnerabilities.
- Local-first by design. Extraction and compilation run on your machine. Network activity is limited to: fetching the sources you point the tools at (websites, Figma via your own Figma MCP), optional Brandcode Studio connector calls when you connect a hosted brand, and optional
brand_feedback reports.
- What gets written locally: everything lands in
.brand/ inside your working directory. Connector credentials are stored in .brand/brandcode-auth.json (gitignored).
License
MIT