Design-Code Registry MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Design-Code Registry MCP find the React implementation for the Button design component"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Design-Code Registry MCP
A deterministic, project-agnostic MCP server that maps design components, tokens, and patterns to their code implementations — across any design tool and any framework.
It's a lightweight, git-friendly alternative to Figma Code Connect, built as a generic knowledge layer that any MCP-compatible AI coding agent (Claude Code, Cursor, Codex, OpenCode, ...) can query.
Figma Design ↕ Design Component / Token / Pattern ↕ Code ImplementationWhy this exists
AI coding agents are good at writing code but bad at knowing "does this project already have a Button component, and if so, what's it called and where does it live?" Today that knowledge either lives in an agent's fuzzy inference (unreliable) or is coupled tightly to one specific design tool + framework pairing (Figma Code Connect, which is React/Figma-only).
Core principle: exact registry data beats AI inference. If the registry has an explicit mapping, the agent should never need to guess it. If it doesn't, the agent should be told "unresolved" rather than making something up.
This project is:
Not an AI model. It's a structured knowledge layer exposed through MCP tools.
Not a vector database / RAG. Resolution is exact-match only (id, design reference, canonical name, alias) — never embeddings or fuzzy similarity.
Not tied to any framework or design tool. React, Vue, Svelte, SwiftUI, Flutter, HTML — and Figma, Sketch, Penpot, or anything else — are all just strings in the schema, not special cases in the code.
Related MCP server: Component MCP Server
Architecture
AI Agent (Claude Code, Cursor, ...)
│
↓
MCP Protocol (stdio)
│
↓
Design-Code Registry MCP (this package — the generic engine)
│
FileRegistryProvider
│
┌──────────────┼──────────────┬─────────────┐
↓ ↓ ↓ ↓
components.json tokens.json patterns.json rules.json
│
.design/registry/ (your project — the data)The server (this npm package) is generic and reusable across completely different projects. The registry
(.design/registry/ in your project) is where all project-specific facts live, as plain JSON files that are
readable, diffable, and mergeable in git.
Registry concepts
Concept | File | What it captures |
Manifest |
| Schema version, project info, primary design tool. |
Component |
| A design component (e.g. Button) → one or more code implementations, across languages/frameworks. |
Token |
| A design token (color, spacing, typography, ...) with a stable id and value. |
Pattern |
| A higher-level composition of components (e.g. "empty state" = message + Button). |
Rules |
| Structured project decisions an agent must respect (e.g. "reuse Button, don't create a new one"). |
A single component can have multiple implementations — the same design concept mapped to React, Vue, SwiftUI, and Flutter simultaneously, if your project needs that:
{
"id": "button",
"name": "Button",
"implementations": [
{ "language": "typescript", "framework": "react", "component": "Button", "sourcePath": "src/components/Button.tsx" },
{ "language": "dart", "framework": "flutter", "component": "AppButton", "sourcePath": "lib/widgets/app_button.dart" }
]
}Design references are generic too — tool is an open string, not an enum, so adding support for a new design
tool never requires a schema migration:
{ "tool": "figma", "fileId": "abc123", "nodeId": "12:340", "url": "https://figma.com/file/abc123?node-id=12-340" }See src/schema/ for the full, commented schema (Zod), and
examples/fictional-project/ for a complete worked example.
Deterministic resolution
registry_find_by_design_reference and the underlying resolver never guess. They try, in this fixed order, and
stop at the first strategy that produces a match:
Exact design reference (tool + node/file/url/name)
Exact registry id
Exact canonical name
Explicit alias
Otherwise:
unresolved
If a strategy matches more than one component, resolution stops there and reports ambiguous with every
candidate — it never silently picks one:
// unresolved
{ "status": "unresolved" }
// ambiguous
{ "status": "ambiguous", "strategy": "alias", "candidates": [ /* ... */ ] }
// resolved
{ "status": "resolved", "strategy": "design-reference", "component": { "id": "button", /* ... */ } }MCP tools
Read
Tool | Purpose |
| Get registry metadata (schema version, project, design tool). |
| List components, optionally filtered by status/tag. |
| Fetch one component by exact id. |
| Deterministic substring search across id/name/aliases/tags. |
| Resolve a design-tool reference to a component (see above). |
| List tokens, optionally filtered by category. |
| Fetch one token by exact id. |
| List UI patterns. |
| Fetch one pattern by exact id. |
| Get the full structured rules document. |
| Run full registry validation (see below). |
Write
Tool | Purpose |
| Create a new starter registry. Fails if one exists (unless |
| Create a component. Fails on duplicate id. |
| Patch an existing component. Fails if the id doesn't exist. |
| Mark a component deprecated (no destructive delete exists). |
| Same create/update contract, for tokens. |
| Same create/update contract, for patterns. |
| Replace the full rules document (send the complete desired list). |
Mutation safety: creating an id that already exists is an error (use update instead); updating an id that
doesn't exist is an error (use create instead); there is no destructive delete for components — use
registry_deprecate_component so history survives in git.
Validation
registry_validate (and design-code-registry validate in the CLI) checks the whole registry for:
Duplicate ids within components/tokens/patterns/rules
Duplicate design references (two components claiming the same Figma node)
Broken references (a pattern pointing at a component that doesn't exist, a deprecation
replacedBypointing nowhere, a rule'sappliesTo.idpointing nowhere)Circular pattern references (pattern A → related pattern B → related pattern A)
Missing implementations on approved components (warning, not an error)
{
"valid": false,
"errorCount": 1,
"warningCount": 0,
"issues": [
{ "severity": "error", "code": "BROKEN_REFERENCE", "message": "Pattern \"empty-state\" references component \"buton\", which does not exist.", "location": "pattern:empty-state" }
]
}CLI
Human-facing interface over the same RegistryService the MCP tools use — behavior never drifts between the two.
npx design-code-registry-mcp init --name "My Project" --design-tool figma
design-code-registry validate
design-code-registry list components --status approved
design-code-registry list tokens --category color
design-code-registry list patterns
design-code-registry add component --id button --name Button
design-code-registry add token --id color-primary --name "Primary" --category color --value "#3B5BFF"
design-code-registry add pattern --id empty-state --name "Empty State" --components buttonEvery command accepts -p, --path <path> to point at a specific registry, or reads DESIGN_REGISTRY_PATH.
Installation
npm install -g design-code-registry-mcp
# or, without installing:
npx design-code-registry-mcp init
# or install locally:
npm run build
claude mcp add --scope project design-registry -- node /ABSOLUTE/PATH/TO/design-code-registry-mcp/dist/index.jsClaude Code setup
Add the server to your Claude Code MCP configuration (.mcp.json at your project root, or via
claude mcp add):
{
"mcpServers": {
"design-code-registry": {
"command": "npx",
"args": ["-y", "design-code-registry-mcp"]
}
}
}Or, with an explicit registry path (useful in a monorepo):
{
"mcpServers": {
"design-code-registry": {
"command": "npx",
"args": ["-y", "design-code-registry-mcp", "--registry-path=./packages/design-system/.design/registry"]
}
}
}The server works with any MCP-compatible client over stdio — Claude Code is one client among several, not a dependency of the server itself.
Figma MCP integration
This server does not talk to the Figma API or inspect Figma files — that's Figma's own MCP server's job. The two are designed to be complementary:
Figma MCP → design context (fileKey, nodeId, ...) → Design-Code Registry MCP → explicit mapping → AI agent → codeA typical agent workflow:
Agent asks Figma MCP for the selected node's
fileKey/nodeId.Agent calls
registry_find_by_design_referenceon this server with those identifiers.If
resolved, the agent reuses the returned implementation. Ifunresolved, the agent may propose a new component (per your project's rules) and register it withregistry_create_component.
Multi-framework example
A single registry can describe implementations across totally different codebases:
Button (design concept)
├── React → src/components/Button.tsx
├── Vue → src/components/Button.vue
├── SwiftUI → Sources/Button.swift
└── Flutter → lib/widgets/app_button.dartNothing about the server changes based on which of these your project uses — the schema treats language and
framework as open strings.
Example project
examples/fictional-project/ contains a complete, validated example registry
(Button, Input, Card, Modal, two patterns, seven tokens, five rules) for a fictional "Aurora Design System." Copy
.design/registry/ from there as a starting point, or run:
cp -r examples/fictional-project/.design .AI agent usage contract
Agents connected to this server should:
Query the registry before creating any reusable UI component.
Resolve exact mappings first — never guess a mapping when one might exist.
Reuse existing registered implementations rather than duplicating them.
Read relevant tokens and patterns before generating styles/layout.
Report
unresolvedhonestly rather than inventing a mapping.Never create a new canonical component when
registry_find_component/registry_find_by_design_referenceshows an equivalent one already exists.Only propose a new component when no appropriate existing one exists.
Treat all registry mutations as explicit, deliberate actions — not incidental side effects.
Treat the registry as authoritative for project-specific Design ↔ Code facts.
At the same time, the registry doesn't own good engineering judgment: when it's incomplete or a more maintainable approach is clearly available, an agent should say so — distinguishing verified registry facts from inferred information and recommendations — rather than mechanically obeying an incomplete registry.
Development
npm install
npm run build # compile TypeScript → dist/
npm test # build + run the full vitest suite (56 tests, including a real stdio subprocess e2e test)
npm run lint
npm run typecheckSee CONTRIBUTING.md for the project's design principles before opening a PR.
Limitations & future improvements
Only a local, file-based registry provider ships today. The
RegistryServicelayer is provider-agnostic, so a remote/API-backed provider is possible without touching MCP tool logic — just not implemented yet.No optional HTTP/SSE transport yet (stdio only), per the "don't over-engineer the first version" principle.
registry_find_componentis a deterministic substring search, not a ranked/fuzzy search — by design, but it means very loose queries may return nothing where a human would expect a near-match.No built-in Figma/Sketch/Penpot API client — this server intentionally stays downstream of tools like Figma MCP rather than duplicating their job.
License
Available Tools
20 toolsregistry_create_componentCreate a new componentA
Register a brand-new design component. Fails with DUPLICATE_ID if the id already exists — use registry_update_component instead. Only propose a new component when registry_find_component / registry_find_by_design_reference confirm no equivalent component exists.
Inputs: id (required), name (required), tags, rules, +9 more.
registry_create_patternCreate a new UI patternC
Register a brand-new higher-level UI pattern composed of one or more components.
Inputs: id (required), name (required), tags, design, +8 more.
registry_create_tokenCreate a new design tokenA
Register a brand-new design token. Fails with DUPLICATE_ID if the id already exists — use registry_update_token instead.
Inputs: id (required), name (required), value (required), category (required), +5 more.
registry_deprecate_componentDeprecate a componentA
Mark a component as deprecated instead of deleting it. There is no destructive delete operation for components by design — history stays in git and agents can still see what a component used to map to.
Inputs: id (required), reason, replacedBy.
registry_find_by_design_referenceResolve a design reference to a componentA
Deterministically resolve a design-tool reference (e.g. a Figma fileKey/nodeId pair) to a registered component. Returns status 'resolved' with exactly one component, 'ambiguous' with all matching candidates, or 'unresolved' if nothing matches. Never guesses — if you get 'unresolved', treat the mapping as genuinely absent rather than inferring one.
Inputs: tool (required), url, name, fileId, +1 more.
registry_find_componentSearch componentsA
Deterministic substring search across component id, name, aliases, tags, and description. NOT semantic/AI search — use registry_get_component or registry_find_by_design_reference when you already know an exact identifier.
Inputs: query (required).
registry_get_componentGet component by idA
Fetch a single component by its exact stable registry id. Returns an error if no such component exists.
Inputs: id (required).
registry_get_manifestGet registry manifestA
Return the registry's manifest: schema version, registry version, project info, and configured design tool(s). Use this first to confirm a registry exists and understand what project it describes.
Inputs: no named parameters.
registry_get_patternGet pattern by idA
Fetch a single UI pattern by its exact stable registry id, including the components it composes.
Inputs: id (required).
registry_get_rulesGet project rulesA
Return the full set of structured design/engineering rules (e.g. 'prefer existing Button component', 'do not use arbitrary colors'). Read this before generating UI code to respect project-specific constraints.
Inputs: no named parameters.
registry_get_tokenGet token by idA
Fetch a single design token by its exact stable registry id.
Inputs: id (required).
registry_initInitialize a new registryA
Create a complete starter registry (.design/registry/{manifest,components,tokens,patterns,rules}.json + README) at the resolved registry path. Fails if a registry already exists there unless force=true.
Inputs: projectName (required), force, designTool, projectDescription.
registry_list_componentsList componentsA
List all design components in the registry, optionally filtered by lifecycle status or tag. Use this to browse what already exists before proposing a new component.
Inputs: tag, status.
registry_list_patternsList UI patternsA
List all higher-level UI patterns (e.g. empty state, search toolbar) registered in the project.
Inputs: no named parameters.
registry_list_tokensList design tokensA
List all design tokens, optionally filtered by category (color, spacing, typography, ...).
Inputs: category.
registry_update_componentUpdate an existing componentA
Patch an existing component by id. Only provided fields are changed; omitted fields are left as-is. Fails with NOT_FOUND if the id doesn't exist yet — use registry_create_component instead.
Inputs: id (required), name, tags, rules, +9 more.
registry_update_patternUpdate an existing UI patternA
Patch an existing pattern by id. Fails with NOT_FOUND if the id doesn't exist yet.
Inputs: id (required), name, tags, design, +8 more.
registry_update_rulesReplace the project's rulesA
Replace the full set of structured design/engineering rules. This is a full-document replace (send the complete desired rule list, not a delta) so the rules file stays deterministic and diff-friendly.
Inputs: rules (required).
registry_update_tokenUpdate an existing design tokenC
Patch an existing token by id. Fails with NOT_FOUND if the id doesn't exist yet.
Inputs: id (required), name, type, usage, +7 more.
registry_validateValidate the registryA
Run comprehensive validation across the whole registry: duplicate ids, duplicate design references, broken cross-references (patterns/rules pointing at nonexistent components/tokens/patterns), circular pattern references, and other integrity issues. Returns valid=false with a list of issues if anything is wrong.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool targets a distinct resource and action: list/get/find are clearly separated, and registry_find_by_design_reference explicitly distinguishes itself from substring search. Even similar-looking component tools have descriptions that remove ambiguity about exact id vs deterministic search vs design reference resolution.
All tools follow the consistent registry_<verb>_<resource> convention, with clear verbs like list, get, find, create, update, deprecate, and validate. The few verb-only names like registry_init and registry_validate are still recognizable and fit the registry_ prefix pattern.
At 20 tools, this is on the heavier side, but the registry domain genuinely spans components, tokens, patterns, rules, manifest, and validation. Every tool has a distinct purpose, making the count feel more well-scoped than bloated.
Core lifecycle operations exist for components, tokens, and patterns, with rules and manifest covered as full documents. Minor gaps include no deprecate/remove flow for tokens or patterns and no way to update the manifest after initialization, but agents can still complete primary workflows.
Maintenance
Related MCP Connectors
Give AI agents your deeepSpace design system: components, tokens, styles and code mappings.
Build and manage your design system with AI: tokens, themes, components, icons, Figma and code.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Serves your design system and coding standards to coding agents, so they stop guessing.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceConnects Figma designs to AI agents, enabling extraction of production-ready code, assets, and design tokens through natural language descriptions. Supports React, Vue, CSS, and Tailwind with real-time design system analysis.145,772 npm40MIT
- AlicenseNot gradedqualityDmaintenanceConnects Figma designs to React components using your actual component library, enabling AI tools to generate production-ready code with proper imports.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, understand, and generate code for design system components by syncing and indexing a component library.ISC
- AlicenseAqualityDmaintenanceConverts Figma designs into structured code context with token-aware styling, enabling AI agents to generate production-level frontend code.18 npmMIT