Rea-FigmaDesign
Extracts a Figma file's AST into a local SQLite graph, enabling querying and review of design nodes by ID, structure family, style fingerprint, layout archetype, and generation classification through an MCP interface.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Rea-FigmaDesign
把 Figma 檔案的 AST 抽成本地 SQLite 圖譜,讓設計師用 ID 與分類複審、讓 agent 直接查詢。
線上閱讀:https://yandapengh.github.io/Rea-FigmaDesign/

為什麼做這個:一份跑了兩年的支付設計檔有 163,601 個節點、512 個手機畫面,去重後只有 291 個是真的;設計師常用的名稱只有 27 種,背後卻有 68 種不同結構。Figma 擅長「畫」,不擅長「查」。
這個專案只做一次抽取,之後所有問題都問本地圖譜——不再翻頁、不再靠圖層名稱、不再人工比對。
→ 完整背景、實驗方法與技術取捨:docs/index.html(Part 1 為什麼做 / Part 2 怎麼做)
能力
能力 | 怎麼算 |
結構家族 | 節點身份 = Merkle hash over |
風格指紋 | 色票、字階、圓角、陰影、token 採用率的量化分佈 |
三層召回 | 同構(hash 相等)→ 近構(型別分布 cosine ≥ 0.9)→ 樣式近(≥ 0.45) |
新舊世代分類 | 由人工標註驅動,低信心一律回 |
版面原型 | 用 z-order 遮罩規則判斷 page / overlay-panel / overlay |
複審看板 | 設計師勾選 → 批次分類/備註 → 複製 Markdown → agent 寫回 |
Related MCP server: shop-sql-mcp
Quick start
需求:Node.js ≥ 20、Figma Desktop。
npm install
# 1. 起 ingestion server(自動建立 data/rea-figma.sqlite)
npm run start:server
# 2. 建置插件
npm run build:plugin
# Figma → Plugins → Development → Import plugin from manifest…
# → plugin/manifest.json → 執行 → Extract AST to Local SQLite
# 3. 檢查環境與資料
npm run doctor
npm run audit:db -- ./data/rea-figma.sqlite
# 4. 查詢
npm run query -- sheet <node-id>
npm run query -- find <node-id> --top 8
npm run sync # 特徵表 → 預測 → 複審看板 → parity → 來源檢查兩個 Figma 匯入的注意事項:
manifest 只白名單
http://localhost:8765/ws://localhost:8765(Figma 不接受 IP 字面值),server 本身只綁127.0.0.1。若 Figma 拒絕 manifest 的
id,用 New Plugin 生成新 ID 貼回plugin/manifest.json再建置。
三個入口,一個核心
入口 | 給誰 | 特性 |
| 開發者 / CI | 唯讀、 |
| 其他 agent | stdio JSON-RPC,11 個工具 |
| 設計師(DSH) | 斜線命令,零 token、直接開看板 |
三者都只做參數解析與排版;所有計算在 server/core/。npm run test:parity 會把 CLI 的 JSON 輸出與 core 逐位元比對。
設計原則
能算的就不要猜:結構用 hash、版面用規則、風格用統計。
名稱不是身份:名稱只是排序先驗與漂移訊號。
不確定就回報:
unknown是合法結果,硬分比不分更糟。來源可追溯:
verify-source確保輸出的每個 ID 都存在於樣本。產物隔離:所有暫存只進
.scratch/,labels/是來源。
驗證
npm run doctor # 環境、資料、labels、workspace
npm run test:pipeline # Phase 1 端到端(不需要 Figma)
npm run test:parity # CLI 輸出與 core 逐位元一致
npm run query -- verify-source # 每個 ID 都必須存在於樣本文件
文件 | 內容 |
對外說明:背景故事、實驗方法、技術架構 | |
分層、資料契約、模組地圖、擴充點 | |
12 條設計決定的理由與代價 | |
驗證方法:實地抽查、留一驗證、四道 gate、冷啟動 | |
凍結樣本 manifest 與 sha256(不含 sqlite) | |
命令契約與 DSH/MCP 註冊方式 | |
agent 操作規範(鐵律、流程契約、停止條件) | |
驗收門檻、變更邊界、已知缺陷 |
已知限制
沒有縮圖:複審看板用色票/型別比例/文案當視覺替代。
kNN 分類留一驗證 57%:只有全票(86%)可作建議。
pages目錄可能過期:查詢層一律從nodes.page_name聚合。語意分類需人工命名:工具給候選群,不給名字。
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Serves your design system and coding standards to coding agents, so they stop guessing.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Store, query, and update structured data from any AI agent
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes SQLite database query tools and markdown document resources over JSON-RPC 2.0 stdio transport, enabling AI assistants to read and search documents and execute read-only SQL queries.81MIT
- FlicenseNot gradedqualityDmaintenanceProvides AI agents read-only analytical access to a SQLite database over stdio, with tools for listing tables, describing schemas, and running paginated SQL queries.-
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a local SQLite-backed structural code graph for bounded, relevant context such as source entities, relationships, call paths, impact analysis, and recorded project mistakes before reading full files.24 npmMIT
- AlicenseNot gradedqualityBmaintenanceExposes three read-only tools—impact, explain, and report—so an agent can query a prebuilt local DuckDB graph of a codebase to find the transitive reverse-dependencies of a symbol or file, inspect a symbol's structural neighbourhood, and introspect the index itself. Runs over stdio or Streamable HTTP, always read-only, with no external service.61 PyPIMIT