figma-icon-automation-mcp
v1.0.2
Published
An MCP server that publishes Figma icon pages to GitLab merge requests.
Readme
Figma Icon Automation MCP
This repository is now a standalone MCP server. An agent can receive a Figma URL, read matching icon pages, ask the user which page to publish, export component SVGs, and create a GitLab merge request.
Workflow
- The user sends a Figma URL to the agent.
- The agent calls
list_icon_pages; the MCP server reads the Figma file pages. - The MCP server returns only pages whose names start with
icon_, and the agent asks the user to choose one. - The agent calls
publish_icon_page; the MCP server exports all component SVGs from the chosen page. - The MCP server commits SVGs to
src/svg/<workspace>/, updatescache.jsonandpackage.json, and creates a GitLab MR.
MCP Configuration
Example:
{
"mcpServers": {
"figma-icon-automation": {
"command": "node",
"args": [
"-y",
"figma-icon-automation-mcp",
"--page-prefix",
"icon_",
"--workspace",
"buyer",
"--gitlab-domain",
"https://gitlab.example.com",
"--gitlab-project-id",
"123",
"--gitlab-token",
"YOUR_GITLAB_TOKEN",
"--figma-token",
"YOUR_FIGMA_TOKEN"
]
}
}
}workspace is optional. When omitted, the server reads package.json.name from the launch directory. For example, @XXX/buyer-icons resolves to buyer. If no workspace can be resolved, the tool returns workspace_required so the agent can ask the user.
Tools
list_icon_pages- Input:
figmaUrl - Output: pages matching the configured page prefix.
- Input:
publish_icon_page- Input:
figmaUrl,pageId,version,message, optionalworkspace - Output: GitLab MR URL and publish result.
- Input:
Figma Conventions
- Publishable page names must start with
icon_, such asicon_baseoricon_market. - Icons inside the page should be Figma components.
- Component names become SVG file names. For example,
homeis written tosrc/svg/<workspace>/home.svg.
Local Development
npm install
npm test
node mcp/server.js