1. Conduid
  2. Blockchain
  3. Swatchbook
MCP server · Blockchain

Swatchbook

Model Context Protocol server for swatchbook — exposes a DTCG project's tokens, axes, and diagnostics to AI agents without running Storybook.

54Fair

Scored 1 hours ago · breakdown

About Swatchbook

Swatchbook is an MCP server published by unpunnyfuns in the Blockchain category: model Context Protocol server for swatchbook — exposes a DTCG project's tokens, axes, and diagnostics to AI agents without running Storybook. Conduid read 14 tools from its source: describe_project, emit_css, get_alias_chain, get_aliased_by, get_axis_variance, get_color_contrast and 8 more. It is published to npm as @unpunnyfuns/swatchbook-mcp and starts with npx.

The unpunnyfuns/swatchbook monorepo this package is published from has 28 stars and 1 forks, and its last commit was on 27 Nov 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include design-system, design-tokens, storybook and storybook-addon.

Install

Claude Code
claude mcp add swatchbook -- npx -y @unpunnyfuns/swatchbook-mcp
npx
npx -y @unpunnyfuns/swatchbook-mcp
From source
git clone https://github.com/unpunnyfuns/swatchbook

Tools (14)

describe_projectHigh-level summary of the project — total token count per theme, axes (with contexts) and how they compose, preset list, diagnostic counts by severity, css-var prefix, and the DTCG `$type`s present. Good first call for an agent that needs an orientation before querying specifics.
emit_cssReturn the full project CSS — a `:root` baseline + per-axis singleton cells (`[data-<prefix>-<axis>="<context>"]`) + compound joint-override blocks for tokens whose value at a multi-axis combination diverges from cascade composition + a trailing chrome alias block. Same output the addon injects into Storybook and the docs-site chrome pipeline writes to disk. Useful when an agent needs to inline the stylesheet into a generated artifact.
get_alias_chainForward alias chain for a token — the sequence of paths it resolves through on the way to a primitive value (e.g. `color.accent.bg → color.brand.blue.700 → color.palette.blue.700`). Returns the chain per theme because aliases can resolve through different paths per axis context. Empty chain when the token is a primitive (no aliases) or missing.
ParameterTypeDescription
path *stringDot-path of the token, e.g. `color.accent.bg`.
get_aliased_byBackward alias tree for a token — every token that resolves through this path at any depth. Breadth-first walk with cycle protection; `maxDepth` caps recursion (default 6). Empty when nothing aliases the token.
ParameterTypeDescription
maxDepthnumberMaximum recursion depth. Default 6.
path *stringDot-path of the token, e.g. `color.palette.blue.500`.
get_axis_varianceClassify how a token's resolved value depends on the project's axes. Returns `kind` — `constant` (same across every tuple), `single` (varies with exactly one axis, e.g. mode only), or `multi` (varies across two or more axes). Also returns `varyingAxes` / `constantAcrossAxes` plus a `perAxis` breakdown with each context's stringified value (holding other axes at their defaults). Use when reasoning about whether a token is theme-independent, whether a refactor changed an axis dependency, or to confirm that (say) a role token only varies with `contrast`.
ParameterTypeDescription
path *stringDot-path of the token to analyse, e.g. `color.text.default`.
get_color_contrastCompute the contrast between two color tokens for a given theme. The score is returned under `value`: WCAG 2.1 returns the ratio (1–21) plus AA/AAA pass flags for normal + large text; APCA returns the signed Lc value plus body / large-text / non-text pass flags (absolute-value thresholds 75 / 60 / 45). Use this when reasoning about text legibility, focus-ring visibility, border contrast, etc., without having to reimplement the luminance math in the agent. Per-theme so the same pair can be checked against Light, Dark, High-contrast, etc.
ParameterTypeDescription
algorithmstringContrast algorithm. `wcag21` is the classic 4.5:1 ratio; `apca` is the perceptually-weighted Silver-draft successor. Defaults to `wcag21`.
background *stringDot-path of the background color token, e.g. `color.surface.default`.
foreground *stringDot-path of the foreground color token, e.g. `color.text.default`.
themestringTheme name. Defaults to the project default theme.
get_color_formatsFor a color token, return its value rendered in every format the addon toolbar exposes — `hex`, `rgb`, `hsl`, `oklch`, and the raw JSON. Each entry carries an `outOfGamut` flag when the chosen colorspace can't losslessly represent the token (wide-gamut tokens rendered in sRGB, for example). Skips non-color tokens.
ParameterTypeDescription
path *stringDot-path of a color token, e.g. `color.accent.bg`.
themestringTheme name to read the value from. Defaults to the project default theme.
get_css_usageCSS var reference + resolved value + HTML data-attribute activation for a token under an optional axis tuple. Tells an agent everything it needs to write a stylesheet or JSX snippet that pins a particular theme combination — `selector` is the compound CSS selector that matches the tuple on `<html>`, `attrs` is the same information as HTML attributes, `cssVar` is the `var(--…)` reference. Tuple defaults to the project default when omitted.
ParameterTypeDescription
path *stringDot-path of the token, e.g. `color.accent.bg`.
tupleobjectOptional axis tuple (e.g. `{ mode: "Dark", brand: "Brand A" }`). Defaults to each axis's own default.
get_diagnosticsList parser / resolver / validation diagnostics for the project. Each entry carries a severity (`error`, `warn`, `info`), group, message, and optional filename / line / column for locating the issue.
ParameterTypeDescription
severitystringOptional severity filter. Omit for all diagnostics.
get_tokenGet full details for a single token: resolved value in every theme, DTCG `$type`, `$description`, `$deprecated` (message or `true` when the token is deprecated), an axis-variance summary (`kind` + the axes it flips across, present only when it varies — see `get_axis_variance` for the per-axis breakdown), alias chain, aliased-by list, and CSS var reference. Use after `list_tokens` to inspect a specific path.
ParameterTypeDescription
path *stringDot-path of the token, e.g. `color.accent.bg`.
list_axesList the project axes — each axis has a name, its contexts (discrete values like `Light` / `Dark`), a default, and a source (`resolver` for DTCG-resolver-driven, `layered` for authored layered axes, `synthetic` for single-theme projects). Also returns the named themes (one per default tuple + per-axis non-default singleton + preset) and any presets defined in the project config.
list_tokensList token paths in the project, optionally filtered by path glob (`color.*`, `color.palette.**`) and/or DTCG `$type` (color, dimension, typography, …). Returns path + $type + stringified value from the default theme. Use this first to discover what tokens exist; follow with get_token for details.
ParameterTypeDescription
filterstringDot-path glob, e.g. `color.*` or `color.palette.**`. Omit for all tokens.
themestringTheme name to read values from. Defaults to the project default theme.
typestringDTCG `$type` to scope the result, e.g. `color`, `dimension`, `typography`.
resolve_themeResolve the full token map for a given axis tuple. Agent passes a partial tuple (`{ mode: "Dark", brand: "Brand A" }`); any axis omitted — or the whole `tuple` argument itself — falls back to that axis's default, so calling with no `tuple` resolves the project default theme. Returns the matching theme name, the complete tuple after filling defaults, and the resolved `{ path: { value, type, aliasOf?, aliasChain? } }` map — effectively "what do all tokens look like if I pin this combination".
ParameterTypeDescription
filterstringOptional path glob to scope the returned map.
tupleobjectPartial axis tuple, e.g. `{ mode: "Dark", brand: "Brand A" }`. Omit for the project default theme.
typestringOptional DTCG `$type` to scope the returned map.
search_tokensFuzzy search across token paths, `$description`, and stringified values. Case-insensitive, tolerates a single-character typo per term, and accepts out-of-order terms (`"blue palette"` finds `color.palette.blue.500`). Returns matches ranked by relevance with a short snippet pointing at where the match hit. Use when you know what you want but not the exact path. Scopes to a single theme (default: project default).
ParameterTypeDescription
limitnumberCap the result count. Default 50.
query *stringFuzzy query (case-insensitive).
themestringTheme name to search within. Defaults to the project default.

Security checks

From the unpunnyfuns/swatchbook monorepo, not this package alone.

  • ✓README presentThe repository's README runs to about 246 words.

5 checks have not been run yet.

README

The repository's README runs to about 246 words. The original in the repository is authoritative.

Read full README
Questions

About Swatchbook

How do I install Swatchbook?

In Claude Code, run claude mcp add swatchbook -- npx -y @unpunnyfuns/swatchbook-mcp. Other MCP clients take the command after "--" in their server configuration.

Is Swatchbook safe to use with an AI agent?

Its trust score is 54 out of 100 (fair). It passes all 1 static checks Conduid ran on the repository. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Swatchbook still maintained?

Yes — the last commit in the unpunnyfuns/swatchbook monorepo was 4 days ago. The unpunnyfuns/swatchbook monorepo has 28 stars and 1 forks.

What tools does Swatchbook provide?

Conduid read 14 tools from the source: describe_project, emit_css, get_alias_chain, get_aliased_by, get_axis_variance, get_color_contrast, get_color_formats, get_css_usage and 6 more. 11 of them publish their parameters, listed under Tools above.