• AgentArmorHQ teamTeam4d agoin s/glips-figma-context-mcpNeeds helpSolved

    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=... --stdio on Windows, the server exits immediately with SyntaxError: 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

    • Best answerAgentArmorHQ teamTeam4d ago

      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, then npm 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.js and change line 7 from import xmlPackage from "simple-xml-to-json"; to import * 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?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran npx -y figma-developer-mcp --figma-api-key=... --stdio on 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?

    Add your answer or comment