Figma-Context-MCP crashes with SyntaxError: module 'simple-xml-to-json' does not provide an export named 'default'
When I run
npx -y figma-developer-mcp --figma-api-key=... --stdioon Windows, the server exits immediately withSyntaxError: The requested module 'simple-xml-to-json' does not provide an export named 'default'in @jimp/plugin-print's load-bitmap-font.js. It happens on Node v22.15.1 and also Node v24.2.0. How can I get the Figma-Context-MCP server to start despite this dependency error?Originally asked on GitHub: https://github.com/GLips/Figma-Context-MCP/issues/329
5 answers
Status: the issue is closed, but no fixed package version is mentioned in the thread. The crash is in the ESM build of @jimp/plugin-print: line 7 of load-bitmap-font.js does
import xmlPackage from "simple-xml-to-json";and Node rejects it because that module does not provide an export named "default".Workaround A (reported working): one commenter resolved it locally by cloning the Figma-Context-MCP repo, installing pnpm, running
pnpm install, thennpm run build, and pointing the MCP client at the built entrypoint instead of npx:json{ "mcpServers": { "Framelink_Figma_MCP": { "command": "node", "args": ["<path-to-cloned-repo>/Figma-Context-MCP/dist/bin.js", "--stdio"], "env": { "FIGMA_API_KEY": "YOUR_KEY" }, "disabled": false, "alwaysAllow": [] } } }Replace
<path-to-cloned-repo>with the actual path to your clone. This config also passes the API key through the environment instead of a CLI flag.Workaround B (suggested, not confirmed in the thread): open the cached file at
C:\Users\YOURUSER\AppData\Local\npm-cache\_npx\<CACHE_HASH>\node_modules\@jimp\plugin-print\dist\esm\load-bitmap-font.jsand change line 7 fromimport xmlPackage from "simple-xml-to-json";toimport * as xmlPackage from "simple-xml-to-json";. The commenter said this should solve the problem and another user agreed, but nobody reported the actual result.General advice: the cache-file edit is local to one machine and can be lost when npx refetches the package. Keep Figma API keys out of committed config files and use a key with the minimum scope you need.
Did this work for you?What @lyaonov tried on GitHub (Worked)
Cloned Figma-Context-MCP, installed dependencies with pnpm, built with npm run build, and ran the local dist/bin.js via node with --stdio and FIGMA_API_KEY in env. The commenter reported this resolved the crash locally.
Source: https://github.com/GLips/Figma-Context-MCP/issues/329#issuecomment-4189476262 (opens external site)
Did this work for you?What @BlueEye2077 tried on GitHub (Outcome unclear)
Edited line 7 of the cached @jimp/plugin-print load-bitmap-font.js, changing the import to
import * as xmlPackage from "simple-xml-to-json";. This was suggested as the fix and another user agreed, but no one in the thread confirmed the server started.Source: https://github.com/GLips/Figma-Context-MCP/issues/329#issuecomment-4189520553 (opens external site)
Did this work for you?What @lyaonov tried on GitHub (Didn't work)
Reproduced the same SyntaxError with the same npx command on Node v24.2.0, showing the crash is not limited to Node v22.15.1.
Source: https://github.com/GLips/Figma-Context-MCP/issues/329#issuecomment-4189423995 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Ran
npx -y figma-developer-mcp --figma-api-key=... --stdioon Windows with Node v22.15.1; the server failed immediately with the SyntaxError from @jimp/plugin-print load-bitmap-font.js line 7.Source: https://github.com/GLips/Figma-Context-MCP/issues/329 (opens external site)
Did this work for you?
Related questions
- Figma-Context-MCP: RangeError: Invalid string length when fetching large Figma files
- How to use Figma-Context-MCP with VS Code and GitHub Copilot?
- Figma-Context-MCP: why does my AI host pick the wrong tool, and what changed in v0.1.6?
- Figma-Context-MCP fails to connect in Cline — how to configure it?
- Figma-Context-MCP get_figma_data fails: 'Error fetching file: [object Object]'