Figma ファイルをローカルキャッシュし MCP サーバーとして提供する軽量ツール
Project description
YetAnotherFigmaMCP
Figma ファイルをローカルキャッシュし、MCP (Model Context Protocol) サーバーとして提供する軽量ツール。
背景
Figma 無料プランでは API / MCP 呼び出し回数が月 6 回までに制限されています。本ツールは Figma のファイル・ノード JSON を事前取得しキャッシュすることで、この制限内で効率的にデザインデータを活用できるようにします。
特徴
- 事前キャッシュ方式: Figma API を事前に叩いて JSON をローカル保存
- 検索用インデックス: ノード名・フレーム名での高速検索
- MCP サーバー: AI エージェントからキャッシュデータを参照可能
- API 呼び出し最小化: キャッシュ生成時と明示的リフレッシュ時のみ API 使用
インストール
pip install yet-another-figma-mcp
または uvx / pipx でも利用可能:
uvx yet-another-figma-mcp --help
pipx install yet-another-figma-mcp
セットアップ
Figma API トークンの設定
環境変数に Figma API トークンを設定:
export FIGMA_API_TOKEN="your-figma-api-token"
トークンは Figma の設定画面 から取得できます。
使い方
キャッシュの生成
# 単一ファイルのキャッシュ生成
yet-another-figma-mcp cache --file-id <FILE_ID>
# 複数ファイル
yet-another-figma-mcp cache --file-id <ID1> --file-id <ID2>
# ファイル ID リストから一括生成
yet-another-figma-mcp cache --file-id-list path/to/file_ids.txt
# 強制リフレッシュ(API を再度呼び出し)
yet-another-figma-mcp cache --file-id <FILE_ID> --refresh
MCP サーバーの起動
# MCP サーバー起動
yet-another-figma-mcp serve
# 動作確認
yet-another-figma-mcp status
Claude Desktop での設定
claude_desktop_config.json に以下を追加:
{
"mcpServers": {
"figma-cache": {
"command": "uvx",
"args": ["yet-another-figma-mcp", "serve"]
}
}
}
MCP ツール一覧
MCP サーバーは以下のツールを提供します:
get_cached_figma_file
指定ファイルのノードツリーやメタデータを取得。
引数:
- file_id: string (必須)
返り値:
- ルートノードと主要フレーム一覧
- ファイル全体のメタデータ
get_cached_figma_node
単一ノードの詳細情報を取得。
引数:
- file_id: string (必須)
- node_id: string (必須)
返り値:
- ノードのプロパティ(type, name, layout, style, children など)
search_figma_nodes_by_name
ノード名でノードを検索。
引数:
- file_id: string (必須)
- name: string (必須)
- match_mode: "exact" | "partial" (オプション、デフォルト: exact)
- limit: number (オプション)
返り値:
- マッチしたノードのリスト
search_figma_frames_by_title
フレーム名からフレームノードを検索。
引数:
- file_id: string (必須)
- title: string (必須)
- match_mode: "exact" | "partial" (オプション)
- limit: number (オプション)
返り値:
- 対象フレームノードの一覧
list_figma_frames
ファイル直下の主要フレーム一覧を取得。
引数:
- file_id: string (必須)
返り値:
- フレーム名・node_id・パスのリスト
キャッシュファイルの構造
~/.yet_another_figma_mcp/
index.json # 全ファイル共通のメタ情報
<file_id>/
file_raw.json # Figma API /files の生 JSON
nodes_index.json # ノード検索用インデックス
ユースケース例
画面実装の参照
ユーザー: 「サインアップ画面を実装してください」
→ AI: search_figma_frames_by_title で「Sign Up」を検索
→ AI: get_cached_figma_node でフレーム構造を取得
→ AI: 取得したデザイン情報をもとにコード生成
コンポーネントの特定
ユーザー: 「Primary Button のスタイルを教えて」
→ AI: search_figma_nodes_by_name で検索
→ AI: get_cached_figma_node で詳細取得
制限事項
本ツールは PoC(Proof of Concept)として以下の機能はスコープ外としています:
- スクリーンショット取得
- Code Connect(ノード⇔コンポーネント対応)
- 変数・デザイントークンの取得
- FigJam 対応
開発
# 開発用依存関係をインストール
uv sync --group dev
# リント
uv run ruff check .
# フォーマット
uv run ruff format .
# 型チェック
uv run pyright
# テスト
uv run pytest
ライセンス
MIT License - 詳細は LICENSE を参照してください。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yet_another_figma_mcp-0.1.2.tar.gz.
File metadata
- Download URL: yet_another_figma_mcp-0.1.2.tar.gz
- Upload date:
- Size: 86.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ea101c8e6c36aebaf89724ef09af702139a25c0d3b1d265b60076393b6ed8d6
|
|
| MD5 |
6c38ab728d1f0d11f6c81359b1d2f82a
|
|
| BLAKE2b-256 |
0341146b07c2eeeeae3d8116df46a02f81903f9e49e61b553f32f844d20dd685
|
Provenance
The following attestation bundles were made for yet_another_figma_mcp-0.1.2.tar.gz:
Publisher:
release-please.yml on yk-lab/yet-another-figma-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yet_another_figma_mcp-0.1.2.tar.gz -
Subject digest:
5ea101c8e6c36aebaf89724ef09af702139a25c0d3b1d265b60076393b6ed8d6 - Sigstore transparency entry: 732101039
- Sigstore integration time:
-
Permalink:
yk-lab/yet-another-figma-mcp@1526e1ba822e42da09fe9cd1b345474f4fe05e46 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yk-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@1526e1ba822e42da09fe9cd1b345474f4fe05e46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file yet_another_figma_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: yet_another_figma_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c83589c71c632c48b90abf500c4d174b5cd45758558fb6364adadff1968bb9
|
|
| MD5 |
81641273efdc179d6b4002a31ac75e47
|
|
| BLAKE2b-256 |
fb400d45835185423af8494e6e6763657b6efb2004f2240ea37b7bf3e578710a
|
Provenance
The following attestation bundles were made for yet_another_figma_mcp-0.1.2-py3-none-any.whl:
Publisher:
release-please.yml on yk-lab/yet-another-figma-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yet_another_figma_mcp-0.1.2-py3-none-any.whl -
Subject digest:
65c83589c71c632c48b90abf500c4d174b5cd45758558fb6364adadff1968bb9 - Sigstore transparency entry: 732101043
- Sigstore integration time:
-
Permalink:
yk-lab/yet-another-figma-mcp@1526e1ba822e42da09fe9cd1b345474f4fe05e46 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/yk-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@1526e1ba822e42da09fe9cd1b345474f4fe05e46 -
Trigger Event:
push
-
Statement type: