Connect AI agents
The Particles Model Context Protocol server exposes 18 read-only tools — design tokens, semantic search, change-impact analysis, WCAG contrast, Figma component graphs, docs & guidelines, releases, scalability score, coverage, and governance status — to AI agents like Claude and Codex. Your agent reasons about real, live tokens instead of pasted hex codes. It never mutates your project: every tool is a read.
MCP access requires the organization to be on the Team plan or above. Calls from a lower plan return a clear “upgrade required” error instead of a silent failure.
Create an access token#
Both connection options below authenticate with an access token, created in Studio: Settings → Access Tokens → Create token.
| Setting | What it controls |
|---|---|
| Scope | Organization-scoped by default; restrict it to specific projects or leave it set to all. |
| Permission | Read or read-write. MCP tools are read-only today, so a read token is enough. |
| Secret | Starts with `pat_`, shown once at creation — copy it immediately, it cannot be viewed again. |
| Revocation | Revoke anytime from the same page; a revoked token fails closed on the next call. |
Treat a pat_… secret like a password: put it in your MCP client’s config or a secret store, never commit it, and revoke it if it leaks.
Option 1 — Remote MCP endpoint (recommended)#
Zero install. Your client speaks Streamable HTTP directly to the hosted endpoint, authenticated with your access token as a bearer header:
https://api.particles-ui.com/v1/mcp
Claude Code
Add it with the CLI:
claude mcp add --transport http particles-ui https://api.particles-ui.com/v1/mcp \ --header "Authorization: Bearer pat_your_token_here"
Or drop this into your project’s .mcp.json:
{
"mcpServers": {
"particles-ui": {
"type": "http",
"url": "https://api.particles-ui.com/v1/mcp",
"headers": {
"Authorization": "Bearer pat_your_token_here"
}
}
}
}Codex
Codex configures MCP servers in ~/.codex/config.toml (or a project-scoped .codex/config.toml). A Streamable HTTP server takes a url plus either bearer_token_env_var (reads the token from an environment variable — recommended, keeps the secret out of the file) or a static http_headers entry:
[mcp_servers.particles-ui] url = "https://api.particles-ui.com/v1/mcp" bearer_token_env_var = "PARTICLES_TOKEN"
Export PARTICLES_TOKEN=pat_your_token_here in the shell Codex runs from. Alternatively, set the header inline (avoid checking this into version control):
[mcp_servers.particles-ui]
url = "https://api.particles-ui.com/v1/mcp"
http_headers = { "Authorization" = "Bearer pat_your_token_here" }Claude.ai & Claude Desktop (connector UI)
Claude’s Add custom connector dialog only has a name and a URL field — there’s no way to set a header. The remote endpoint also accepts the access token as a ?token= query parameter for exactly this reason (the header wins if a client sends both).
- In Claude (web or desktop), open
Settings → Connectors → Add custom connector. - Name:
Particles UI. - Remote MCP server URL:
https://api.particles-ui.com/v1/mcp?token=pat_your_token_here. - Leave the OAuth Client ID and Client Secret fields empty — Particles authenticates with access tokens, not OAuth.
- Click Add, then enable the connector from the tools menu in a chat.
With ?token=, the URL itself is the secret — anyone who has it can call the API as you. Don’t share screenshots or copies of it, and revoke the token from Studio → Settings → Access Tokens if it leaks. Prefer the header form (claude mcp add --transport http … --header) wherever your client supports headers — the query-parameter form is only for connector UIs like this one that don’t give you a choice.
Every tool takes a projectId. Agents that don’t already know it should call list_projects first to discover project ids (and list_branches / list_themes for branch- or theme-scoped calls).
Option 2 — Local stdio server (fallback / air-gapped)#
For clients that only support local process-based MCP servers, or for air-gapped environments, run the server locally with npx. It authenticates the same way — with a pat_… access token — or with a device token from particles auth login if you have the Particles CLI installed.
{
"mcpServers": {
"particles-ui": {
"command": "npx",
"args": ["-y", "@particlesui/mcp-server"],
"env": {
"PARTICLES_TOKEN": "pat_your_token_here",
"PARTICLES_PROJECT_ID": "<optional default project id>"
}
}
}
}The equivalent Codex stdio entry:
[mcp_servers.particles-ui]
command = "npx"
args = ["-y", "@particlesui/mcp-server"]
env = { "PARTICLES_TOKEN" = "pat_your_token_here", "PARTICLES_PROJECT_ID" = "<optional default project id>" }| Variable | Required | Description |
|---|---|---|
| PARTICLES_TOKEN | Yes (unless `particles auth login` was run) | A `pat_…` access token from Studio, or a CLI device token. |
| PARTICLES_PROJECT_ID | Optional | Default project id used when a tool call omits `projectId`. Otherwise pass `projectId` per call, or let the agent call `list_projects`. |
| PARTICLES_API_BASE | Optional | Backend base URL — set this for a self-hosted Particles backend. Defaults to https://api.particles-ui.com. |
See the @particlesui/mcp-server README for GUI-client PATH pitfalls, the particles-mcp setup auto-configure command, and the full tool reference.
What can agents do?#
18 read-only tools, grouped by what they’re for. Full input/output shapes are in the package README.
Tokens & search
| Tool | What it does |
|---|---|
| get_token | Get a token by name — resolved value, CSS variable, tier, and which components use it. |
| find_tokens | Natural-language token search (“a calm background for cards”), ranked by relevance.¹ |
| resolve_theme | A token’s resolved value within a named theme (e.g. dark mode). |
Impact & accessibility
| Tool | What it does |
|---|---|
| get_impact | Blast radius of changing a token — affected tokens, the components that bind it, and a11y risk. |
| check_contrast | WCAG contrast ratio between two tokens (AA / AA-large / AAA). |
Figma components
| Tool | What it does |
|---|---|
| get_component_graph | Full token-binding graph for a component — part tree, every property→token binding, gaps, and stale bindings. |
| get_component_tokens | Flat list of the tokens a component binds, with per-property confidence. |
| list_components | All components that bind tokens, with variants, token counts, and average confidence. |
Project navigation
| Tool | What it does |
|---|---|
| list_projects | Discover your projects (and ids) — call this first if the agent doesn’t know a projectId. |
| list_branches | A project’s branches (id, name, whether main). |
| list_themes | A project’s named themes (id, name). |
| list_releases | A project’s published releases (version, channel, branch, notes), optionally filtered by channel. |
Docs & knowledge graph
| Tool | What it does |
|---|---|
| search_docs | Search design documentation pages by keyword or intent — ranked results with page metadata.² |
| get_guidelines | Fetch a component’s (or page’s) usage guidelines as rendered markdown.² |
| get_neighborhood | Explore the knowledge-graph neighborhood around a token, component, or guideline.³ |
Scalability & governance
| Tool | What it does |
|---|---|
| get_score | A branch’s Scalability Score (0–100) — dedup health, alias coverage, naming health, contrast pass rate. |
| get_coverage | A project’s rolled-up token coverage — Figma bound/unbound rate, code-usage scan totals, orphaned tokens. |
| get_governance_status | A project’s governance health — flow metrics (lead time, review coverage, gate blocks) and lifecycle hygiene. |
¹ find_tokens uses semantic ranking when embeddings are available for your project, and otherwise falls back to text matching — nothing to configure. ² search_docs and get_guidelines require the Team plan or above. ³ get_neighborhood requires the Business plan (knowledge graph explorer feature).
Troubleshooting#
| Symptom | Fix |
|---|---|
| Authentication failed (401) | The token is missing, revoked, or expired, or the header is wrong. Confirm the exact `Authorization: Bearer pat_…` header (remote) or PARTICLES_TOKEN value (stdio); create a fresh access token in Studio if it was revoked. |
| Connector fails to connect (claude.ai / Claude Desktop) | Confirm the Remote MCP server URL includes `?token=pat_…` — this dialog has no header field, so a bare `/v1/mcp` URL with no token always fails. Then check the token hasn’t been revoked or expired, and that the organization is on the Team plan or above. |
| Plan limit (403) | The organization is below the Team plan — MCP access is gated. Upgrade the plan to use any tool. |
| No project selected | Pass `projectId` on the call, set PARTICLES_PROJECT_ID (stdio) or call `list_projects` first to discover one. |
| find_tokens returns only text matches | Semantic embeddings aren’t available for that project/branch yet; results still work, just lexically. |
| Tools don’t appear in the client | Confirm the token/header is valid, then fully quit and reopen the client — MCP servers are read once per session, a reload isn’t enough. |