Primitiv
Primitiv provides a design contract layer that reconciles design information from multiple sources (Figma, codebase, Storybook, token files) and exposes it to AI agents via MCP tools.
Get Design Context (
get_design_context): Retrieve the full resolved design system contract, including tokens, components, conflicts, and inferred rules. Supports filtering by category (all,tokens,components,conflicts) and token subcategory (colors,spacing,typography,borderRadius,shadows).Look Up a Token (
get_token): Find a specific design token by name, optionally narrowing results by category (colors, spacing, typography, borderRadius, shadows).Look Up a Component (
get_component): Retrieve details about a specific UI component, including its source provenance, props, and variants — enabling reuse rather than recreation.Get Design Conflicts (
get_conflicts): View conflicts detected between design sources, filterable by type (all,token,component) and status (all,pending,resolved), including suggested fixes.Get Inferred Design Rules (
get_inferred_rules): Access design rules automatically extracted from codebase patterns, filterable by category (spacing, color, typography, border-radius, naming, components).
Scans Figma files to extract design tokens and components, reconciles conflicts with other sources, and includes them in the authoritative design contract.
Scans Storybook documentation to extract component information and props, reconciles conflicts with other sources, and includes them in the authoritative design contract.
Primitiv
The design system contract keeping teams and agents in sync.
Retrieval gives you data. Reconciliation gives you truth.
The problem
Design-system knowledge is spread across code, Figma, Storybook, and documentation. When those sources drift, people reconcile the differences through experience; AI coding agents often fall back to generic patterns that work but do not belong in the product.
Primitiv gives every agent the same current design context through a machine-readable contract and a read-only MCP interface. It helps agents reuse what exists, follow established decisions, and surface inconsistencies before they ship.
Primitiv runs locally. Your code never leaves your machine.
Related MCP server: Figma MCP Server by Bao To
Quick start
Run these commands from your project root:
npx @ai-by-design/primitiv init
npx @ai-by-design/primitiv build
npx @ai-by-design/primitiv serveinit sets up Primitiv for the current project, build creates its design contract, and serve makes that contract available to MCP-compatible agents.
See the Primitiv documentation for installation, configuration, commands, and integration guides.
Keep Primitiv configured at project level. A global MCP configuration can serve the wrong project's contract when you switch repositories.
Capabilities
Bring design context from your codebase, Figma, and Storybook together
Make existing tokens, components, rules, and rationale available to agents
Surface conflicts, drift, and hardcoded token misuse
Provide read-only access from MCP-compatible agents and editors
Verify that the contract stays current in CI
Project links
Available Tools
6 toolsget_componentARead-only
Look up a component by name or id. Read-only, no side effects. Pass context (your current working file or directory) so same-name components resolve by path scope. Returns the component JSON (with its id) when the lookup resolves to exactly one component, or an error listing available names if not found. Detail is opt-in: pass 'api' for the component's declared prop contract, 'usage' for static JSX-site counts and observed prop values, 'relationships' for sorted outgoing uses and derived incoming usedBy counts, or 'all' for every projection. These are static source-site facts, never runtime frequency. When several components share the name and neither governance nor scope decides, returns { ambiguous, matches, instruction } — follow the instruction: match each candidate's rationale.when against the user's intent, and if that doesn't decide, ask the user; never pick arbitrarily. Use this when you need implementation details for a known component to reuse it rather than recreate it. For a list of all components, use get_design_context with category 'components' instead.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| detail | No | ||
| context | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Even though the readOnlyHint annotation already signals safety, the description goes well beyond it by disclosing exact resolution behavior: same-name resolution by context path scope, error behavior when not found, the meaning of each detail projection, and the static-source-facts caveat. It also precisely describes the ambiguous-match response shape with { ambiguous, matches, instruction } and instructs the agent to follow the instruction rather than pick arbitrarily.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is dense but every sentence adds distinct value: purpose, read-only guarantee, context semantics, return behavior, detail options, static facts caveat, ambiguity protocol, and usage alternative. It is front-loaded with the core lookup purpose and then layers essential behavioral details without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given there is no output schema, the description thoroughly explains return values, error cases, ambiguity handling, and parameter behaviors. It covers all necessary contingencies for correct invocation and interpretation, including how to disambiguate by rationale.when and when to ask the user. The description is complete for a tool of this complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description carries the full burden, and it succeeds. It explains that 'name' can be either a name or id, that 'context' is used for path-scoped resolution of same-name components, and it defines each enum value of 'detail' with concrete projections. This adds substantial meaning beyond the bare schema types and enum list.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool looks up a component by name or id, with an explicit read-only guarantee. It differentiates itself from the sibling get_design_context by noting that the sibling provides the list of all components. The verb 'look up' plus the resource 'component' makes the purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit when-to-use guidance: use this tool when you need implementation details for a known component to reuse rather than recreate it. It also names the alternative get_design_context for listing all components, preventing misuse. The ambiguity-resolution instructions further guide the agent on what to do when lookup returns multiple matches.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_conflictsARead-only
Get conflicts between design sources. Read-only, no side effects. Returns JSON with conflict count, actionable count, and a list of conflicts with type, name, resolution status, and suggested fixes. Pass type: 'all' | 'token' | 'component' (default 'all'). Pass status: 'all' | 'pending' | 'resolved' (default 'pending'). Use this to audit disagreements between sources (e.g. Figma vs codebase). For resolved design values, use get_token or get_component instead.
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | ||
| status | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite having readOnlyHint, description adds behavior details: read-only nature, output structure (JSON with conflict count, actionable count, list with fields), and parameter defaults. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is compact and well-organized: action, behavior, output, parameters, and usage guidance all covered in 3 sentences without redundancy or unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Comprehensive for a tool with 2 optional params and no output schema: explains purpose, output shape, parameter semantics, and alternatives. No missing critical information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema only provides type/status as strings without descriptions. Description fully explains allowed values ('all'|'token'|'component', 'all'|'pending'|'resolved') and defaults (all), compensating for schema gaps.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool returns conflicts between design sources, with a specific verb and resource. Differentiates from siblings by explicitly directing resolved-value lookups to get_token/get_component.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (audit disagreements between sources) and when not to (for resolved values, use other tools). Provides context with example (Figma vs codebase).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_design_contextARead-only
Get the resolved design system context before building UI. Read-only, no side effects. Default (no category) returns a JSON summary of token counts, component names, conflict counts, and contract metadata. Pass category: 'all' | 'tokens' | 'components' | 'conflicts' to get full detail. Pass tokenCategory to filter tokens: colors, spacing, sizes, typography, borderRadius, shadows, zIndex, breakpoints, motion (unknown/aliased categories return an actionable error, not a silent empty result). Use this as the first call to understand what exists. For lookups by name, use get_token or get_component instead.
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | ||
| tokenCategory | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotation readOnlyHint is reinforced and expanded with 'no side effects' and details about error behavior for unknown categories, adding value beyond annotations. No contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is dense and structured, front-loading purpose with subsequent sentences adding detail. Slightly verbose but each clause carries useful info.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, it describes the default summary output and category-specific detail, including error handling for unknown categories, making it complete for the agent to assess its use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description fully compensates by explaining category values ('all', 'tokens', 'components', 'conflicts') and tokenCategory list, plus behavior for valid and invalid inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets the resolved design system context, distinguishes it from lookups by name with 'For lookups by name, use get_token or get_component instead.'
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to use this as the first call to understand what exists, and names alternatives for specific lookups, providing clear context for when to use versus not.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_inferred_rulesARead-only
Get the design rules inferred from your codebase patterns. Read-only, no side effects. Returns JSON with a list of rules including category, pattern, and confidence, or an error if no rules have been generated yet. Pass category to filter: spacing, colors, typography, borderRadius, naming, components. Omit category to get all. Use this to understand implicit conventions the codebase follows. For explicit design token values, use get_token. For source conflicts, use get_conflicts.
| Name | Required | Description | Default |
|---|---|---|---|
| category | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, and the description repeats that fact. It adds useful behavioral context beyond the annotation: returns a JSON list with category/pattern/confidence, errors if no rules have been generated, and supports filtering by category.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is dense but front-loaded, with every sentence adding value: purpose, safety, return shape, filter usage, and alternative tools. No wasted words or repetition of schema-only details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (one optional parameter, no output schema), and the description covers the return format, error case, filter values, and usage context. It is fully adequate for correct tool invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description fully compensates by enumerating exact accepted values: spacing, colors, typography, borderRadius, naming, components. It also explains that omitting the parameter returns all rules.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: "Get the design rules inferred from your codebase patterns." It clearly differentiates from siblings by naming get_token and get_conflicts as alternatives for other intents.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use the tool ("understand implicit conventions") and provides exclusions: "For explicit design token values, use get_token. For source conflicts, use get_conflicts." Also explains category filtering and omission behavior.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_tokenARead-only
Look up a specific design token by name. Read-only, no side effects. Returns the token's name, value, and category, or an error if not found. Pass category to narrow search: colors, spacing, sizes, typography, borderRadius, shadows, zIndex, breakpoints, motion (aliases like 'color'/'radius'/'z-index' are normalized). Omit category to search all. Use this when you know the token name. For a broad overview of all tokens, use get_design_context with category 'tokens' instead.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| category | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Although annotations already declare readOnlyHint=true, the description adds meaningful behavioral detail: 'Read-only, no side effects,' explains the return value, and discloses the error condition when the token is not found. It also explains alias normalization for categories, which goes beyond the annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is composed of three well-structured sentences, with the primary action and read-only guarantee front-loaded, followed by return/error behavior, then category semantics and sibling-tool guidance. Each sentence earns its place, though the category-alias list makes it slightly denser than strictly necessary.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter look-up tool, the description is complete: it covers input semantics, return behavior, error outcome, category normalization, and alternative tool usage. No output schema is present, but the description explicitly lists what the return contains and the error case, so the agent can predict behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero description coverage, so the description carries the full burden of explaining parameters. It explains that 'name' is the token name to search for and 'category' narrows the search, listing all valid categories and alias normalization behavior. This adds substantial meaning beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Look up a specific design token by name' and specifies the exact resource (design tokens), the return value, and the error behavior. It is distinguished from sibling tools like get_design_context by explicitly targeting single-token lookup vs broad overview.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear when-to-use guidance: 'Use this when you know the token name.' It also provides an explicit alternative for a different use case: 'For a broad overview of all tokens, use get_design_context with category 'tokens' instead.' This is model guidance for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_violationsARead-only
Get hardcoded token values: literals in source code typed inline instead of referencing a design token, bypassing the contract. Read-only, no side effects. Returns JSON with a count, suggestion-coverage stats, and a list with file:line:column, the captured literal, the surrounding utility (e.g. 'bg-[#ff0000]'), and an optional smart-match suggestion when a contract token has the same value. Pass category to filter: 'all' | 'colors' | 'spacing' (hardcoded values are only detected for these). Call this BEFORE generating UI with literal values — prefer the suggested token over a hardcoded literal. For available tokens to use instead, use get_design_context or get_token.
| Name | Required | Description | Default |
|---|---|---|---|
| category | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description states 'Read-only, no side effects,' which aligns with and expands on the readOnlyHint annotation. It additionally discloses return structure, filtering behavior, and the fact that hardcoded values are only detected for certain categories. This provides rich behavioral context beyond the annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured: it defines the topic, states safety, summarizes output, explains the parameter, and gives usage guidance. No sentence is wasted; it remains readable while packing substantial information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Even without an output schema, the description thoroughly details the return JSON structure (count, suggestion-coverage stats, list with file:line:column, literal, utility, smart-match suggestion). It covers the parameter, use cases, and alternatives, making the tool fully understandable for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by explaining that the `category` parameter filters results and lists allowed values ('all' | 'colors' | 'spacing'), also noting why these categories matter. This adds essential meaning not present in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: getting hardcoded token values (literals in source code instead of design tokens). It distinguishes itself from siblings by explicitly referencing get_design_context and get_token as alternatives for available tokens, and by describing its specific output related to violations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'Call this BEFORE generating UI with literal values — prefer the suggested token over a hardcoded literal.' It also names alternative tools for token lookup, giving clear when-to-use vs. when-not-to-use direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v2.15.0- Changed
get_component1 field changed- added
Input schema / properties / detailAdded value: +{ + "enum": [ + "api", + "usage", + "relationships", + "all" + ], + "type": "string" +}
5 tool updates
v2.1.2- Changed
get_conflicts1 field changed- removed
Input schema / requiredRemoved value: -[ - "type", - "status" -]
- Changed
get_design_context1 field changed- removed
Input schema / requiredRemoved value: -[ - "category", - "tokenCategory" -]
- Changed
get_inferred_rules1 field changed- removed
Input schema / requiredRemoved value: -[ - "category" -]
- Changed
get_token1 field changed- changed
Input schema / requiredPrevious value: -[ - "name", - "category" -]New value: +[ + "name" +]
- Changed
get_violations1 field changed- removed
Input schema / requiredRemoved value: -[ - "category" -]
1 tool update
v2.0.0- Changed
get_component1 field changed- added
Input schema / properties / contextAdded value: +{ + "type": "string" +}
6 tool updates
v1.8.0- Added
get_component - Added
get_conflicts - Added
get_design_context - Added
get_inferred_rules - Added
get_token - Added
get_violations
5 tool updates
v1.6.0- Removed
get_component - Removed
get_conflicts - Removed
get_design_context - Removed
get_inferred_rules - Removed
get_token
5 tool updates
- First observed
get_component - First observed
get_conflicts - First observed
get_design_context - First observed
get_inferred_rules - First observed
get_token
TDQS
Each tool targets a distinct aspect of the design system: components, conflicts, context summary, inferred rules, tokens, and violations. No overlap in purpose.
All tools follow a consistent `get_<noun>` pattern with snake_case, making the API predictable and easy to navigate.
Six tools is appropriate for a read-only design system inspector, covering all key areas without being excessive or insufficient.
The tool set provides comprehensive read-only access to design system components, tokens, rules, conflicts, violations, and context. No obvious gaps for its intended purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Serves your design system and coding standards to coding agents, so they stop guessing.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Access and maintain design system docs, tokens, components, skills, and contexts across any project.
Build and manage your design system with AI: tokens, themes, components, icons, Figma and code.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server that exposes your design system components and tokens to AI agents, preventing duplicate component creation and hardcoded token values.189MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to extract design systems, analyze components, and maintain design-code consistency from Figma files, providing intelligent component analysis and accessibility compliance.15630MIT
- AlicenseAqualityCmaintenanceConverts Figma designs into structured code context with token-aware styling, enabling AI agents to generate production-level frontend code.114MIT
- AlicenseAqualityBmaintenanceProvides deterministic, read-only design knowledge for AI coding agents to help them choose visual directions, plan UI states, and compose design tokens, all without network access.6294MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AI-by-design/primitiv'
If you have feedback or need assistance with the MCP directory API, please join our Discord server