Labsco
TimHolden logo

Figma MCP Server

โ˜… 148

from TimHolden

Provides read-only access to Figma files and projects using the Figma API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

Figma MCP Server

A Model Context Protocol (MCP) server that provides integration with Figma's API through Claude and other MCP-compatible clients. Currently supports read-only access to Figma files and projects, with server-side architecture capable of supporting more advanced design token and theme management features (pending Figma API enhancements or plugin development).

Project Status

Current Progress

  • โœ… Core Implementation: Successfully built a TypeScript server following the Model Context Protocol (MCP)
  • โœ… Claude Desktop Integration: Tested and functional with Claude Desktop
  • โœ… Read Operations: Working get-file and list-files tools for Figma file access
  • โœ… Server Architecture: Caching system, error handling, and stats monitoring implemented
  • โœ… Transport Protocols: Both stdio and SSE transport mechanisms supported

Potential Full Functionality

The server has been designed with code to support these features (currently limited by API restrictions):

  • Variable Management: Create, read, update, and delete design tokens (variables)
  • Reference Handling: Create and validate relationships between tokens
  • Theme Management: Create themes with multiple modes (e.g., light/dark)
  • Dependency Analysis: Detect and prevent circular references
  • Batch Operations: Perform bulk actions on variables and themes

With Figma plugin development or expanded API access, these features could be fully enabled.

Features

  • ๐Ÿ”‘ Secure authentication with Figma API
  • ๐Ÿ“ File operations (read, list)
  • ๐ŸŽจ Design system management
    • Variable creation and management
    • Theme creation and configuration
    • Reference handling and validation
  • ๐Ÿš€ Performance optimized
    • LRU caching
    • Rate limit handling
    • Connection pooling
  • ๐Ÿ“Š Comprehensive monitoring
    • Health checks
    • Usage statistics
    • Error tracking

API Documentation

Server Methods

  • startServer(figmaToken: string, debug?: boolean, port?: number)
    • Initializes and starts the MCP server
    • Returns: Promise

Tool Schemas

All tool inputs are validated using Zod schemas:

const CreateVariablesSchema = z.object({
  fileKey: z.string(),
  variables: z.array(z.object({
    name: z.string(),
    type: z.enum(['COLOR', 'FLOAT', 'STRING']),
    value: z.string(),
    scope: z.enum(['LOCAL', 'ALL_FRAMES'])
  }))
});

Error Handling

The server provides detailed error messages and proper error codes:

  • Invalid token: 403 with specific error message
  • Rate limiting: 429 with reset time
  • Validation errors: 400 with field-specific details
  • Server errors: 500 with error tracking

Support