Brandkit MCP agent

Open-source MCP server that gives AI tools native access to your company's design system — drop in your brand files, connect to Claude or any LLM tool

by ejwhite7·MIT license·★ 8 Stars on the repo·GitHub ↗

Files of Brandkit MCP

ejwhite7/main1 file
README.md
Show the full text300 lines

BrandKit MCP

Give every AI tool access to your company's complete brand atomic system via the Model Context Protocol.

npm version License: MIT Node 20+ TypeScript ejwhite7/brandkit-mcp MCP server

BrandKit MCP v2 is an open-source MCP server that exposes a company's complete brand atomic system -- verbal identity (positioning, audience, messaging, differentiation, concepts, voice) and visual identity (colors, typography, components, tokens, motion, assets) -- to Claude and other AI tools via the Model Context Protocol (MCP). It ships 18 read-only tools, one local write tool, and 14 resources. When an LLM helps build a website, app, or marketing asset, it has instant structured access to the exact brand language and visual rules it needs -- including a human-authored taste primer that carries the brand's instincts, not just its specs.

Quick Start

# 1. Install
npm install -g brandkit-mcp

# 2. Scaffold a new brand atomic system from the starter template
brandkit-mcp init

# 3. Edit the scaffolded files with your brand content

# 4. Wire into Claude Desktop (or any MCP-compatible client)
#    Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
#    {
#      "mcpServers": {
#        "brandkit": {
#          "command": "brandkit-mcp",
#          "args": ["serve"]
#        }
#      }
#    }

init refuses to change an existing brandkit.config.yaml or brand_atomic_system/ unless --force is explicit. Force performs a clean replacement only for a regular single-link config and a real directory; symbolic links, hard-linked configs, and special-file destinations are rejected.

Repository Structure

A brand atomic system lives under a single <brand-root>/ directory (default: ./brand_atomic_system):

<brand-root>/
├── readme.md
├── magic_trick.md               # human-authored taste primer
├── brandkit.config.yaml         # version: 2
├── human/                       # PDFs and human-only material (MCP ignores)
│   └── *.pdf
└── agent/
    ├── verbal/
    │   ├── positioning.md
    │   ├── audience.yaml
    │   ├── messaging.md
    │   ├── differentiation.md
    │   ├── concepts.md
    │   └── voice.md
    └── visual/
        ├── colors_and_type.css
        ├── fonts/
        ├── assets/
        ├── components/
        ├── tokens/
        ├── motion/
        │   ├── motion.json
        │   └── motion.css
        └── artifacts/
            ├── web/             # override layer
            └── product/         # override layer

The human/ directory is intentionally ignored by the MCP server -- put PDFs, print specs, or any other human-only material there. Everything under agent/ is indexed and served.

MCP Tools Reference

BrandKit MCP exposes 18 tools to AI assistants:

Tool Description
get_brand_overview High-level overview + taste primer
get_magic_trick Verbatim magic_trick.md
get_positioning Positioning document
get_audience Audience YAML, parsed
get_messaging Messaging document
get_differentiation Differentiation document
get_concepts Creative concepts/directions
get_voice Voice document
get_colors_and_type Colors + typography custom properties
get_assets Logos + brand assets
get_fonts Font faces
get_components UI primitives
get_tokens Token specimens
get_motion Motion system (json + css)
get_css colors_and_type.css + motion.css text
search_brand Full-text search
validate_usage Validate brand compliance
get_context_diff Diff base vs web vs product

The stdio transport also exposes sync_brand_docs, which updates brandkit.config.yaml, DESIGN.md, and PRODUCT.md. Network transports hide and refuse this write-capable tool by default.

Taste primer

Seven creative/verbal tools (get_brand_overview, get_positioning, get_audience, get_messaging, get_differentiation, get_concepts, get_voice) inject a _taste_primer field carrying magic_trick.md verbatim. get_magic_trick returns the primer directly without wrapping.

MCP Resources

BrandKit MCP exposes 14 brand:// URIs as MCP resources:

