figma-to-markdown-mcp

figma-to-markdown-mcp

Converts Figma to Markdown. Strips out visual noise to drastically reduce LLM token consumption.

Category
访问服务器

README

figma-compaction-mcp

Languages: English | Korean

Current version: 3.0.0

figma-compaction-mcp is an MCP server for Figma-link workflows. It fetches upstream Figma design context internally, prunes it into compact plain-text context, and returns that reduced result to the calling agent instead of the full upstream payload.

What It Is

This project is for teams that want agents to work from Figma node URLs without pushing raw upstream Figma MCP output into the caller model context whenever the bridge can safely handle the request.

The intended flow is simple:

  1. A user gives an agent a Figma node URL.
  2. The agent calls get_figma_compact_context.
  3. This server fetches upstream Figma context internally.
  4. The server compacts the upstream result into a small line-based DSL.
  5. The agent receives compact implementation context and works from that output.

Why Use It

The main reason to use this server is token reduction without losing implementation-critical facts.

Raw Figma MCP responses can be large enough to consume a meaningful part of the caller model context before implementation even begins. This bridge keeps that upstream payload inside the server whenever possible, compacts it first, and only returns the reduced result to the agent.

  • Lower token usage for Figma-link prompts
  • Smaller model-context footprint before implementation starts
  • Cleaner implementation input for agents
  • Less raw upstream noise in caller context
  • Traceable output with node ids, typography tokens, asset refs, warnings, and fallback hints
  • A built-in fallback path when the bridge cannot safely complete

How It Works

This server sits between your agent and the local Figma Desktop MCP server.

User prompt with Figma link
  -> Agent calls get_figma_compact_context
  -> figma-compaction-mcp connects to local Figma Desktop MCP
  -> get_design_context / get_metadata
  -> internal compaction
  -> compact plain-text context returned to the agent

The public entrypoint is get_figma_compact_context.

  • figma_url: required full Figma node URL
  • mode: optional compaction mode, one of minimal, balanced, debug
  • task: optional intent hint, one of implement, inspect, summarize
  • include_assets: optional, default true
  • include_text_specs: optional, default true
  • include_trace_ids: optional, default true
  • include_metadata: optional, default true
  • max_output_chars: optional explicit output budget

When the bridge succeeds, it returns compact plain-text context plus structured fields for stats, traceability, warnings, and diagnostics. When the bridge cannot safely fetch or compact the node, it returns a fallback handoff so the agent can continue with standard Figma MCP tools directly.

Example compact output:

src|figma|get_design_context|4:5100|FILE_KEY
sum|Example screen|frame|375x876|535,258
el|4:5107|field_card|w343;layout:column;r20;p:16,20,20,20;bg:#ffffff
tx|4:5106|Section title|t1
ty|t1|Inter|600|20|24|#333333
as|imgAsset|asset|4:5107|asset_slot|/assets/example-image.png

Example URL shape:

https://www.figma.com/design/FILE_KEY/FILE_NAME?node-id=NODE_ID&m=dev

Requirements

To use the Figma-link bridge flow, you need:

  • Figma Desktop
  • Dev Mode enabled in Figma Desktop
  • Desktop MCP server enabled in Figma Desktop
  • Node.js 18+

Default upstream Figma MCP endpoint:

http://127.0.0.1:3845/mcp

Override with:

FIGMA_MCP_URL

Installation

Install globally:

npm install -g figma-compaction-mcp

Or run with npx:

npx figma-compaction-mcp

MCP Client Registration

Register this server in your MCP client.

Example using npx:

{
  "mcpServers": {
    "figma-compaction": {
      "command": "npx",
      "args": ["-y", "figma-compaction-mcp"]
    }
  }
}

Example using a global install:

{
  "mcpServers": {
    "figma-compaction": {
      "command": "figma-compaction-mcp",
      "args": []
    }
  }
}

Your client may use JSON, TOML, or another config format, but the command registration model is the same.

How To Use It

  1. Open Figma Desktop and enable Dev Mode and the desktop MCP server.
  2. Register figma-compaction-mcp in your MCP client.
  3. Give your agent a Figma node URL.
  4. Have the agent call get_figma_compact_context first.
  5. Use the returned compact context for implementation, inspection, or summarization.
  6. If the server returns a fallback handoff, continue with the standard Figma MCP tools for the same node.

In practice:

  • Small and medium components usually return compact context directly.
  • Large screens can still return larger output when the retained structure, text, and assets matter.
  • balanced mode is the default for normal implementation work.
  • Only set max_output_chars when you intentionally want a hard output budget.

Limitations

  • Final tool routing still depends on the MCP host or agent. This server can strongly guide usage, but it cannot forcibly override host-side routing.
  • When the bridge cannot safely complete a request, it returns a compact fallback handoff instead of passing raw upstream payloads through this server response.
  • Compaction is optimized for implementation relevance, so purely decorative wrappers and chrome-like nodes may be pruned outside inspect-oriented flows.

Other Information

  • Release history: CHANGELOG.md
  • Compact contract draft: SPEC.md
  • Source repository: https://github.com/s9hn/figma-compaction-mcp
  • Contributions: issues and pull requests are welcome on GitHub
  • Issues: GitHub Issues
  • License: MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选