MCP Connector

Generate Flutter Code from Figma Designs

Extracts Figma design data - layout, colors, typography, components - and guides an AI coding agent to implement it as Flutter widgets and screens.

Works with figmaflutter

91
Spark score
out of 100
Updated 5 months ago
Version 0.3.3
Models
universal

Add to Favorites

Why it matters

Bridge the gap between design and development by automatically extracting detailed design data from Figma files to generate high-quality Flutter code implementations.

Outcomes

What it gets done

01

Extract layout, styling, and asset data from Figma designs.

02

Analyze Figma structure for component hierarchy and screen elements.

03

Generate Flutter widget recommendations and code snippets.

04

Export images and SVGs directly from Figma.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-figma-to-flutter | bash

Capabilities

Tools your agent gets

extract_figma_node_data

Extract detailed node data from Figma including layout, styling, dimensions, colors, and text content.

analyze_figma_structure

Analyze Figma design structure including child elements, nested components, and visual hierarchy.

get_flutter_widget_recommendations

Get Flutter widget recommendations and implementation patterns for Figma design elements.

extract_screen_metadata

Extract screen metadata from Figma including device type, orientation, and dimensions.

identify_screen_sections

Identify and analyze screen sections like header, footer, navigation, and content areas.

analyze_navigation_elements

Analyze navigation elements in Figma designs including tab bars, app bars, and drawers.

get_scaffold_recommendations

Get Flutter Scaffold recommendations based on Figma screen structure analysis.

export_image_assets

Export images from Figma as PNG, JPEG, or JPG files to assets folder.

+2 tools

Overview

Figma to Flutter MCP Server

This MCP server extracts Figma design data - layout, colors, typography, components, screen structure - and hands it to an AI coding agent as context for generating Flutter widgets and screens; it doesn't generate Flutter code itself. Use it for MVP or prototype Flutter work translating Figma designs, not scalable production apps yet. Well-structured Figma files (auto layout, proper frames) produce much better results, and SVGs export best from isolated frames.

What it does

Figma to Flutter MCP Server extracts rich data from Figma files - node layout, styling, dimensions, colors, text content, component structure, and screen metadata (device type, orientation, navigation elements) - and feeds it to an AI coding agent like Cursor as implementation guidance. Critically, it does not generate Flutter code itself: it analyzes the Figma structure and suggests appropriate Flutter widgets and Scaffold patterns, leaving the actual code generation to the AI agent using that extracted context. Image assets referenced in a screen are exported automatically into an assets/ folder with pubspec.yaml updated accordingly.

When to use - and when NOT to

Use this when converting a Figma design into Flutter code with an AI coding agent - setting up a theme and typography from a reference frame, generating a widget from a Figma component (including named-constructor variants for states like enabled/disabled), or building a full screen with automatic image asset export. The project's own disclaimer recommends this for MVPs and smaller, explanatory tasks rather than scalable production apps at this stage. Output quality depends heavily on how the Figma file is structured - designs using auto layout and proper frames (not groups) with consistent alignment interpret far better than messy ones. SVG assets specifically often fail to export cleanly in bulk screen generation because vector nodes (icons, pen-tool shapes) get swept up unintentionally - export SVGs from a separate, isolated frame or group instead. Heavy usage can trigger Figma API rate limits (HTTP 429); the server retries with backoff but can't bypass Figma's limits.

Capabilities

Component/widget extraction: layout, styling, colors, text content, nested component structure, and Flutter widget/pattern suggestions (no code generation). Screen extraction: device/orientation/dimension metadata, section identification (header, footer, nav), and Scaffold structure guidance. Automatic image asset export into assets/ with pubspec.yaml updates during screen generation; separate on-demand SVG and image export prompts.

Example prompts: "Setup flutter theme from including Colors and Typography", "Create this widget in flutter from figma COMPONENT link: , use named constructors for variants", "Design this intro screen from the figma link ".

How to install

Requires a Figma personal access token. Cursor MCP configuration:

{
  "mcpServers": {
    "Figma Flutter MCP": {
      "command": "npx",
      "args": ["-y", "figma-flutter-mcp", "--figma-api-key=YOUR-API-KEY", "--stdio"]
    }
  }
}

