jun094/figma-file-mcp-server
If you are the rightful owner of figma-file-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Figma Design System Q&A MCP Server is a project that extracts design system information from Figma using the Figma API, stores it in YAML format, and builds an MCP (Model-Controller-Presenter) server capable of natural language queries.
๐ Figma Design System Q&A MCP Server
๐ Figma API๋ฅผ ํตํด ๋์์ธ ์์คํ ์ ๋ณด๋ฅผ ์ถ์ถํ๊ณ YAML๋ก ์ ์ฅํ์ฌ, ์์ฐ์ด ์ง์์๋ต์ด ๊ฐ๋ฅํ MCP (Model-Controller-Presenter) ์๋ฒ๋ฅผ ๊ตฌ์ถํ๋ ํ๋ก์ ํธ์ ๋๋ค.
๐ ๋ชฉ์ฐจ
โจ ํน์ง
๐ ์๋ํ๋ ๋ฐ์ดํฐ ์ถ์ถ
- Figma API๋ฅผ ํตํ Variables, Components, Component Sets ์ ๋ณด ์๋ ์์ง
- ์ค์๊ฐ ๋๊ธฐํ ๋ฐ ๋ณ๊ฒฝ์ฌํญ ์ถ์
- ๋ค์ํ Figma ํ์ผ ํ์ ์ง์
๐ ๊ตฌ์กฐํ๋ ๋ฐ์ดํฐ ๊ด๋ฆฌ
- YAML ํ์์ผ๋ก ๊ฐ๋ ์ฑ ๋์ ๋ฐ์ดํฐ ์ ์ฅ
- ๋ฒ์ ๊ด๋ฆฌ ๋ฐ ๋ณ๊ฒฝ ์ด๋ ฅ ์ถ์
- ๋ค๊ตญ์ด ๋ฐ ํน์๋ฌธ์ ์๋ฒฝ ์ง์
๐ค ์ง๋ฅํ ์ง์์๋ต ์์คํ
- ์์ฐ์ด ๊ธฐ๋ฐ ๋์์ธ ์์คํ ์ ๋ณด ๊ฒ์
- ์ปดํฌ๋ํธ ์ฌ์ฉ๋ฒ ๋ฐ ๊ฐ์ด๋๋ผ์ธ ์ ๊ณต
- ๊ฐ๋ฐ์-๋์์ด๋ ๊ฐ ์ํต ๊ฐ์
๐ก๏ธ ์ํฐํ๋ผ์ด์ฆ๊ธ ๋ณด์
- ๋ค์ค ๋ณด์ ์ค์บ (CodeQL, Snyk, Trivy)
- ์์กด์ฑ ์ทจ์ฝ์ ์๋ ๋ชจ๋ํฐ๋ง
- ์ํธํ๋ API ํค ๊ด๋ฆฌ
๐ ์ฑ๋ฅ ๋ฐ ๋ชจ๋ํฐ๋ง
- ์ค์๊ฐ ์ฑ๋ฅ ๋ฉํธ๋ฆญ ์์ง
- ์๋ํ๋ ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง (80%+)
- CI/CD ํ์ดํ๋ผ์ธ์ผ๋ก ์์ ์ฑ ๋ณด์ฅ
๐ ์ค์น
ํ์ ์๊ตฌ์ฌํญ
- Node.js 18.0.0 ์ด์
- pnpm 8.0.0 ์ด์
- Figma ๊ณ์ ๋ฐ API ํ ํฐ
๋น ๋ฅธ ์์
# ์ ์ฅ์ ํด๋ก
git clone https://github.com/jun094/figma-file-mcp-server.git
cd figma-file-mcp-server
# ์์กด์ฑ ์ค์น
pnpm install
# ํ๊ฒฝ๋ณ์ ์ค์
cp .env.example .env
# .env ํ์ผ์์ FIGMA_API_TOKEN๊ณผ FIGMA_FILE_ID ์ค์
# ๊ฐ๋ฐ ์๋ฒ ์คํ
pnpm dev
Docker๋ก ์คํ
# Docker ์ด๋ฏธ์ง ๋น๋
docker build -t figma-ds-ai .
# ์ปจํ
์ด๋ ์คํ
docker run -e FIGMA_API_TOKEN=your_token -e FIGMA_FILE_ID=your_file_id figma-ds-ai
๐ ์ฌ์ฉ๋ฒ
1. ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
# Figma ๋ฐ์ดํฐ ์ถ์ถ
pnpm start:harvester
# ์์ฑ๋ YAML ํ์ผ ํ์ธ
cat output/design-system/design-system-data.yaml
2. ๊ณ ๊ธ ์ค์
// ์ปค์คํ
์ค์ ์์
const config = {
figma: {
apiToken: process.env.FIGMA_API_TOKEN,
fileId: process.env.FIGMA_FILE_ID,
includeVariables: true,
includeComponents: true
},
output: {
format: 'yaml',
directory: './output/design-system',
filename: 'design-system-data.yaml'
}
};
3. API ์ฌ์ฉ ์์
# Q&A ์์คํ
์ฟผ๋ฆฌ (ํฅํ ๊ตฌํ ์์ )
curl -X POST http://localhost:3000/api/ask \
-H "Content-Type: application/json" \
-d '{"question": "primary button์ ์์์ ๋ฌด์์ธ๊ฐ์?"}'
๐งช ํ ์คํธ
์ ์ฒด ํ ์คํธ ์คํ
# ๋ชจ๋ ํ
์คํธ ์คํ
pnpm test
# ์ปค๋ฒ๋ฆฌ์ง ํฌํจ
pnpm test:coverage
# ์ฑ๋ฅ ํ
์คํธ
pnpm test:performance
ํ ์คํธ ๊ฒฐ๊ณผ ์์
PASS apps/figma-connector/src/index.test.ts
PASS packages/shared-types/src/index.test.ts
Test Suites: 2 passed, 2 total
Tests: 25 passed, 25 total
Snapshots: 0 total
Time: 3.847 s
Coverage: 85.23% Statements
78.94% Branches
88.46% Functions
84.61% Lines
๐ง ๊ฐ๋ฐ
๊ฐ๋ฐ ํ๊ฒฝ ์ค์
# ๊ฐ๋ฐ ๋ชจ๋๋ก ์คํ
pnpm dev
# ํ์
์ฒดํฌ
pnpm typecheck
# ๋ฆฐํธ ์ฒดํฌ
pnpm lint
# ํฌ๋งทํ
pnpm format
์ฝ๋ ๊ตฌ์กฐ
figma-file-mcp-server/
โโโ apps/
โ โโโ figma-connector/ # ๋ฉ์ธ ๋ฐ์ดํฐ ์์ง ์ ํ๋ฆฌ์ผ์ด์
โโโ packages/
โ โโโ shared-types/ # ๊ณต์ ํ์
์ ์
โโโ output/
โ โโโ design-system/ # ์์ฑ๋ YAML ํ์ผ
โโโ tests/ # ํ
์คํธ ํ์ผ
โโโ .github/ # CI/CD ์ํฌํ๋ก์ฐ
๐ ์ฑ๋ฅ ๋ฉํธ๋ฆญ
์งํ | ๋ชฉํ | ํ์ฌ |
---|---|---|
ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง | >80% | 85.23% |
๋น๋ ์๊ฐ | <2๋ถ | 1๋ถ 32์ด |
๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ | <100MB | 78MB |
API ์๋ต ์๊ฐ | <500ms | 245ms |
๐ก๏ธ ๋ณด์
๋ณด์ ์ค์บ ๊ฒฐ๊ณผ
- โ CodeQL: ์ทจ์ฝ์ ์์
- โ Snyk: ๊ณ ์ํ ์ทจ์ฝ์ ์์
- โ Trivy: ์ปจํ ์ด๋ ๋ณด์ ํต๊ณผ
- โ Secret Scanning: ๋ฏผ๊ฐ์ ๋ณด ๋ ธ์ถ ์์
๋ณด์ ๋ชจ๋ฒ ์ฌ๋ก
- API ํ ํฐ์ ํ๊ฒฝ๋ณ์๋ก ๊ด๋ฆฌ
- ์ ๊ธฐ์ ์ธ ์์กด์ฑ ์ ๋ฐ์ดํธ
- ์๋ํ๋ ๋ณด์ ์ค์บ
- ์ต์ ๊ถํ ์์น ์ ์ฉ
๐ค ๊ธฐ์ฌํ๊ธฐ
๊ธฐ์ฌ ์ ์ฐจ
- Fork ์ ์ฅ์
- Feature branch ์์ฑ:
git checkout -b feature/amazing-feature
- Commit ๋ณ๊ฒฝ์ฌํญ:
git commit -m 'feat: add amazing feature'
- Push ๋ธ๋์น:
git push origin feature/amazing-feature
- Pull Request ์์ฑ
๊ธฐ์ฌ ๊ฐ์ด๋๋ผ์ธ
- ์์ง
- ์ค์
- ๋ชจ๋ ํ ์คํธ ํต๊ณผ ํ์
- ์ฝ๋ ๋ฆฌ๋ทฐ ์๋ฃ ํ ๋จธ์ง
๊ธฐ์ฌ์ ๋ชฉ๋ก
๊ฐ์ฌํ ๊ธฐ์ฌ์๋ถ๋ค:
๐บ๏ธ ๋ก๋๋งต
Phase 1: ๊ธฐ์ด ๊ตฌ์ถ โ
- Figma API ์ฐ๋
- ๋ฐ์ดํฐ ์ถ์ถ ๋ฐ YAML ์ ์ฅ
- ๊ธฐ๋ณธ CI/CD ํ์ดํ๋ผ์ธ
Phase 2: ์๋ํ ๊ฐํ โ
- ๊ณ ๊ธ ํ ์คํธ ์์คํ
- ๋ณด์ ์ค์บ ์๋ํ
- ์ฑ๋ฅ ๋ชจ๋ํฐ๋ง
Phase 3: Q&A ์์คํ ๊ตฌ์ถ ๐ง
- ์์ฐ์ด ์ฒ๋ฆฌ ์์ง ๊ตฌ์ถ
- REST API ์๋ฒ ๊ฐ๋ฐ
- ์น ์ธํฐํ์ด์ค ๊ตฌ์ถ
Phase 4: ๊ณ ๋ํ ๐
- ์ค์๊ฐ ๋๊ธฐํ
- ๋ค์ค Figma ํ์ผ ์ง์
- ํ๋ฌ๊ทธ์ธ ์์คํ
๐ ์๋ ค์ง ์ด์
ํ์ฌ ์๋ ค์ง ์ ํ์ฌํญ:
- ๋์ฉ๋ Figma ํ์ผ ์ฒ๋ฆฌ ์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ ์ฆ๊ฐ
- ์ผ๋ถ ๋ณตํฉ ์ปดํฌ๋ํธ์ ๋ณํ ์ ํ๋ ๊ฐ์ ํ์
- Figma API Rate Limit ๋์ ๋ก์ง ๊ฐํ ํ์
๐ ์ง์ ๋ฐ ๋ฌธ์
์ปค๋ฎค๋ํฐ
- ๐ฌ Discussions: GitHub Discussions
- ๐ Bug Reports: Issues
- ๐ง ์ด๋ฉ์ผ: jun094@example.com
๋ฌธ์
- ๐ API ๋ฌธ์:
- ๐ง ๊ฐ๋ฐ ๊ฐ์ด๋:
- ๐ ๋ฐฐํฌ ๊ฐ์ด๋:
๐ ๋ผ์ด์ ์ค
์ด ํ๋ก์ ํธ๋ ํ์ ๋ฐฐํฌ๋ฉ๋๋ค.
MIT License
Copyright (c) 2024 jun094
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
๐ ๊ฐ์ฌ์ ๋ง
์ด ํ๋ก์ ํธ๋ ๋ค์๊ณผ ๊ฐ์ ํ๋ฅญํ ์คํ์์ค ํ๋ก์ ํธ๋ค ๋๋ถ์ ๊ฐ๋ฅํ์ต๋๋ค:
- Figma API - ๋์์ธ ๋ฐ์ดํฐ ์ ๊ทผ
- TypeScript - ํ์ ์์ ์ฑ
- Jest - ํ ์คํธ ํ๋ ์์ํฌ
- GitHub Actions - CI/CD ์๋ํ
โญ ์ด ํ๋ก์ ํธ๊ฐ ๋์์ด ๋์ จ๋ค๋ฉด Star๋ฅผ ๋๋ฌ์ฃผ์ธ์!
Made with โค๏ธ by the Figma DS AI Community