· Joseph · AI & Machine Learning  · 3 min read

Use Figma MCP server with Gemini CLI

In this article, I won't introduce what MCP is. Instead, I will explain how to set up the Figma MCP server and use Gemini as an MCP client to work with Figma. I will also show you how to run a prompt to get a Figma design with Gemini.

TOC

In this article, I won’t introduce what MCP is. Instead, I will explain how to set up the Figma MCP server and use Gemini as an MCP client to work with Figma. I will also show you how to run a prompt to get a Figma design with Gemini.

TOC

Figma MCP Introduction

Unlike other MCP servers that require you to install code to run them, with Figma, you only need to install the latest Figma desktop app and toggle on the MCP server from within the app. The Figma MCP server will then be installed on your host.

installenable MCP

After installation, you can try the link http://127.0.0.1:3845/sse, which should open in your browser with the following result.

localhost

Now that we’ve successfully installed the Figma MCP server, I’ll go ahead and set it up with Gemini.

How to install Gemini? Just check this article: Install Gemini CLI

Setup Gemini and Figma MCP server

If we open Gemini and type /mcp, we should see an empty MCP server list. empty-mcp

Connecting Gemini with the Figma MCP server is quite simple. We just need to add the following setting to ~/.gemini/setting.json or your project’s settings file.

Where is my setting.json? check this tutorial: configuration

  • User settings file:
    • Location: ~/.gemini/settings.json (where ~ is your home directory).
    • Scope: Applies to all Gemini CLI sessions for the current user.
  • Project settings file:
    • Location: .gemini/settings.json within your project’s root directory.
    • Scope: Applies only when running Gemini CLI from that specific project. Project settings override user settings.
  • System settings file:
    • Location: /etc/gemini-cli/settings.json (Linux), C:\ProgramData\gemini-cli\settings.json (Windows) or /Library/Application Support/GeminiCli/settings.json (macOS). The path can be overridden using the GEMINI_CLI_SYSTEM_SETTINGS_PATH environment variable.

Let’s look at my setting.json. After configuring the settings, just type /mcp in the Gemini CLI again, and we’ll see the configured MCP servers.

{
  "theme": "GitHub",
  "selectedAuthType": "gemini-api-key",
  "mcpServers": {
    "Figma Dev Mode MCP": { "url": "http://127.0.0.1:3845/sse" }
  }
}

figma-mcp

So, we’ve connected Gemini with the Figma MCP server, and we can now use Gemini to communicate with Figma.

Communicate With Figma

Before communicating, we have to open Dev Mode on Figma.

  • Design mode:
    • ./before-dev-mode
  • Dev mode:
    • ./after-dev-mode

The final step is to find your Figma file link by right-click > copy link to selection, paste the link into the Gemini CLI, and ask Gemini to do something with a prompt. copy

Let’s try this prompt:

use figma download this link {YOUR_LINK} and save as image.svg

get-image

All done. You can now use Gemini with the Figma MCP server, and you can let Gemini generate frontend code, a backend DB schema, or system user-story documents. Let’s recall what we’ve done:

  1. install the Figma app,
  2. toggle on the Figma MCP server in the app,
  3. use Dev mode,
  4. set the Gemini mcpServers setting,
  5. get the Figma file link, and
  6. prompt Gemini.

If you like this post, please connect with me on LinkedIn and give me some encouragement. Thanks.

Back to Blog

Related Posts

View All Posts »
Use Grafana MCP with Gemini and n8n

Use Grafana MCP with Gemini and n8n

The Model Context Protocol (MCP) is extremely useful. An AI assistant helps you decide when and how to use connected tools, so you only need to configure them. After integrating MCP logging management systems into several of my projects, it has saved me a significant amount of time. In this article, I'm going to integrate Grafana with the Gemini CLI and n8n. I will chat with the Gemini CLI and n8n and have them invoke the Grafana MCP server. structure TOC

[Day 30] BMAD-Method Summary

[Day 30] BMAD-Method Summary

import { YouTube } from 'astro-embed'; 花了好幾天的token,昨天做完Flutter記帳軟體以後,終於來到第30篇文章,最後一篇了,來總結一下我們的BMad-Method文吧。

[Day 29] BMAD-Method - Accounting App Flutter - 3

[Day 29] BMAD-Method - Accounting App Flutter - 3

import record from './record.gif'; 第29天,這本來是第19天的課題,但是發現一天內開發不完,就分了好多天實作。不要騙大家,就是隔了很久(到時候看github commit)也會被發現(!) 為什麼隔了這麼久呢,因為我原先定位這天要用flutter開發完整個app,但後面因為token不足,後來又卡了其他開發事項,所以一直沒進展,好在今天結束了,來跟大家說這不大不小的專案開發過程。 前情提要 Day 18我們開了flutter記帳的專案,也寫了story。接下來要開發完整個app。

[Day 28] BMAD-Method v6 - part 3 - BMB

[Day 28] BMAD-Method v6 - part 3 - BMB

今天介紹第二個核心功能,v6-alpha的介紹就告一個段落。 今天講的是BMAD-Method Builder (BMB),他提供了更方便的工具去 一邊討論一邊建立或編輯 agents, workflow, 跟 modules。比起前幾天讀了一堆agent or workflow的結構,BMB更簡單更便利。 Module 就是 agents + workflows + tasks + templates