For local HTTP testing: clone the repo, npm install, set FIGMA_API_KEY in .env, run npm run dev, then point your MCP client at http://localhost:3333/mcp. Requires Node.js 18+, Flutter SDK, and an MCP-compatible AI coding agent (Cursor, Claude, Gemini CLI).

Who it's for

Flutter developers and designers using an AI coding agent to translate Figma designs into widgets and screens quickly, especially for MVPs or prototypes rather than large production codebases. Licensed MIT.

Source README
Theme Setup Example

Figma to Flutter MCP Server

๐ŸŒ Available in: ํ•œ๊ตญ์–ด (Korean) | ๆ—ฅๆœฌ่ชž (Japanese) | ็ฎ€ไฝ“ไธญๆ–‡ (Simplified Chinese) | ็น้ซ”ไธญๆ–‡ (Traditional Chinese)

Utilize Figma's rich data in your coding agent.
Implement designs in Flutter way!

weekly downloads MIT License Twitter

Use Cursor or other AI-powered tools to access Figma's rich files, data, components and much more using MCP server.

๐Ÿ“‹ Table of Contents

๐Ÿฆ‹ Observable Flutter #70

Featured on Observable Flutter with enhanced explanation and demo:

Observable Flutter Figma to Flutter MCP

๐ŸŽฅ Short Video Demo

Showcased almost all the features of Figma Flutter MCP with real figma design.

๐Ÿ“ Getting Started

You may explore the detailed getting started docs or the demo video as quick-start. As its a First Release hence there's a lot of room for improvements so you can checkout the issues to see what else there's to work or to improve.

๐Ÿ“š How it works | Details Here

  1. Components/Widgets
  • โœ… Extract Figma node data: Layout, styling, dimensions, colors, text content, etc.
  • โœ… Analyze structure: Child elements, nested components, visual importance
  • โœ… Provide guidance: Suggest Flutter widgets and implementation patterns
  • โŒ NOT generating actual Flutter code files
  1. Screens
  • โœ… Extract screen metadata: Device type, orientation, dimensions
  • โœ… Identify sections: Header, footer, navigation, content areas
  • โœ… Analyze navigation: Tab bars, app bars, drawers, navigation elements
  • โœ… Provide Scaffold guidance: Suggest Flutter screen structure
  • โŒ NOT generating actual Flutter screen

Since its just helping AI write Flutter code so it means the better your prompt will be the better results you'll get.

๐Ÿ› ๏ธ Usage

Following steps shows a minimal usage and setup instructions:

๐Ÿ”‘ Figma API Key

You will need to create a Figma access token to use this server. Instructions on how to create a Figma API access token can be found here.

๐Ÿน MCP in Cursor

Once you've the FIGMA API KEY, you can setup the MCP in cursor as follows:

  1. Press CMD + Shift + P (Ctrl on Windows)
  2. Type "Open MCP Settings"
  3. Click on "Add new MCP"
  4. Paste the below json object
MacOS/Linux
{
  "mcpServers": {
    "Figma Flutter MCP": {
      "command": "npx",
      "args": ["-y", "figma-flutter-mcp", "--figma-api-key=YOUR-API-KEY", "--stdio"]
    }
  }
}
Windows
{
  "mcpServers": {
    "Figma Flutter MCP": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "figma-flutter-mcp", "--figma-api-key=YOUR-API-KEY", "--stdio"]
    }
  }
}

NOTE: If you've installed this MCP as npm package make sure to keep it updated to latest version. Sometimes, it caches the old version and keep showing you error like "Not being able to use tool call" or "Figma API key setup is not working" etc.

๐Ÿš€ Quick Start for Local Testing

Prerequisites
  • Node.js 18+
  • Figma API Key (Access Token)
  • Cursor AI IDE with MCP support
  • Flutter SDK

For quick local testing, you can run the server via HTTP instead of stdio:

# Clone and setup
git clone <your-repo-url> figma-flutter-mcp
cd figma-flutter-mcp
npm install

# Create .env file with your Figma API key
echo "FIGMA_API_KEY=your-figma-api-key-here" > .env

# Start HTTP server for local testing
npm run dev

