Convert Figma Designs to Code Using Cursor and Figma-Context-MCP

Convert Figma Designs to Code Using Cursor and Figma-Context-MCP

Model Context Protocol makes it incredibly easy to integrate powerful tools directly into modern IDEs like Cursor, dramatically boosting productivity. With just a few simple steps we can allow Cursor to access a Figma design and use its code generation capabilities to design mobile screen within minutes

Figma-Context-MCP paired with Cursor AI. It’s a free, open-source combo that automates the whole process. Here’s how to make it work for you, step by step, with a personal twist from my own tinkering.

What’s This Figma-Context-MCP Thing?

Imagine a bridge between Figma and Cursor. That’s Figma-Context-MCP in a nutshell. It’s built on something called the Model Context Protocol — a mouthful, sure, but it just means it grabs real UI bits (think buttons, fonts, layouts) and hands them to Cursor for code-making. You end up with:

  • Exact replicas of your design.
  • Front-end code that’s ready to roll.
  • Way less manual fiddling.

I’ve messed with it myself, and it’s like having a junior dev who never sleeps.

Step 1: Setting up the environment

  • Log in to your Figma account
  • Go to Settings > Security > Generate new token
  • Enter a name for the token and make sure you have read permissions on File content and Dev resources, then click on generate token.
  • Copy and keep the token for future use.

Step 2: Node.js Installation

We’ll be using npx to run the Figma MCP server, and for that, Node.js is required.

  • Download the latest version of Node.js from nodejs.org
  • Run the installer.
  • Leave all settings as default and complete the installation.

After installation, verify everything worked by running these commands in your terminal:


Article content

Step 3: Cursor IDE Installation

  • Lastly, download the Cursor IDE from cursor.com.
  • Cursor is built specifically for AI-assisted development and will help us connect to the Figma MCP server and generate code effortlessly.

Step 4: Get It Running

First, you’ll need the tool itself. Here’s what I did:

  • Popped open my terminal and typed:

git clone https://github.com/GLips/Figma-Context-MCP
cd Figma-Context-MCP        

Then installed the bits it needs:

pnpm install        

If you don’t have pnpm, grab it with npm install -g pnpm. Took me five minutes, tops.

To fix this, you need to install pnpm. Here’s how:

✅ Option 1: Install via npm (if you already have Node.js and npm)

npm install -g pnpm        

Option 3: Install via Homebrew (on macOS)

If you use Homebrew, run:

brew install pnpm        

After Installation

Verify it with:

pnpm --version        

Install the MCP package locally or globally

Locally Install

In your project folder, run:

npm install --save-dev figma-developer-mcp        

Global install

npm install --global figma-developer-mcp        

Once installed, verify in your terminal:

npx figma-developer-mcp --version
# or, if global:
figma-developer-mcp --version
        
Article content

Step 4: Fire Up the MCP Server

Back in the terminal, I kicked off the server like this:

npx figma-developer-mcp --figma-api-key=<pasted-my-token-here>        

A few seconds later, it spat out:

“New SSE connection established”
# That’s the green light — server’s up and humming.        

Alternative Way

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

  1. Navigate to: File > Preferences > Cursor Settings > MCP
  2. Click on “Add a new global MCP server”.
  3. This will open a mcp.json configuration file. Paste the following code into it:
  4. Replace YOUR-KEY with the Figma API token you generated earlier.
  5. 5. Save the file. Once saved, you should see “Framelink Figma MCP” listed under available MCP servers.

Article content

Step 5: Pull Designs into Cursor

Here’s where it gets fun. I opened a Figma file I’d been messing with — a simple Sign-in page mockup. Then:

For your own use case, you can use any Figma design — just copy the frame URL and provide it to the chat agent within Cursor. To get the link:

  1. Open your Figma design.
  2. Right-click on the frame or element you want to replicate.
  3. Select Copy/Paste As > Copy Link to Selection

Paste this link into Cursor’s chat, and the agent will handle the rest — generating the Jetpack Compose, SwiftUI, HTML/CSS based on your selected frame.


Article content


Article content

Wrap-Up: Code Smarter, Not Harder

This setup isn’t perfect — sometimes Cursor misses a shadow or misaligns a flexbox — but it’s a hell of a lot faster than coding by hand. If you’re tired of playing pixel detective, give Figma-Context-MCP a spin. Clone the repo, plug in your token, and let it rip. Got thoughts or hacks to share? I’m all ears — drop ’em below.

Now, go build something awesome. You’ve earned it.

To view or add a comment, sign in

More articles by Muhammad Irfan Arshad

Explore content categories