figma-developer-mcp can be used directly from the command line to fetch simplified Figma design data. This is useful for scripting, piping design data into other tools, or quick one-off lookups during development.
Running figma-developer-mcp with no subcommand starts the MCP server as usual. The fetch subcommand below is what enables direct CLI usage.
fetch
Pull simplified design data for a Figma file or node and print it to stdout. Uses the same simplification pipeline as the MCP server’sget_figma_data tool.
--format=json for JSON, or --format=tree for the compact tree format. This differs from the MCP server, which defaults to tree: YAML and JSON are easier to pipe into standard tools. See Configuration for details on each format.
Authentication works the same as the server. Provide a Figma API key or OAuth token with a flag, or set FIGMA_API_KEY or FIGMA_OAUTH_TOKEN in the environment or a .env file. If neither is set, fetch exits with an error. See Authentication for how to get a token.
Shell characters like
& in Figma URLs can cause issues. Always wrap URLs in quotes.Flags
Thefetch subcommand takes a Figma URL as an optional positional argument, plus the following flags. You need either a URL or --file-key.
When both a URL and explicit flags are provided, the flags take precedence. This lets you override just the node ID while still pulling the file key from a URL, for example.
string
Figma file key. Overrides the file key in the URL. When this is set, a URL that can’t be parsed is ignored instead of causing an error.
string
Node ID in
1234:5678 format. Overrides the node-id in the URL. If neither is given, the whole file is fetched.number
Limit how many levels of the node tree to traverse. Unlimited by default.
string
default:"yaml"
Output format:
yaml, json, or tree. Any other value is an error.boolean
default:"false"
Alias for
--format=json. Ignored when --format is also set.string
Figma Personal Access Token. Falls back to the
FIGMA_API_KEY environment variable.string
Figma OAuth Bearer token. Falls back to the
FIGMA_OAUTH_TOKEN environment variable. Used instead of the API key when both are set.string
default:".env in the current directory"
Path to a
.env file to load before reading credentials.boolean
default:"false"
Disable anonymous usage telemetry for this run. See Configuration.