URI Description
brand://overview Brand overview
brand://magic_trick Taste primer
brand://verbal/positioning Positioning document
brand://verbal/audience Audience YAML
brand://verbal/messaging Messaging document
brand://verbal/differentiation Differentiation document
brand://verbal/concepts Creative concepts
brand://verbal/voice Voice document
brand://visual/colors_and_type Colors + typography CSS
brand://visual/assets Asset index
brand://visual/fonts Font face index
brand://visual/components Component index
brand://visual/tokens Token specimens
brand://visual/motion Motion system

Configuration

The brandkit.config.yaml file at your project root controls BrandKit MCP:

version: 2
brand:
  name: Acme Corp
  description: Plumbing for builders.
  root: ./brand_atomic_system
contexts: [base, web, product]
ignore:
  - human/
ingestion:
  maxFileBytes: 16777216
  maxTotalBytes: 134217728
  maxFiles: 1000
  maxDepth: 16

Ignore entries are paths relative to brand.root. They match the named path and its descendants on directory boundaries, so human/ does not match humanity/.

Brand ingestion is bounded before file content is read. The defaults allow a maximum of 16 MiB per file, 128 MiB across all unique inputs, 1,000 unique files, and 16 path segments below brand.root. Fixed documents, discovered components and tokens, manifests, fonts, and image assets all share the same budget. Directory enumeration is also capped at four times the configured file limit, so a tree of empty or unsupported entries cannot create unbounded work before file counting. In-root symlink and hard-link aliases count once by canonical file identity; an alias cannot bypass containment or a limit. Exact boundaries are accepted and the next byte, file, or path segment fails startup with a brand-relative error. Large brands can raise these typed ingestion values up to the built-in safety caps (64 MiB per file, 512 MiB total, 10,000 files, and 64 segments); maxTotalBytes must be at least maxFileBytes.

version: 2 is required. A config file missing this field or declaring version: 1 causes the server to throw BrandkitV1ConfigError at startup.

Context System

BrandKit v2 supports three contexts:

Context Purpose
base Shared foundation -- fonts, core colors, global tokens
web Overrides for the public-facing website (agent/visual/artifacts/web/)
product Overrides for the SaaS application (agent/visual/artifacts/product/)

Verbal content (agent/verbal/) has no context overrides -- it applies globally. Visual content can be overridden per context via the artifacts/ layer.

Migrating from v1

2.0.0 is a breaking release. The directory layout, context vocabulary, and tool surface have all changed. No automated migration is included -- the path mapping is manual:

