Primitree
Concepts

Figma MCP and Primitree

Choose a Figma or repository data source for each token task.

Figma's MCP servers read live Figma files. The Primitree plugin exports local variables from an open file, and @primitree/mcp reads token data from a repository.

Figma remote MCP server

Figma recommends the remote server. The remote server uses Figma links to identify files, frames, and layers.

Tools such as get_design_context and get_variable_defs return design context and variables that the requested node references. The remote server provides:

  • use_figma for reading or changing objects through the Plugin API
  • get_libraries for libraries subscribed to a file and libraries available to add
  • search_design_system for components, variables, and styles in design libraries

See Figma's tools and prompts page for the current tool list.

Figma desktop MCP server

The desktop server runs through the Figma desktop app. It accepts a copied node link or the current selection in the open file. Selection-based prompting works on the desktop server; the remote server requires a link.

Figma provides the desktop server for specific organization and enterprise use cases. Its desktop setup guide lists the supported clients and Dev Mode steps.

Access and rate limits

Figma requires a supported MCP client and access to the requested file. Its current read-tool limits depend on plan and seat:

AccessTool-call limit
Starter planUp to 6 per month
View or Collab seatUp to 6 per month
Professional Full or Dev seatUp to 200 per day, 10/min
Organization Full or Dev seatUp to 200 per day, 15/min
Enterprise Full or Dev seatUp to 600 per day, 20/min

Figma reserves the right to change these limits. Check its rate limits and access page before planning usage.

Primitree plugin and CLI

The Primitree export plugin calls the local variables Plugin API in the open file and writes variables.json.

StepTool
ExportPrimitree export plugin
Buildprimitree build variables.json
Commitdesign-tokens/ in your repo

The export contains local collections, their modes, variable values, aliases, scopes, and code syntax. The plugin does not fetch remote library collections.

Primitree MCP (@primitree/mcp)

Point the server at a raw local variables export or the output from primitree build:

{
  "mcpServers": {
    "design-tokens": {
      "command": "npx",
      "args": ["-y", "@primitree/mcp@next", "--tokens", "./design-tokens"]
    }
  }
}

The MCP client can list token groups, read a token by dot path, select Resolver contexts, or search paths and descriptions. diff_tokens takes paths to two variables JSON files and returns a Markdown comparison.

Data flow

Figma file
  → Primitree export plugin     (variables.json)
  → primitree build             (design-tokens/)
  → @primitree/mcp              (repo token queries)

Live Figma context
  → Figma remote MCP            (file or node link)
  → Figma desktop MCP           (file link or current selection)

Choose a source

ToolData sourceInput
Figma remote MCPFigma-hosted fileFile, frame, or layer link
Figma desktop MCPFile open in the desktop appCurrent selection or copied node link
Primitree exportLocal variables in the open filePlugin command
@primitree/mcpRepository token filesvariables.json or design-tokens/