ksn-figma-mcp
v0.1.0
Published
Local Figma MCP bridge using the Figma Plugin API
Readme
KSN Figma MCP
Local Figma MCP bridge that connects an MCP client to the Figma Plugin API.
MCP client -> mcp.js -> bridge-server.js -> Figma plugin UI WebSocket -> plugin/code.ts -> Figma Plugin APIThis follows the same broad shape as Figma's MCP workflows: read design context, export screenshots/assets, inspect variables/styles, map nodes to code, upload assets, and write to the canvas with a use_figma tool. Official remote-only features such as creating new Figma files, hosted auth, remote libraries, shader libraries, and Figma's private code-generation pipeline are not reproducible from a local plugin alone.
Setup
Install root dependencies:
npm installInstall and build the Figma plugin:
npm --prefix plugin install
npm run build:pluginImport the plugin in Figma Desktop:
- Open Figma Desktop.
- Go to Plugins -> Development -> Import plugin from manifest.
- Select
plugin/manifest.json. - Run
KSN Figma MCP Bridgefrom Plugins -> Development.
Start the bridge:
npm run bridgeAdd the MCP server to your client, replacing the path if needed:
codex mcp add ksn-figma-mcp node /Users/11502010/Desktop/Innovations/RD/ksn-figma-mcp/mcp.jsUse With npx
Start the local bridge:
npx -y ksn-figma-mcp bridgePrint the Figma plugin manifest path, then import that manifest in Figma Desktop:
npx -y ksn-figma-mcp plugin-pathAdd the MCP server to Codex:
codex mcp add ksn-figma-mcp -- npx -y ksn-figma-mcpTools
check_bridge_statuswhoamiget_metadataget_design_contextget_figjamget_screenshotdownload_assetsupload_assetsget_variable_defssearch_design_systemadd_code_connect_mapget_code_connect_mapuse_figma
use_figma Example
const frame = figma.createFrame();
frame.name = params.name || "Generated frame";
frame.resize(360, 240);
frame.fills = [{ type: "SOLID", color: { r: 1, g: 1, b: 1 } }];
figma.currentPage.appendChild(frame);
figma.viewport.scrollAndZoomIntoView([frame]);
return helpers.serializeNode(frame, { detail: true, depth: 1 });use_figma intentionally executes JavaScript in your active Figma file. Treat it like a local developer tool: only run code from sources you trust.
Environment
FIGMA_MCP_BRIDGE_PORT: bridge port, default3845FIGMA_MCP_BRIDGE_URL: MCP bridge URL, defaulthttp://127.0.0.1:3845FIGMA_MCP_REQUEST_TIMEOUT_MS: plugin request timeout, default60000FIGMA_MCP_MAX_BODY_BYTES: HTTP body limit, default50MB
Verify
npm run check