If you've tried connecting modern CLI coding agents — whether Cursor, Claude Code, Cline, or Windsurf — to a real UI design file, you've probably hit an unpleasant financial wall. Figma's official plugin for the Model Context Protocol (MCP) is tightly locked to a paid Dev Mode subscription. For a human developer, $25 a month is a reasonable work expense. But when a project has five independent background bots testing layout variants, paying for a separate seat for each virtual assistant becomes sheer madness.
What always annoyed me about this story was the one-way nature of existing integrations. Most tools can only export an image or pull raw CSS. Yet a real engineering dialogue requires feedback: if a component doesn't fit into a Tailwind grid or needs a responsive rework, the agent should be able to move a frame or switch a theme right inside the design file.
That's exactly what Figwright solves — a fully open-source project under the MIT license created by a developer going by awdr74100. It builds a two-way bridge between Figma and coding agents over the open MCP protocol, requiring not a dime for Dev Mode licenses and working on the regular free Starter plan.
A local WebSocket bridge instead of cloud licenses
Let's break down the architecture of this setup nut by nut. How does Figwright bypass the restrictions of Figma's closed cloud API without breaking the platform's rules?
The secret lies in splitting the system into two independent links:
- Local MCP server process: the
@figwright/mcppackage, launched on the developer's machine via Node.js. It communicates with the IDE (Cursor or Claude Code) over standard input/output streams (stdio) using the JSON-RPC protocol. - Figma desktop app plugin: a lightweight Vue 3 extension running in an isolated sandbox iframe inside the editor itself.
These two components communicate via a local WebSocket server at 127.0.0.1:3055. To keep heavy design trees with complex layer hierarchies from turning data transfer into a slideshow, messages are packed into the compact binary MessagePack (msgpack) format.
From a security standpoint, everything here is clean: design data never leaves your machine and never leaks to third-party cloud proxies. The server validates the Host: 127.0.0.1 header and strictly checks the Origin identifier, blocking DNS-rebinding attacks from open browser tabs.
135 tools: from style inspection to vector drawing
Most third-party MCP servers stop at a couple of trivial commands like "take a screenshot" or "return node text." In Figwright, the developers packed an impressive arsenal of 135 specialized tools divided into three functional groups:
- Read group: the agent can request not just a screenshot, but the full syntax tree of the selected node, inspect design variables (Figma Variables), typography styles, shadow effects, and corner radii. Export tools for PNG, SVG, and PDF are available, and even preview rendering of vector animations to MP4 and GIF.
- Write group: this is where the real magic begins. The agent gets permission to create and modify nodes on the canvas. It can adjust Auto Layout parameters on the fly, change alignment, generate vector paths via the Figma Draw tool using SVG path coordinates, edit text labels, and switch theme modes (Dark Mode / Light Mode).
- Grounding group: so the model doesn't invent components from scratch, the
component_mapandtoken_maptools link design tokens to existing components in your frontend repository (for example, shadcn/ui buttons or Tailwind colors). And thedesign_difffunction compares the current state of the design with the previous snapshot, avoiding unnecessary regeneration of untouched code.
This combination turns the agent from a blind style copier into a full-fledged layout assistant. Paired with multi-agent workspace managers like the codeg tool, which we covered earlier, Figwright takes on the role of a graphical terminal.
Multi-agent coordination and leader election
What happens if two or three agents are working in your project at the same time? For example, one is refactoring an authentication component in Cursor while a second is sketching a dashboard through Claude Code in the terminal.
Each client will inevitably try to start its own @figwright/mcp process. If they blindly fought over port 3055, the connection to the plugin would crash with an EADDRINUSE error. Figwright's authors elegantly bypassed this problem using a Leader Election mechanism.
The first process started grabs the socket and becomes the leader node. Subsequent processes detect that the port is occupied, switch themselves to follower mode, and transparently forward all tool calls to the leader via a local /rpc HTTP endpoint. And to prevent agents from clobbering each other's context on an accidental mouse click in the Figma window, there's the use_file command: the agent locks onto the UUID of an open document and polls only that file, ignoring tab switches by the user.
Environment setup and first run
To run this setup, you'll need Node.js 20.19.0+ or 22.12.0+ (earlier versions don't support the native WebSocket client with the required parameters) and the Figma desktop app.
First, add the server to your MCP client's configuration file (for instance, .mcp.json in your project root for Claude Code, or in Cursor settings):
{
"mcpServers": {
"figwright": {
"command": "npx",
"args": ["-y", "@figwright/mcp@latest"]
}
}
}
After configuring the client, connect the plugin to desktop Figma:
- Go to the releases section of the project's official GitHub repository and download the archive with the prebuilt plugin.
- Unpack the folder to a convenient location on disk.
- In the desktop version of Figma, open the menu: Plugins -> Development -> Import plugin from manifest... and select the
manifest.jsonfile from the unpacked directory. - Launch the plugin via Plugins -> Development -> Figwright. In the opened plugin window, the connection status will turn into a green
Connectedbadge.
To help the agent understand your stack's specifics instead of generating generic HTML, the developers prepared a set of agent scenarios (Skills) installed via the open skills distribution system:
# Install specialized codegen skills for React, Vue, and Tailwind
npx skills add awdr74100/figwright/skills
Now, in a chat with the agent, you can simply write: "Check the Figma connection status via figwright:ping and find all text input fields in the auth frame." The agent will read the exact spacing, match colors against your tailwind.config.js, and output a ready-to-use JSX component.
Keep in mind: the exchange protocol between the plugin and the CLI package evolves very dynamically. If after updating @figwright/mcp the inspection commands start returning a schema incompatibility error, be sure to download the latest plugin release from the repository and restart it in Figma.
Scope limits and pitfalls
Despite its obvious convenience, Figwright has quirks worth keeping in mind before rolling it out to a team pipeline.
First, the plugin isn't published in the official Figma Community catalog yet and requires manual developer manifest import. This imposes a constraint: the design must be open specifically in the installed desktop Figma client, since the browser web version has no direct access to local port 127.0.0.1:3055 due to strict Mixed Content policies.
Second, while the tool can modify layer properties, complex compound boolean operations on curves or bulk imports of third-party vector icons are still safer to do by hand. But for routine layout work on cards, standard forms, and tables from an existing design system, the setup pays back its configuration time in literally the very first evening of work.
