MCP Tools
Tools exposed by the Primitiv MCP server.
Available tools
| Tool | Description |
|---|---|
get_design_context | Get tokens, components, conflicts, inferred rules, and violation count. Default (no category) returns a summary with counts. Pass category: "all" | "tokens" | "components" | "conflicts" for full detail. Filter tokens with tokenCategory. |
get_token | Look up a specific token by name. Pass category to narrow the search (e.g. "colors", "spacing"). |
get_component | Look up a specific component by name. Returns props, variants, and source provenance. |
get_conflicts | Get conflicts between design sources. Pass type: "all" | "token" | "component" and status: "all" | "pending" | "resolved". Returns actionableCount and pendingDecisionCount alongside the list. |
get_inferred_rules | Get design rules Primitiv has extracted from your codebase patterns. Pass category to filter (e.g. "spacing", "naming"). |
get_violations | List token-misuse violations — hardcoded literals in source that bypass the contract. Smart-matched to a suggested token when the literal matches one. Pass category: "all" | "colors" | "spacing" to filter. Populated by primitiv build and primitiv verify. |
All tools are read-only — they never modify your code or contract. Primitiv works with any tool that speaks MCP — it is not tied to a specific editor or agent ecosystem.
When to call which
- Starting any UI work:
get_design_contextfirst to load the contract summary. Check thewarningsarray andsourceRootbefore proceeding. - Before generating a literal value (e.g.
bg-[#hex],p-[8px]):get_violationsto see existing misuses + suggested tokens, thenget_tokenorget_design_contextfor the available tokens to use instead. - Reusing components:
get_component { name }to load the canonical implementation before writing a new one. - Auditing source drift:
get_conflictsto see unresolved disagreements between Figma / Storybook / code.
The Primitiv block written to AGENTS.md / CLAUDE.md by primitiv init encodes this workflow so Claude Code, Cursor, and other MCP clients follow it automatically.