Figma Setup for Cursor
Purpose: Access Brainforge design files for website migration, design tokens, and design-to-code workflows.
1. Credentials
| Variable | Location | Purpose |
|---|---|---|
FIGMA_USER_TOKEN | apps/platform/.env.local (or root .env.local) | Figma REST API personal access token (optional) |
| Figma MCP | .cursor/mcp.json | OAuth on first use; primary way to get design context |
1Password (team): Brainforge Platform Team vault → secure note Figma Brainforge Platform Token (value in notesPlain). For scripts or one-off curl, after op signin:
export FIGMA_USER_TOKEN="$(op read "op://Brainforge Platform Team/Figma Brainforge Platform Token/notesPlain")"Use FIGMA_USER_TOKEN or X-Figma-Token depending on the API you call. Do not commit the token; prefer op read over pasting into files.
2. Figma MCP (Primary)
Cursor has built-in Figma MCP. To use it:
- Open a Figma file in the browser
- Copy the URL, e.g.
https://figma.com/design/ABC123/FileName?node-id=1-2 - Extract
fileKey(e.g.ABC123) andnodeId(e.g.1:2— replace-with:) - Use
get_design_contextwith fileKey and nodeId to get code, screenshot, and assets
MCP tools:
get_design_context— Primary tool; returns code + screenshot for design-to-codeget_metadata— Structure overview (node IDs, types, names)get_screenshot— Screenshot onlyget_figjam— For FigJam boardswhoami— Verify authentication
3. Figma REST API (Optional)
For programmatic access (e.g. listing files, bulk export), use a personal access token:
- Figma Account Settings → Personal access tokens
- Create token with required scopes
- Set
FIGMA_USER_TOKENin.env.local
# List project files (requires project_id)
curl -H "X-Figma-Token: $FIGMA_USER_TOKEN" \
"https://api.figma.com/v1/projects/{project_id}/files"4. Asset Map
See apps/platform/docs/figma-assets-map.md for what’s where in Brainforge Figma files.
5. References
- Figma REST API
- Figma MCP server instructions (in Cursor MCP config)
- OpenCode CLI + Figma remote MCP (manual OAuth client):
knowledge/engineering/opencode-cli-brainforge.md— Figma MCP section; upstream OpenCode #988