Skip to content

davidlee/ligma

Repository files navigation

Ligma: a better Figma MCP tool / CLI command for coding agents

CLI alternative to the Figma MCP. Fetches a Figma node and emits a deterministic, token-efficient artifact bundle optimized for code agents.

The problem it sets out to solve: helping agents make sense of the things they need to know to implement a design. Figma json is geared towards accurately recording document structure, not revealing intent and guiding implemention.

Files are downloaded to disk instead of dumped into the agent's context window (./artifact by default, but can be specified), and can list / download additional assets (as png or svg).

Made with spec-driver.

Install

npm install -g ligma-mcp

Or from source:

git clone https://github.com/davidlee/ligma && cd ligma
pnpm install && pnpm build && pnpm link --global

Requires Node >= 18.

MCP server setup (Claude Code)

claude mcp add ligma -- ligma mcp

Requires FIGMA_TOKEN in your shell environment. Alternatively, pass it explicitly:

{
  "mcpServers": {
    "ligma": {
      "command": "ligma",
      "args": ["mcp"],
      "env": {
        "FIGMA_TOKEN": "your-figma-token"
      }
    }
  }
}

6 tools: figma_get_node, figma_get_outline, figma_get_render, figma_list_assets, figma_get_asset, figma_get_assets.

Usage

export FIGMA_TOKEN="<your-figma-personal-access-token>"

ligma <figma-url>

Or pass the token inline:

ligma <figma-url> --token <token>

Note: it takes a hot minute and there's no feedback during download. Little spinner coming soon (ironic, eh?).

Subcommands

list-assets

List detected export targets as JSON:

ligma list-assets <figma-url>

Outputs a JSON array of { nodeId, name, format, reason } to stdout.

Flag Default Description
-t, --token <token> $FIGMA_TOKEN Figma personal access token
-d, --depth <n> 2 Node tree depth
--max-assets <n> 20 Maximum assets to list
--no-cache Disable fetch caching
--cache-directory <path> .cache/figma-fetch Cache directory path

get-asset

Fetch a single asset by node ID and write to disk:

ligma get-asset <figma-url> <node-id>

Writes the asset file and prints the absolute path to stdout.

Flag Default Description
-t, --token <token> $FIGMA_TOKEN Figma personal access token
-o, --out <dir> ./artifacts Output directory
-f, --format <fmt> png Image format (png or svg)
--no-cache Disable fetch caching
--cache-directory <path> .cache/figma-fetch Cache directory path

Options

Flag Default Description
-t, --token <token> $FIGMA_TOKEN Figma personal access token
-o, --out <dir> ./artifacts Output directory
-f, --format <fmt> png Image format (png or svg)
-s, --scale <n> 2 Image scale (0.01 – 4.0)
-d, --depth <n> 2 Node tree depth
--include-hidden false Include hidden nodes in outline and context
--no-expand Disable selective expansion
--max-expand <n> 10 Maximum expansion targets
--expand-depth <n> 2 Depth for expansion refetches
--max-assets <n> 20 Maximum assets to export
--asset-format <fmt> auto Asset export format (auto, png, svg)
--no-cache Disable fetch caching
--cache-directory <path> .cache/figma-fetch Cache directory path

Project documentation

Design revisions

DR Delta Description
DR-001 DE-001 PROD-001 delivery planning
DR-002 DE-002 Project scaffold and Figma client
DR-003 DE-003 Core normalization engine
DR-004 DE-004 Semantic inference, tokens, and assets
DR-005 DE-005 Outline and context generation
DR-006 DE-006 Selective expansion and caching
DR-007 DE-007 Adopt strict lint config
DR-008 DE-008 Backlog fixes: individualStrokeWeights and interaction extraction
DR-009 DE-009 Asset export pipeline
DR-010 DE-010 Minimal MCP transport layer

About

a saner alternative to Figma's MCP server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors