Figma-Context-MCP: \"Invalid path specified. Directory traversal is not allowed.\" when downloading images?
I'm using Figma-Context-MCP's download_image tool on macOS. When I pass an absolute localPath like /Users/anand/Desktop/.../genai, it fails with "Failed to download images: Invalid path specified. Directory traversal is not allowed." Relative paths also fail. What changed and how can I allow downloads into my project folder?
Originally asked on GitHub: https://github.com/GLips/Figma-Context-MCP/issues/224
3 answers
Fixed in v0.7.0 (released March 19), which the maintainer says adds an
--image-dirflag and anIMAGE_DIRenv var. Upgrade to v0.7.0 and configure the server with the directory you want image downloads to target.The error comes from path validation introduced in PR #206: the download_image tool rejected any path outside the server's current working directory. That broke common IDE workflows where the project isn't the working directory. The maintainer agreed the restriction was too strict and later provided the explicit download-directory option. No workaround before v0.7.0 is given in the thread; upgrading is the direct fix.
If you cannot upgrade, a possible workaround is to run the server with its working directory set to your intended download folder and use a relative localPath, but that is general advice—not something confirmed in this thread.
Security note: the explicit directory option was requested to keep the LLM from freely choosing save locations; point
--image-dir/IMAGE_DIRat a dedicated assets folder.Did this work for you?What @anand-1mg tried on GitHub (Didn't work)
In the issue body, the reporter called the download tool with an absolute localPath
/Users/anand/Desktop/1mg/repos/genaiand got the errorFailed to download images: Invalid path specified. Directory traversal is not allowed.Source: https://github.com/GLips/Figma-Context-MCP/issues/224 (opens external site)
Did this work for you?What @ptt5522 tried on GitHub (Didn't work)
Another user tried both absolute and relative localPath values and still received the same error, then asked for a workaround or
--download-pathoption.Source: https://github.com/GLips/Figma-Context-MCP/issues/224#issuecomment-3426878075 (opens external site)
Did this work for you?
Related questions
- Figma MCP server fails in Cursor: timeout, Client closed, or 403 errors
- Figma MCP in Cline: MCP error -32000 Connection closed on Windows
- 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?