Then add this to your MCP client configuration:

{
  "mcpServers": {
    "local-figma-flutter": {
      "url": "http://localhost:3333/mcp"
    }
  }
}

See CONTRIBUTING.md for detailed instructions.

๐Ÿงฑ Basic Workflow

๐Ÿค– AI Coding Agent Assistance

For better results you can setup some instructions in following files as per your AI Coding Agent:

  • Cursor: .cursor/rules/fluttering.mdc
  • Claude: CLAUDE.md
  • Gemini CLI: GEMINI.md

This way your AI agent will use the MCP's output and ensure the flutter code is as per your project requirements and structure. You can checkout an example of cursor rules that I used for testing this out.

  1. Setup Theme & Typography: The most efficient way, put two frames in Figma with Theme colors and Typography samples on it. For instance:
  • Figma Desktop: Select the frame and press CMD + L or Ctrl + L
  • Figma Web: Select the frame and copy the URL

๐Ÿ’ก HINT: The valid URL will contain a FILE ID and NODE ID params

"Setup flutter theme from <figma_link> including Colors and Typography.
  1. Widget Generation: The most efficient way, use COMPONENTS in figma. For example:

This one has 2 variants with enabled and disabled states.

"Create this widget in flutter from figma COMPONENT link: <figma_link>, use named constructors for variants and break the files in smaller parts for code readability."

If you do not have COMPONENTS in figma, you can use FRAME just prompt the AI that you want this to be a widget and it will handle the rest.

  1. Full Screen Generation: If there are any IMAGE ASSETS (.png, .jpeg, .jpg etc.) available, it will export them and put them in assets/ along with pubspec.yaml
Screen
"Design this intro screen from the figma link <figma_link>, ensure the code is readable by having smaller files."
  1. Assets Export:
  • Image Assets: Will work automatically when generating screens
"Export this image asset from figma link: <figma_link>
  • SVG Assets: Will NOT work automatically if they are scrambled or are ungrouped, explained below.
"Export this as an SVG asset from Figma link: <figma_link>"
โš ๏ธ If SVG assets donโ€™t work with screen generation
  • In Figma vectors include icons and pen-tool shapes, so bulk exports may grab unintended nodes;
    • Recommend exporting SVGs separately i.e. to take them out an an independent FRAME or GROUP
    • Here's how the separation of SVGs looks like:
Screen
  • Here's an example of identifying a GOOD vs BAD svg while exporting them:

Screen

โš ๏ธ Disclaimers

  • Use Case: At this stage, its highly recommend to NOT use it to develop scalable apps rather try and play it with MVPs, smaller and explanatory tasks.
  • Figma Design: Since we're using Figma's API to fetch the node and its details, so the better design you have the more better it will interpret for the AI to consume i.e. auto layouts, frame usage over group usage, consistently aligned across the board.
  • Rate limiting: Heavy usage may trigger Figma rate limits (e.g., HTTP 429). The server includes retry with backoff, but it does not bypass Figma limits. If you encounter rate limits, wait a few minutes and reduce the request volume.

๐Ÿ™Œ๐Ÿผ Acknowledgments

I came across Figma Context MCP by Graham Lipsman that sparks this motivation for me to develop Figma to Flutter explicitly having features like:

  • Assets exports
  • Colors and Theme setups
  • Widget tree and full screen building

Others coming soon...

๐Ÿงฑ Other framworks

If you want to develop this for React, Angular, React Native, Vue or any other framework. I've added a detailed doc Figma Framework MCP that you can explore and get started. Meanwhile I'll maintain a list here if someone's already doing this for framework specific Figma's MCP servers.

  • ...
  • ...

๐Ÿ”‘ License

This project is licensed under the MIT License - see the LICENSE file for details

๐Ÿ™‹โ€โ™‚๏ธ Author

Muhammad Hamza

LinkedIn Link

You can also follow my GitHub Profile to stay updated about my latest projects:

GitHub Follow

If you liked the repo then kindly support it by giving it a star โญ!

Copyright (c) 2025 MUHAMMAD HAMZA


Built with โค๏ธ for designers and developers who want to bridge the gap between design and code.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.