figmad-mcp
# figmad-mcp
Figma Design MCP Server - Create, capture, and manage Figma designs via AI agents.
## Features
- **Read Operations**: Get files, nodes, components, styles, variables, export images
- **Write Operations**: Create frames, shapes, text; apply auto-layout; update nodes (requires plugin)
- **Capture & Reconstruct**: Screenshot webpages and recreate them in Figma
- **Generate UI**: Create UI designs from text prompts
## Setup
### 1. Install Dependencies
```bash
npm install
```
### 2. Configure Environment
```bash
cp .env.example .env
# Edit .env and add your FIGMA_ACCESS_TOKEN
```
Get your token at: https://www.figma.com/developers/api#access-tokens
### 3. Build
```bash
npm run build
```
### 4. Install Plugin (for write operations)
```bash
cd plugin
npm install
npm run build
```
Then in Figma:
1. Menu → Plugins → Development → Import plugin from manifest
2. Select `plugin/manifest.json`
## Usage
### With Claude Desktop
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"figmad": {
"command": "node",
"args": ["/path/to/figmad-mcp/dist/index.js"],
"env": {
"FIGMA_ACCESS_TOKEN": "your-token-here"
}
}
}
}
```
### Available Tools
#### Read Operations (REST API - always available)
| Tool | Description |
|------|-------------|
| `get_file` | Get Figma file structure |
| `get_node` | Get specific nodes by ID |
| `get_components` | List components in a file |
| `get_styles` | Get color/text/effect styles |
| `get_variables` | Get design tokens/variables |
| `export_image` | Export node as PNG/SVG/PDF |
#### Write Operations (Plugin required)
| Tool | Description |
|------|-------------|
| `create_frame` | Create a new frame |
| `create_rectangle` | Create a rectangle shape |
| `create_text` | Create text node |
| `update_node` | Modify node properties |
| `apply_auto_layout` | Apply auto-layout to frame |
| `set_fills` | Set fill colors |
| `delete_node` | Delete a node |
| `get_selection` | Get current selection |
| `plugin_status` | Check if plugin is connected |
#### Orchestrated Tools
| Tool | Description |
|------|-------------|
| `capture_webpage` | Screenshot and analyze a webpage |
| `reconstruct_page` | Recreate captured page in Figma |
| `generate_ui` | Generate UI from text description |
| `analyze_codebase` | Extract components and design tokens from code |
| `sync_design_tokens` | Compare/sync tokens between Figma and code |
## Example Prompts
```
Get the structure of my Figma file: [paste figma URL]
Create a landing page with a header, hero section with headline and CTA button, three feature cards, and a footer
Capture https://example.com and recreate it in Figma
Export the frame "Hero Section" as a PNG
Analyze my React codebase at /path/to/project and extract design tokens
Compare design tokens between my Figma file and codebase
```
## Architecture
```
┌─────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ AI Agent │────▶│ figmad-mcp │────▶│ Figma Plugin │
│ (Claude) │stdio│ (MCP Server) │ ws │ (runs in Figma) │
└─────────────┘ └────────┬────────┘ └──────────────────┘
│
├──▶ Figma REST API (read operations)
└──▶ Playwright (web capture)
```
## Development
```bash
npm run dev # Watch mode
npm run typecheck # Type checking
npm run lint # Linting
cd plugin
npm run watch # Watch plugin changes
```
## License
MIT
TDQS
Scored across 20 tools
Most tools have distinct purposes, such as create_frame, create_rectangle, and create_text for different element types, and get_file, get_node, and get_selection for different retrieval methods. However, some overlap exists between analyze_codebase and sync_design_tokens, as both involve code analysis and design tokens, which could cause mild confusion.
Tool names follow a consistent verb_noun pattern throughout, such as create_frame, delete_node, export_image, get_components, and update_node. There are no deviations in naming conventions, making the set predictable and readable.
With 20 tools, the count is slightly high but reasonable for a Figma MCP server covering design operations, code analysis, and webpage capture. It includes core CRUD actions and specialized functions without feeling excessively bloated, though it borders on the upper limit of typical scope.
The tool set provides comprehensive coverage for Figma design workflows, including creation (e.g., create_frame, create_text), retrieval (e.g., get_file, get_node), updates (update_node), deletion (delete_node), export (export_image), and integration with codebases and webpages. No obvious gaps are present, supporting full lifecycle operations.