v1 path v2 path
brand/shared/colors/*.css agent/visual/colors_and_type.css
brand/shared/typography/*.css agent/visual/colors_and_type.css
brand/shared/logos/* agent/visual/assets/
brand/shared/components/*.md agent/visual/components/*.md
brand/shared/voice/brand-voice.md agent/verbal/voice.md
brand/shared/guidelines/*.md agent/verbal/{positioning,messaging,differentiation,concepts}.md
brand/marketing/* agent/visual/artifacts/web/*
brand/product/* agent/visual/artifacts/product/*

Your brandkit.config.yaml must also be updated to declare version: 2 and use the new brand.root field. v1 configs throw BrandkitV1ConfigError at startup -- the server will not start until the config is updated.

Conventions

magic_trick.md is human-authored. The MCP reads it, but sync_brand_docs never writes to it. The taste primer is the brand's instincts -- it must stay human.

Token output formats. The get_tokens tool supports CSS custom properties, SCSS variables, Tailwind config, W3C Design Tokens, and flat JSON.

Brand files stay inside brand.root. Every fixed and discovered brand input is resolved and opened under the configured root. A symlink is accepted when its final target remains inside that root; symlinks and manifest paths that escape the root are ignored with a warning, and their content is never indexed or exposed through tools, resources, or preview pages.

The config must be a regular, single-link file. brandkit.config.yaml cannot be a symbolic link, hard link, directory, or other non-regular entry. The server binds config persistence to the file loaded at startup; if that path is replaced while the server is running, sync_brand_docs refuses to read or overwrite the replacement. Successful config updates use an atomic same-directory replacement and preserve existing permissions.

Transports. The server supports stdio (recommended for Claude Desktop), SSE (legacy HTTP), and Streamable HTTP (current MCP spec). Network transports remain unauthenticated when bound to loopback for local development. Before binding SSE or HTTP to any non-loopback host, set BRANDKIT_AUTH_TOKEN; clients must send it as Authorization: Bearer <token> on every request.

Network transports are read-only by default, including loopback, standalone, and Vercel deployments. To deliberately expose sync_brand_docs over SSE or Streamable HTTP, start the CLI with brandkit-mcp serve --transport http --allow-write-tools (or set allowWriteTools: true in the programmatic startServer options). Treat this as privileged mode: authentication is still mandatory for non-loopback binds. Stdio keeps the intended local write workflow without this flag. Adapters without a writable config context never advertise the tool, even if privileged mode is requested.

Every network transport rejects untrusted Host and Origin headers with HTTP 403. Loopback listeners automatically trust loopback hostnames and origins, including IPv4, IPv6, and ephemeral ports. A concrete non-loopback server.host derives trust for that exact hostname. Wildcard bindings (0.0.0.0 or ::) fail at startup unless server.allowedHosts is explicit:

server:
  transport: http
  host: 0.0.0.0
  port: 3001
  allowedHosts:
    - mcp.example.com       # hostname only; Host-header ports are ignored
  allowedOrigins:
    - https://app.example.com

allowedOrigins entries are exact HTTP(S) origins, including the port when it is non-default. If the list is empty, requests without an Origin header remain valid for MCP clients, while a supplied Origin must use a trusted Host hostname. Configure allowedOrigins explicitly when a browser application is hosted on a different origin. IPv6 entries in allowedHosts use brackets, for example [2001:db8::10].

The preview UI is deliberately loopback-only and refuses any wildcard, LAN, or public bind host. It also applies the same Host and Origin validation to every page and static asset. Use the authenticated MCP HTTP transport when data must be available beyond the local machine.

Docker Compose

The default Compose service runs the supported Streamable HTTP transport on http://127.0.0.1:3001/mcp. It uses the bundled Acme example, so a fresh checkout does not require host-side brand files. Set a bearer token before starting it:

export BRANDKIT_AUTH_TOKEN="$(node -e "process.stdout.write(require('crypto').randomBytes(32).toString('hex'))")"
docker compose up --build --wait --wait-timeout 60
npm run test:docker-smoke

The token is injected at runtime and is also required by the authenticated health check. Compose refuses to start when it is absent. To use your own brand, mount a regular config file and brand directory, set BRANDKIT_CONFIG to the container path of that config, and keep server.allowedHosts limited to the hostnames clients actually use. Do not put the token in the image or config file. Compose intentionally exposes only the authenticated MCP service; run the preview CLI separately on a trusted local machine. Existing stdio container integrations can override the image command with node /app/dist/cli/index.js serve --transport stdio --config <path> and do not need to publish a port.

Vercel

The repository includes one stateless Node.js Function at /api/mcp. Set BRANDKIT_AUTH_TOKEN in every Vercel environment and send it as a Bearer token. Vercel's VERCEL_URL and VERCEL_PROJECT_PRODUCTION_URL are trusted automatically. For a custom domain, set BRANDKIT_ALLOWED_HOSTS to a comma-separated hostname list, without schemes or paths.

The default deployment explicitly bundles templates/starter/** and serves that data read-only. To deploy another brand, set BRANDKIT_CONFIG to its repository-relative config path and update functions.api/mcp.js.includeFiles in vercel.json to include both that config and its complete brand root. Vercel runtime files are immutable; the function never advertises sync_brand_docs. Each request creates and closes its own MCP server and transport, so requests do not depend on a warm instance or session affinity.

CLI Reference

brandkit-mcp <command> [options]

Commands:
  init [directory]      Scaffold a brand atomic system from the starter template
  validate [config]     Validate configuration and scan for issues
  serve                 Start the MCP server
  preview               Start the local preview UI for browsing the brand atomic system
  docs                  Generate project documentation files

Global Options:
  --version             Show version number
  --help                Show help

serve accepts --transport <stdio|sse|http>, --host <host>, --port <number>, --config <path>, --watch, and the privileged network option --allow-write-tools.

Contributing

Contributions are welcome.

git clone https://github.com/ejwhite7/brandkit-mcp
cd brandkit-mcp
npm install
npm run build
npm test
  • TypeScript strict mode
  • ESM imports with .js extensions
  • No any types -- use proper interfaces
  • Tests use Vitest

License

MIT -- see LICENSE for details.


Built with the Model Context Protocol by Anthropic.

1# BrandKit MCP
2 
3> Give every AI tool access to your company's complete brand atomic system via the Model Context Protocol.
4 
5[![npm version](https://img.shields.io/npm/v/brandkit-mcp)](https://www.npmjs.com/package/brandkit-mcp)
6[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7[![Node 20+](https://img.shields.io/badge/Node-20%2B-green.svg)](https://nodejs.org)
8[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org)
9[![ejwhite7/brandkit-mcp MCP server](https://glama.ai/mcp/servers/ejwhite7/brandkit-mcp/badges/score.svg)](https://glama.ai/mcp/servers/ejwhite7/brandkit-mcp)
10 
11BrandKit MCP v2 is an open-source MCP server that exposes a company's complete **brand atomic system** -- verbal identity (positioning, audience, messaging, differentiation, concepts, voice) and visual identity (colors, typography, components, tokens, motion, assets) -- to Claude and other AI tools via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/). It ships 18 read-only tools, one local write tool, and 14 resources. When an LLM helps build a website, app, or marketing asset, it has instant structured access to the exact brand language and visual rules it needs -- including a human-authored taste primer that carries the brand's instincts, not just its specs.
12 
13## Quick Start
14 
15```bash
16# 1. Install
17npm install -g brandkit-mcp
18 
19# 2. Scaffold a new brand atomic system from the starter template
20brandkit-mcp init
21 
22# 3. Edit the scaffolded files with your brand content
23 
24# 4. Wire into Claude Desktop (or any MCP-compatible client)
25# Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
26# {
27# "mcpServers": {
28# "brandkit": {
29# "command": "brandkit-mcp",
30# "args": ["serve"]
31# }
32# }
33# }
34```
35 
36`init` refuses to change an existing `brandkit.config.yaml` or
37`brand_atomic_system/` unless `--force` is explicit. Force performs a clean
38replacement only for a regular single-link config and a real directory;
39symbolic links, hard-linked configs, and special-file destinations are rejected.
40 
41## Repository Structure
42 
43A brand atomic system lives under a single `<brand-root>/` directory (default: `./brand_atomic_system`):
44 
45```
46<brand-root>/
47├── readme.md
48├── magic_trick.md # human-authored taste primer
49├── brandkit.config.yaml # version: 2
50├── human/ # PDFs and human-only material (MCP ignores)
51│ └── *.pdf
52└── agent/
53 ├── verbal/
54 │ ├── positioning.md
55 │ ├── audience.yaml
56 │ ├── messaging.md
57 │ ├── differentiation.md
58 │ ├── concepts.md
59 │ └── voice.md
60 └── visual/
61 ├── colors_and_type.css
62 ├── fonts/
63 ├── assets/
64 ├── components/
65 ├── tokens/
66 ├── motion/
67 │ ├── motion.json
68 │ └── motion.css
69 └── artifacts/
70 ├── web/ # override layer
71 └── product/ # override layer
72```
73 
74The `human/` directory is intentionally ignored by the MCP server -- put PDFs, print specs, or any other human-only material there. Everything under `agent/` is indexed and served.
75 
76## MCP Tools Reference
77 
78BrandKit MCP exposes 18 tools to AI assistants:
79 
80| Tool | Description |
81|------|-------------|
82| `get_brand_overview` | High-level overview + taste primer |
83| `get_magic_trick` | Verbatim magic_trick.md |
84| `get_positioning` | Positioning document |
85| `get_audience` | Audience YAML, parsed |
86| `get_messaging` | Messaging document |
87| `get_differentiation` | Differentiation document |
88| `get_concepts` | Creative concepts/directions |
89| `get_voice` | Voice document |
90| `get_colors_and_type` | Colors + typography custom properties |
91| `get_assets` | Logos + brand assets |
92| `get_fonts` | Font faces |
93| `get_components` | UI primitives |
94| `get_tokens` | Token specimens |
95| `get_motion` | Motion system (json + css) |
96| `get_css` | colors_and_type.css + motion.css text |
97| `search_brand` | Full-text search |
98| `validate_usage` | Validate brand compliance |
99| `get_context_diff` | Diff base vs web vs product |
100 
101The stdio transport also exposes `sync_brand_docs`, which updates `brandkit.config.yaml`, `DESIGN.md`, and `PRODUCT.md`. Network transports hide and refuse this write-capable tool by default.
102 
103### Taste primer
104 
105Seven creative/verbal tools (`get_brand_overview`, `get_positioning`, `get_audience`, `get_messaging`, `get_differentiation`, `get_concepts`, `get_voice`) inject a `_taste_primer` field carrying `magic_trick.md` verbatim. `get_magic_trick` returns the primer directly without wrapping.
106 
107## MCP Resources
108 
109BrandKit MCP exposes 14 `brand://` URIs as MCP resources:
110 
111| URI | Description |
112|-----|-------------|
113| `brand://overview` | Brand overview |
114| `brand://magic_trick` | Taste primer |
115| `brand://verbal/positioning` | Positioning document |
116| `brand://verbal/audience` | Audience YAML |
117| `brand://verbal/messaging` | Messaging document |
118| `brand://verbal/differentiation` | Differentiation document |
119| `brand://verbal/concepts` | Creative concepts |
120| `brand://verbal/voice` | Voice document |
121| `brand://visual/colors_and_type` | Colors + typography CSS |
122| `brand://visual/assets` | Asset index |
123| `brand://visual/fonts` | Font face index |
124| `brand://visual/components` | Component index |
125| `brand://visual/tokens` | Token specimens |
126| `brand://visual/motion` | Motion system |
127 
128## Configuration
129 
130The `brandkit.config.yaml` file at your project root controls BrandKit MCP:
131 
132```yaml
133version: 2
134brand:
135 name: Acme Corp
136 description: Plumbing for builders.
137 root: ./brand_atomic_system
138contexts: [base, web, product]
139ignore:
140 - human/
141ingestion:
142 maxFileBytes: 16777216
143 maxTotalBytes: 134217728
144 maxFiles: 1000
145 maxDepth: 16
146```
147 
148Ignore entries are paths relative to `brand.root`. They match the named path and its descendants
149on directory boundaries, so `human/` does not match `humanity/`.
150 
151Brand ingestion is bounded before file content is read. The defaults allow a
152maximum of 16 MiB per file, 128 MiB across all unique inputs, 1,000 unique
153files, and 16 path segments below `brand.root`. Fixed documents, discovered
154components and tokens, manifests, fonts, and image assets all share the same
155budget. Directory enumeration is also capped at four times the configured file
156limit, so a tree of empty or unsupported entries cannot create unbounded work
157before file counting. In-root symlink and hard-link aliases count once by canonical file
158identity; an alias cannot bypass containment or a limit. Exact boundaries are
159accepted and the next byte, file, or path segment fails startup with a
160brand-relative error. Large brands can raise these typed `ingestion` values up
161to the built-in safety caps (64 MiB per file, 512 MiB total, 10,000 files, and
16264 segments); `maxTotalBytes` must be at least `maxFileBytes`.
163 
164`version: 2` is required. A config file missing this field or declaring `version: 1` causes the server to throw `BrandkitV1ConfigError` at startup.
165 
166## Context System
167 
168BrandKit v2 supports three contexts:
169 
170| Context | Purpose |
171|---------|---------|
172| `base` | Shared foundation -- fonts, core colors, global tokens |
173| `web` | Overrides for the public-facing website (`agent/visual/artifacts/web/`) |
174| `product` | Overrides for the SaaS application (`agent/visual/artifacts/product/`) |
175 
176Verbal content (`agent/verbal/`) has no context overrides -- it applies globally. Visual content can be overridden per context via the `artifacts/` layer.
177 
178## Migrating from v1
179 
180**2.0.0 is a breaking release.** The directory layout, context vocabulary, and tool surface have all changed. No automated migration is included -- the path mapping is manual:
181 
182| v1 path | v2 path |
183|---------|---------|
184| `brand/shared/colors/*.css` | `agent/visual/colors_and_type.css` |
185| `brand/shared/typography/*.css` | `agent/visual/colors_and_type.css` |
186| `brand/shared/logos/*` | `agent/visual/assets/` |
187| `brand/shared/components/*.md` | `agent/visual/components/*.md` |
188| `brand/shared/voice/brand-voice.md` | `agent/verbal/voice.md` |
189| `brand/shared/guidelines/*.md` | `agent/verbal/{positioning,messaging,differentiation,concepts}.md` |
190| `brand/marketing/*` | `agent/visual/artifacts/web/*` |
191| `brand/product/*` | `agent/visual/artifacts/product/*` |
192 
193Your `brandkit.config.yaml` must also be updated to declare `version: 2` and use the new `brand.root` field. v1 configs throw `BrandkitV1ConfigError` at startup -- the server will not start until the config is updated.
194 
195## Conventions
196 
197**`magic_trick.md` is human-authored.** The MCP reads it, but `sync_brand_docs` never writes to it. The taste primer is the brand's instincts -- it must stay human.
198 
199**Token output formats.** The `get_tokens` tool supports CSS custom properties, SCSS variables, Tailwind config, W3C Design Tokens, and flat JSON.
200 
201**Brand files stay inside `brand.root`.** Every fixed and discovered brand input is resolved and opened under the configured root. A symlink is accepted when its final target remains inside that root; symlinks and manifest paths that escape the root are ignored with a warning, and their content is never indexed or exposed through tools, resources, or preview pages.
202 
203**The config must be a regular, single-link file.** `brandkit.config.yaml` cannot be a symbolic link, hard link, directory, or other non-regular entry. The server binds config persistence to the file loaded at startup; if that path is replaced while the server is running, `sync_brand_docs` refuses to read or overwrite the replacement. Successful config updates use an atomic same-directory replacement and preserve existing permissions.
204 
205**Transports.** The server supports stdio (recommended for Claude Desktop), SSE (legacy HTTP), and Streamable HTTP (current MCP spec). Network transports remain unauthenticated when bound to loopback for local development. Before binding SSE or HTTP to any non-loopback host, set `BRANDKIT_AUTH_TOKEN`; clients must send it as `Authorization: Bearer <token>` on every request.
206 
207Network transports are read-only by default, including loopback, standalone, and Vercel deployments. To deliberately expose `sync_brand_docs` over SSE or Streamable HTTP, start the CLI with `brandkit-mcp serve --transport http --allow-write-tools` (or set `allowWriteTools: true` in the programmatic `startServer` options). Treat this as privileged mode: authentication is still mandatory for non-loopback binds. Stdio keeps the intended local write workflow without this flag. Adapters without a writable config context never advertise the tool, even if privileged mode is requested.
208 
209Every network transport rejects untrusted `Host` and `Origin` headers with HTTP 403. Loopback listeners automatically trust loopback hostnames and origins, including IPv4, IPv6, and ephemeral ports. A concrete non-loopback `server.host` derives trust for that exact hostname. Wildcard bindings (`0.0.0.0` or `::`) fail at startup unless `server.allowedHosts` is explicit:
210 
211```yaml
212server:
213 transport: http
214 host: 0.0.0.0
215 port: 3001
216 allowedHosts:
217 - mcp.example.com # hostname only; Host-header ports are ignored
218 allowedOrigins:
219 - https://app.example.com
220```
221 
222`allowedOrigins` entries are exact HTTP(S) origins, including the port when it is non-default. If the list is empty, requests without an `Origin` header remain valid for MCP clients, while a supplied Origin must use a trusted Host hostname. Configure `allowedOrigins` explicitly when a browser application is hosted on a different origin. IPv6 entries in `allowedHosts` use brackets, for example `[2001:db8::10]`.
223 
224The preview UI is deliberately loopback-only and refuses any wildcard, LAN, or
225public bind host. It also applies the same Host and Origin validation to every
226page and static asset. Use the authenticated MCP HTTP transport when data must
227be available beyond the local machine.
228 
229### Docker Compose
230 
231The default Compose service runs the supported Streamable HTTP transport on `http://127.0.0.1:3001/mcp`. It uses the bundled Acme example, so a fresh checkout does not require host-side brand files. Set a bearer token before starting it:
232 
233```bash
234export BRANDKIT_AUTH_TOKEN="$(node -e "process.stdout.write(require('crypto').randomBytes(32).toString('hex'))")"
235docker compose up --build --wait --wait-timeout 60
236npm run test:docker-smoke
237```
238 
239The token is injected at runtime and is also required by the authenticated health check. Compose refuses to start when it is absent. To use your own brand, mount a regular config file and brand directory, set `BRANDKIT_CONFIG` to the container path of that config, and keep `server.allowedHosts` limited to the hostnames clients actually use. Do not put the token in the image or config file. Compose intentionally exposes only the authenticated MCP service; run the preview CLI separately on a trusted local machine. Existing stdio container integrations can override the image command with `node /app/dist/cli/index.js serve --transport stdio --config <path>` and do not need to publish a port.
240 
241### Vercel
242 
243The repository includes one stateless Node.js Function at `/api/mcp`. Set
244`BRANDKIT_AUTH_TOKEN` in every Vercel environment and send it as a Bearer token.
245Vercel's `VERCEL_URL` and `VERCEL_PROJECT_PRODUCTION_URL` are trusted
246automatically. For a custom domain, set `BRANDKIT_ALLOWED_HOSTS` to a
247comma-separated hostname list, without schemes or paths.
248 
249The default deployment explicitly bundles `templates/starter/**` and serves
250that data read-only. To deploy another brand, set `BRANDKIT_CONFIG` to its
251repository-relative config path and update `functions.api/mcp.js.includeFiles`
252in `vercel.json` to include both that config and its complete brand root. Vercel
253runtime files are immutable; the function never advertises `sync_brand_docs`.
254Each request creates and closes its own MCP server and transport, so requests do
255not depend on a warm instance or session affinity.
256 
257## CLI Reference
258 
259```
260brandkit-mcp <command> [options]
261 
262Commands:
263 init [directory] Scaffold a brand atomic system from the starter template
264 validate [config] Validate configuration and scan for issues
265 serve Start the MCP server
266 preview Start the local preview UI for browsing the brand atomic system
267 docs Generate project documentation files
268 
269Global Options:
270 --version Show version number
271 --help Show help
272```
273 
274`serve` accepts `--transport <stdio|sse|http>`, `--host <host>`, `--port <number>`, `--config <path>`, `--watch`, and the privileged network option `--allow-write-tools`.
275 
276## Contributing
277 
278Contributions are welcome.
279 
280```bash
281git clone https://github.com/ejwhite7/brandkit-mcp
282cd brandkit-mcp
283npm install
284npm run build
285npm test
286```
287 
288- TypeScript strict mode
289- ESM imports with `.js` extensions
290- No `any` types -- use proper interfaces
291- Tests use Vitest
292 
293## License
294 
295MIT -- see [LICENSE](LICENSE) for details.
296 
297---
298 
299Built with the [Model Context Protocol](https://modelcontextprotocol.io) by [Anthropic](https://anthropic.com).
300 

Discussion

Alternatives