Skip to content

Commit 48dbe9b

Browse files
committed
docs(figma): modernize integration strategy using Official Figma Desktop MCP
1 parent e41d617 commit 48dbe9b

2 files changed

Lines changed: 88 additions & 11 deletions

File tree

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
cat > client/integrations/figma/agents.md <<'EOF'
2-
# Figma MCP Integration (v0.0.1)
1+
# Figma MCP Integration
2+
3+
> [!IMPORTANT]
4+
> We have adopted the **Official Figma Desktop MCP Server** for this integration.
5+
> Please refer to `docs/FIGMA_INTEGRATION.md` for setup and usage instructions.
36
47
## Purpose
5-
Shared design integration for all targets (web, desktop, mobile, TV).
8+
Seamlessly translate Figma designs into QuanuX-compliant React code by composing the Official Figma MCP (Design Data) with the QuanuX MCP (Coding Standards).
69

7-
## Guidelines
8-
- Provide tokens, components metadata, and assets to front-ends.
9-
- Do not push compute logic to clients; produce **design outputs** only.
10-
- Keep API contracts stable; version schemas under `meta/schemas/json`.
10+
## Legacy Notes
11+
The files `bridge.mcp.ts` and `sdk.ts` in this directory are retained as stubs/references but are superseded by the official Figma Desktop integration.
1112

12-
## Future
13-
- Theming pipeline per target
14-
- Asset pipelines (icons, banners, TV screens)
15-
EOF

docs/FIGMA_INTEGRATION.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Figma Integration Guide (Designer-to-Code Workflow)
2+
3+
This guide details how to integrate **Figma** with the **QuanuX Platform** to enable AI agents to generate production-ready, compliant React code directly from your designs.
4+
5+
## Overview
6+
7+
The workflow relies on **MCP Server Composition**. By connecting your AI Client to two servers simultaneously, you give the AI access to both the *Design* and the *Rules*:
8+
9+
1. **Figma Desktop MCP Server** (Official): Provides the raw design data (layout, props, colors).
10+
2. **QuanuX Local MCP Server**: Provides the `react-frontend-standards` Agent Skill (architectural rules, Shadcn usage, Backend-Driven protocols).
11+
12+
```mermaid
13+
graph TD
14+
User((User)) -->|Prompt| AI[AI Client/Agent]
15+
AI -->|Read Design| Figma[Figma MCP Server]
16+
AI -->|Read Rules| QuanuX[QuanuX MCP Server]
17+
Figma -.->|Design Node| AI
18+
QuanuX -.->|Frontend Skill| AI
19+
AI -->|Generates| Code[QuanuX-Compliant Code]
20+
```
21+
22+
## Prerequisites
23+
24+
1. **Figma Desktop App**: Ensure you are running the latest version with **Dev Mode** availability (Beta).
25+
2. **MCPClient**: A desktop agent application (e.g., Claude Desktop, Cursor, or a custom scripted agent) that supports multiple MCP servers.
26+
3. **QuanuX Server**: Running locally (`python3 -m server.mcp.server`).
27+
28+
## Configuration
29+
30+
### 1. Enable Figma MCP
31+
1. Open Figma Desktop.
32+
2. Enter **Dev Mode** (Shift + D).
33+
3. Open the **Inspect** panel.
34+
4. Enable "MCP Server" (if available in your Beta/Plan).
35+
* *Default URL*: `http://127.0.0.1:3845/mcp`
36+
37+
### 2. Configure Your Agent
38+
Add both servers to your agent's configuration file (e.g., `claude_desktop_config.json`).
39+
40+
```json
41+
{
42+
"mcpServers": {
43+
"figma": {
44+
"command": "npx",
45+
"args": ["-y", "@figma/mcp-server"]
46+
// OR point to the local desktop URL if supported via a bridge
47+
},
48+
"quanux": {
49+
"command": "python3",
50+
"args": ["-m", "server.mcp.server"],
51+
"env": { "PYTHONPATH": "/absolute/path/to/QuanuX" }
52+
}
53+
}
54+
}
55+
```
56+
57+
## The Workflow
58+
59+
### Step 1: Design in Figma
60+
Create your UI in Figma using standard best practices (Auto Layout, named layers).
61+
62+
### Step 2: Select & Prompt
63+
1. **Select** the frame or component in Figma (e.g., `OrderEntryForm`).
64+
2. **Prompt** your connected Agent:
65+
66+
> "Inspect the selected Figma node. Generate a React component for this design.
67+
> **IMPORTANT**: Use the `react-frontend-standards` skill to ensure the code follows QuanuX architecture (Backend-Driven UI, Shadcn, Tailwind)."
68+
69+
### Step 3: Verification
70+
The Agent will:
71+
1. Call `figma.get_selection()` to parse the layout.
72+
2. Call `agent.skills.read('react-frontend-standards')` to load our coding rules.
73+
3. Output a `.tsx` file that:
74+
* Uses **Tailwind** for styling (matching Figma tokens).
75+
* Uses **Shadcn** components where appropriate.
76+
* **Does NOT** contain mock logic (per Backend-Driven rule).
77+
78+
## Troubleshooting
79+
* **"Skill not found"**: Ensure QuanuX server is running and `client/skills/react-frontend-standards/SKILL.md` exists.
80+
* **Figma Connection Refused**: Ensure Figma Desktop is open and Dev Mode is active.

0 commit comments

Comments
 (0)