MCP
Serve repository design tokens to an MCP client.
npm i -D @primitree/mcp@next@primitree/mcp requires Node.js 24 or newer. The server reads any variables JSON shape listed in Export variables, or a built design-tokens/ directory.
Client config
{
"mcpServers": {
"design-tokens": {
"command": "npx",
"args": ["-y", "@primitree/mcp@next", "--tokens", "./variables.json"]
}
}
}Or point at built output:
{
"args": ["-y", "@primitree/mcp@next", "--tokens", "./design-tokens"]
}Set PRIMITREE_TOKENS when the client config cannot pass --tokens.
Tools
| Tool | Description |
|---|---|
list_collections | Return top-level groups, token counts, Resolver contexts, and the source path |
get_token | Return one token, resolved value, CSS value, and Figma extension data |
resolve_context | Resolve token values for a context selection |
search_tokens | Search token paths and descriptions, with an optional $type filter |
diff_tokens | Compare an earlier and later variables JSON file by stable Figma IDs |
The --tokens option selects the source for get_token, resolve_context, and search_tokens. diff_tokens accepts oldPath and newPath; both paths must point to variables JSON files.
Example tool inputs
{ "path": "semantic.color.bg.brand", "contexts": { "semantic": "dark" } }{ "oldPath": "./backup/variables.json", "newPath": "./variables.json" }Start the server
npx @primitree/mcp@next --tokens ./variables.jsonThe command connects over stdio and logs its source path to standard error.
Figma's MCP server
Figma's remote and desktop MCP servers read live Figma files. Primitree MCP reads the JSON or built token files in your repository. See Figma MCP and Primitree.