npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

figma-mcp-downloader

v1.1.0

Published

CLI for saving Figma MCP tool results to local files

Readme

figma-mcp-downloader

npm version Build

CLI for saving Figma MCP tool results to local files.

[!IMPORTANT] This documentation is written exclusively for AI agents with access to the Figma MCP tool schema.

Prerequisites

  • Figma Desktop app must be running (Local MCP server starts automatically)

Installation

npm install -g figma-mcp-downloader

Or run directly with npx:

npx figma-mcp-downloader <subcommand> [options]

Subcommands and MCP Tool Mapping

Subcommands share the same names as MCP tools.

| Subcommand | MCP Tool | | -------------------- | -------------------- | | get_design_context | get_design_context | | get_metadata | get_metadata |

[!NOTE]
Other Figma MCP tools (e.g., get_screenshot, get_variable_defs) are not currently supported by this CLI.

npx figma-mcp-downloader [subcommand] <output-file> [options]

Common Arguments/Options

[!IMPORTANT]
Options without descriptions are identical to the corresponding Figma MCP tool parameters. Refer to the Figma MCP tool schema for details.
The MCP response contains multiple content items: the first is the generated JSX code or XML, and the rest are supplementary AI guidance. Use -c to extract only the JSX code or XML.

| Argument/Option | Figma MCP Parameter | Description | | -------------------------------------- | ------------------- | ------------------------------------------------------------------------------ | | <output-file> | - | Output file path | | -c, --content-only | - | Save only the first text content (JSX code or XML), not the full JSON response | | -i, --node-id <id> | nodeId | The ID of the node in the Figma document | | -l, --client-languages <languages> | clientLanguages | A comma separated list of programming languages used by the client | | -f, --client-frameworks <frameworks> | clientFrameworks | A comma separated list of frameworks used by the client |

[!NOTE]
Both -l and -f options are used for logging purposes to understand which languages and frameworks are being used. Specify them based on available context, but omit them if unsure.

get_design_context

Get the design context for a layer or selection and save the full JSON response from the MCP tool to a file.

npx figma-mcp-downloader get_design_context <output-file> [options]

[!IMPORTANT]
This CLI always sets forceCode to true when calling the MCP tool.

| Argument/Option | Figma MCP Parameter | Description | | ----------------------------------- | ------------------- | ----------------------------------------------------------------------------------- | | -a, --artifact-type <type> | artifactType | The type of artifact the user is creating or modifying | | -t, --task-type <type> | taskType | The type of task being performed | | -d, --dir-for-asset-writes <path> | dirForAssetWrites | The directory to write image, vector and video assets to (Must be an absolute path) |

[!NOTE] Valid values for -a: WEB_PAGE_OR_APP_SCREEN, COMPONENT_WITHIN_A_WEB_PAGE_OR_APP_SCREEN, REUSABLE_COMPONENT, DESIGN_SYSTEM Valid values for -t: CREATE_ARTIFACT, CHANGE_ARTIFACT, DELETE_ARTIFACT The -d option is required when Figma Desktop's "Image source" is set to "Download". It has no effect with "Local server".

Examples

# With -c: saves JSX only
npx figma-mcp-downloader get_design_context design_context.jsx -i "123:456" -c -l typescript -f react,tailwindcss
# Without -c: saves full JSON response
npx figma-mcp-downloader get_design_context design_context.json -i "123:456" -l html,css,javascript -f vue
# With -d: download assets to a directory (required when "Image source" is "Download")
npx figma-mcp-downloader get_design_context design_context.jsx -i "123:456" -c -d /home/user/my-project/src/public/images -l typescript -f react,tailwindcss

get_metadata

Get the sparse XML representation for a layer or selection and save the full JSON response from the MCP tool to a file.

npx figma-mcp-downloader get_metadata <output-file> [options]

Examples

# With -c: saves XML only
npx figma-mcp-downloader get_metadata metadata.xml -i "123:456" -c -l typescript -f react,tailwindcss
# Without -c: saves full JSON response
npx figma-mcp-downloader get_metadata metadata.json -i "123:456" -l html,css,javascript -f vue

Environment Variables

The MCP server URL can be configured via environment variables.

| Variable | Description | Default | | --------------- | -------------- | --------------------------- | | FIGMA_MCP_URL | MCP server URL | http://127.0.0.1:3845/mcp |

# PowerShell
$env:FIGMA_MCP_URL="http://localhost:4000/mcp"; npx figma-mcp-downloader get_design_context design_context.jsx -c

# Linux/Mac
FIGMA_MCP_URL="http://localhost:4000/mcp" npx figma-mcp-downloader get_metadata metadata.xml -c