Figma Console MCP - Technical Architecture
Overview
Figma Console MCP provides AI assistants with real-time access to Figma for debugging, design system extraction, and design creation. The server supports two deployment modes with different capabilities.Deployment Modes
Remote Mode (SSE/OAuth)
Best for: Design system extraction, API-based operations, zero-setup experience Capabilities:- Design system extraction (variables, styles, components)
- File structure queries
- Component images
- Console log capture (requires local)
- Design creation (requires Desktop Bridge)
- Variable management (requires Desktop Bridge)
Local Mode (Desktop Bridge)
Best for: Plugin debugging, design creation, variable management, full capabilities Capabilities:- Everything in Remote Mode, plus:
- Console log capture (real-time)
- Design creation via Plugin API
- Variable CRUD operations
- Component arrangement and organization
- Zero-latency local execution
Component Details
MCP Server Core (src/local.ts)
The main server implements the Model Context Protocol with stdio transport for local mode.
Key Responsibilities:
- Tool registration (40+ tools)
- Request routing and validation
- Figma API client management
- Desktop Bridge communication
- Chrome DevTools Protocol connection
| Category | Tools | Transport |
|---|---|---|
| Navigation | figma_navigate, figma_get_status | CDP |
| Console | figma_get_console_logs, figma_watch_console, figma_clear_console | CDP |
| Screenshots | figma_take_screenshot, figma_capture_screenshot | CDP / Plugin |
| Design System | figma_get_variables, figma_get_styles, figma_get_component | REST API |
| Design Creation | figma_execute, figma_arrange_component_set | Plugin |
| Variables | figma_create_variable, figma_update_variable, etc. | Plugin |
Desktop Bridge Plugin
The Desktop Bridge is a Figma plugin that runs inside Figma Desktop and provides access to the full Figma Plugin API. Architecture: Communication Protocol: The MCP server communicates with the Desktop Bridge via Chrome DevTools Protocol:- MCP Server sends command via CDP
Runtime.evaluate - Bridge Plugin receives via
figma.ui.onmessage - Bridge Plugin executes Figma Plugin API calls
- Bridge Plugin returns result via
figma.ui.postMessage - MCP Server receives response via CDP
Chrome DevTools Protocol Integration
Used for console log capture and screenshot functionality. Console Monitoring:Figma REST API Client
Used for design system extraction and file queries. Endpoints Used:| Endpoint | Purpose |
|---|---|
GET /v1/files/:key | File structure and metadata |
GET /v1/files/:key/nodes | Specific node data |
GET /v1/files/:key/styles | Style definitions |
GET /v1/files/:key/variables/local | Variable collections (Enterprise) |
GET /v1/images/:key | Rendered images |
- Remote Mode: OAuth 2.0 with automatic token refresh
- Local Mode: Personal Access Token via environment variable
Data Flow Examples
Design Creation Flow
Variable Management Flow
Console Debugging Flow
Security Considerations
Authentication
- Personal Access Tokens: Stored in environment variables, never logged
- OAuth Tokens: Encrypted at rest, automatic refresh
- No credential storage: Tokens passed per-request
Sandboxing
- Plugin Execution: Runs in Figma’s sandboxed plugin environment
- Code Validation: Basic validation before execution
- No filesystem access: Plugin code cannot access local files
Data Privacy
- Console Logs: Stored in memory only, cleared on restart
- Screenshots: Temporary files with automatic cleanup
- No telemetry: No data sent to external services
Performance Considerations
Latency Targets
| Operation | Target | Actual |
|---|---|---|
| Console log retrieval | under 100ms | ~50ms |
| Screenshot capture | under 2s | ~1s |
| Design creation | under 5s | 1-3s |
| Variable operations | under 500ms | ~200ms |
Memory Management
- Log Buffer: Circular buffer, configurable size (default: 1000 entries)
- Screenshots: Disk-based with 1-hour TTL cleanup
- Connection Pooling: Single CDP connection reused
Optimization Strategies
- Batch operations where possible
- Lazy loading of component data
- Efficient JSON serialization
- Connection keepalive for CDP