Primitiv

MCP Tools

Tools exposed by the Primitiv MCP server.

Available tools

ToolDescription
get_design_contextGet 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_tokenLook up a specific token by name. Pass category to narrow the search (e.g. "colors", "spacing").
get_componentLook up a specific component by name. Returns props, variants, and source provenance.
get_conflictsGet conflicts between design sources. Pass type: "all" | "token" | "component" and status: "all" | "pending" | "resolved". Returns actionableCount and pendingDecisionCount alongside the list.
get_inferred_rulesGet design rules Primitiv has extracted from your codebase patterns. Pass category to filter (e.g. "spacing", "naming").
get_violationsList 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_context first to load the contract summary. Check the warnings array and sourceRoot before proceeding.
  • Before generating a literal value (e.g. bg-[#hex], p-[8px]): get_violations to see existing misuses + suggested tokens, then get_token or get_design_context for 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_conflicts to 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.

On this page