moonvy-ui-mcp
Moonvy UI MCP
フロントエンド開発向けの Moonvy(月维)デザイン稿読み取り MCP。プロジェクトページまたはデザインファイルの URL を入力すると、ページ一覧、フレームサイズ、レイヤーツリー、ノードスタイル、デザイントークン、および書き出し/スナップショット/画像フィルなどのリソースを取得できます。
本プロジェクトは lanhu-mcp のツール境界を参考にしていますが、データ読み取りは Moonvy 向けです。Moonvy のデザインデータファイル(Genome)から正確なパラメータを抽出するため、スクリーンショットから色・フォントサイズ・間隔を推測するのではありません。
できること
MCP ツール | 用途 |
| プロジェクト、ディレクトリ、デザインファイル ID を解析 |
| プロジェクト/ディレクトリからデザインファイルを一覧表示。フォルダ URL のみの場合は先にこれを呼び出す |
| タイトル、フレーム ID、フレーム幅高、Genome バージョンを取得 |
| フラット化されたレイヤーインデックス。名前でノード ID を検索するために使用 |
| 単一ノードのサイズ、相対座標、マージン、塗り、テキスト、角丸、ストローク、シャドウ、CSS を取得 |
| UI パラメータ付きのネストされたレイヤーツリーを取得 |
| 色、グラデーション、フォント、フォントサイズ、フォントウェイト、行高、角丸、シャドウ、推測された間隔を抽出 |
| メタデータ、トークン、スタイル付きレイヤーツリーを一度に返す。開発時はこれを優先して使用することを推奨 |
| 書き出し、スナップショット、画像フィル、またはトップレベルファイルのプレビューをダウンロード |
| デザイン稿更新後にメモリキャッシュをクリア |
moonvy_get_node_style と moonvy_get_ui_spec は以下を返します:
絶対位置、および親ノードに対する
relativeX/relativeY親ノードの右端・下端までの距離
幅高、可視性、不透明度、クリップ状態
単色、グラデーション、画像フィルの参照
フォント、フォントサイズ、フォントウェイト、行高、文字間隔、文字色、配置
角丸、ストローク、シャドウ
そのまま参照できる CSS プロパティオブジェクト
Related MCP server: figma-mcp-server
データフロー
Moonvy URL
-> projectId / dirId / fileId
-> POST https://global-api.moonvy.com/v2/anynode/get
-> files.genome.url
-> 下载并解压 Genome JSON
-> 解析图层、样式、Token、资源
-> MCP JSON 响应プロジェクト/ディレクトリの一覧は POST /v2/anynode/list を使用します。これらは Moonvy Web が現在使用している非公開インターフェースであり、将来 Moonvy がインターフェースや Genome 構造を変更した場合は、アダプタ層を同期して更新する必要があります。
インストール
Node.js 20 以降が必要です。
cd C:\path\to\moonvy-ui-mcp
npm install
Copy-Item .env.example .envMoonvy ログイントークンの設定
ブラウザで Moonvy にログインし、読み取りたい Moonvy ページを開きます。
開発者ツールの Console を開きます。
以下を実行します:
copy(window.app?.api?.$options?.token)コピーした値を本プロジェクトの
.envに書き込みます:
MOONVY_TOKEN=你的本机令牌トークンはローカルのみに保存し、チャットに送信したり、Git にコミットしたり、フロントエンドコードに書き込んだりしないでください。サービスレスポンスは JWT とクエリパラメータ付きのリソース URL を自動的に隠します。
セルフチェック
npm run check
npm test
npm startnpm start は stdio MCP サービスです。通常時は通常のログを出力せず、MCP クライアントの接続を待機します。
Codex / ChatGPT デスクトップアプリへの接続
設定で MCP servers -> Add server を選択し、タイプは STDIO を選択します:
Command:
nodeArguments:
C:\path\to\moonvy-ui-mcp\src\server.jsWorking directory:
C:\path\to\moonvy-ui-mcp
また、以下を ~/.codex/config.toml または信頼できるプロジェクト内の .codex/config.toml に追加することもできます:
[mcp_servers.moonvy]
command = "node"
args = ["C:/path/to/moonvy-ui-mcp/src/server.js"]
cwd = "C:/path/to/moonvy-ui-mcp"
startup_timeout_sec = 20
tool_timeout_sec = 180サービスはデフォルトで cwd 配下の .env から MOONVY_TOKEN を読み取ります。ローカルマシンの環境変数から転送したい場合は、以下も追加できます:
env_vars = ["MOONVY_TOKEN"]保存後、Codex/デスクトップアプリを再起動し、入力ボックスで /mcp を使用して接続を確認します。
Cursor / Windsurf / Claude Code への接続
標準の stdio MCP 設定を使用します:
{
"mcpServers": {
"moonvy": {
"command": "node",
"args": ["C:/path/to/moonvy-ui-mcp/src/server.js"],
"cwd": "C:/path/to/moonvy-ui-mcp"
}
}
}現在の Moonvy リンクでの使用順序
現在のリンク:
https://moonvy.com/project/89f75621-a0e7-4122-b9ee-b6b703e1c826/cf67c54c-8e2b-4809-9e4d-fc6512d0e0beこれには projectId + dirId が含まれており、特定のデザインファイルではなくフォルダを指しているため、以下を推奨します:
moonvy_list_pagesを呼び出してファイル一覧を取得します。返された結果から具体的なデザイン URL を選択します。
moonvy_get_designを呼び出してフレーム一覧を確認します。対象フレームに対して
moonvy_get_ui_specを呼び出し、最初はmaxDepth=4、maxNodes=500を使用します。特定の要素を正確に確認する必要がある場合は、まず
moonvy_list_layersでノード ID を探し、次にmoonvy_get_node_styleを呼び出します。アイコン、背景画像、ページスナップショットは
moonvy_download_assetで実際のフロントエンドプロジェクトのリソースディレクトリにダウンロードします。
プロンプトの例:
使用 Moonvy MCP 列出这个项目目录里的设计文件。找到“新增学生”页面后,
读取它的 UI spec,保留原始颜色、字号、间距和圆角,并把需要的切图下载到
C:/work/school-web/src/assets/moonvy。lanhu-mcp との対応関係
lanhu-mcp の考え方 | 本プロジェクトの実装 |
デザイン一覧を取得 |
|
デザイン図のパラメータを分析 |
|
書き出しを取得 |
|
Cookie/JWT でログイン権限を再利用 |
|
デザインデータをキャッシュ | プロセス内 Genome TTL キャッシュ |
モデルコンテキストを制御 |
|
現在のバージョンは「デザイン稿 -> フロントエンド実装」に特化しており、藍湖プロジェクトの要件ドキュメント分析、チーム掲示板、飛書コラボレーション機能は複製していません。
セキュリティと制限
元々アクセス権限のある Moonvy プロジェクトのみを使用してください。
.envは.gitignoreに追加済みです。それでもトークンを手動でコミットしないようにしてください。moonvy_download_assetは絶対出力ディレクトリを要求し、リソースが不明確な場所に誤って書き込まれるのを防ぎます。Moonvy トークンが期限切れになった場合は再取得が必要です。
本プロジェクトはログイン、プロジェクト権限、または Moonvy サーバー側のアクセス制御を迂回しません。
Genome 内のデザインツールバージョンによってフィールドが完全に一致しない場合があります。パーサーは一般的な互換フィールドを保持していますが、実際のチームのデザイン稿でエンドツーエンドの受け入れテストを行うことを推奨します。
開発とテスト
ユニットテストは合成 Genome を使用するため、Moonvy の認証情報は不要です:
npm test実プロジェクトのエンドツーエンドテストには有効な MOONVY_TOKEN が必要です:
1. moonvy_list_pages(文件夹 URL)
2. moonvy_get_design(设计文件 URL)
3. moonvy_get_ui_spec(设计文件 URL)
4. moonvy_get_node_style(设计文件 URL, 节点 ID)Available Tools
10 toolsmoonvy_clear_cacheClear Moonvy genome cacheA
Clear the in-memory genome cache after a design has changed and must be fetched again.
Inputs: no named parameters.
moonvy_download_assetDownload Moonvy assetA
Download a design slice, snapshot, image fill, or top-level file/preview into an absolute local output directory.
Inputs: url (required), nodeId (required), outputDir (required), type, +2 more.
moonvy_extract_tokensExtract Moonvy design tokensB
Extract reusable colors, gradients, fonts, text metrics, radii, inferred padding/gaps, and shadows from a design.
Inputs: url (required).
moonvy_get_designGet Moonvy design metadataA
Return the design title, genome version, frame IDs, frame dimensions, and child counts for a Moonvy design URL.
Inputs: url (required).
moonvy_get_node_styleGet exact Moonvy node styleA
Return one node’s size, coordinates, distances to parent edges, fills, typography, borders, radius, effects, opacity, visibility, and directly usable CSS declarations.
Inputs: url (required), nodeId (required).
moonvy_get_treeGet Moonvy layer treeA
Return the nested design layer tree. Styles include exact UI values and CSS. Limit depth and node count to keep model context compact.
Inputs: url (required), frameId, maxDepth, maxNodes, +2 more.
moonvy_get_ui_specGet frontend-ready Moonvy UI specA
Recommended development tool: return design metadata, inferred design tokens, and a styled component tree in one response. Use frameId/maxDepth/maxNodes to control context size.
Inputs: url (required), frameId, maxDepth, maxNodes, +1 more.
moonvy_list_layersList Moonvy layersA
Return a flat layer index with node IDs, names, types, depth, absolute bounds, and parent-relative positions. Use it to find a node ID before requesting exact style.
Inputs: url (required), frameId, maxNodes, includeHidden.
moonvy_list_pagesList Moonvy project pagesA
List folders and design files below a Moonvy project or directory URL. Call this first when only a project URL is known.
Inputs: url (required), limit, maxApiPages.
moonvy_parse_urlParse Moonvy URLA
Validate a Moonvy URL and return project, directory, and file IDs. Does not require authentication.
Inputs: url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 10 tools
Each tool has a distinct responsibility: URL parsing, listing pages, fetching design metadata, layer indexing, node style extraction, tree traversal, token extraction, full spec generation, asset download, and cache management. No two tools overlap in purpose, making misselection unlikely.
All tools follow a consistent 'moonvy_verb_noun' pattern using snake_case (e.g., moonvy_list_pages, moonvy_get_node_style). The prefix uniformly identifies the server, and verbs are action-oriented with descriptive nouns, creating a predictable and readable API surface.
With 10 tools, the server covers the core workflow of navigating Moonvy designs, extracting styles, tokens, specs, and assets without excess. The count is well-scoped for its purpose—neither too sparse nor bloated.
The tool surface covers the full design-to-code pipeline: parse URLs, navigate hierarchy, retrieve detailed node styles, extract tokens, generate UI specs, and download assets. A minor gap is the lack of tools for editing or creating designs, but given the read-focused nature of this server, the existing set is comprehensive and leaves no dead ends for typical usage.
Maintenance
Related MCP Connectors
Access and maintain design system docs, tokens, components, skills, and contexts across any project.
Turn any live website into brand colors, fonts, design tokens, SVGs, Lottie and paste-ready code.
Visual builder for React Native and Expo apps. Read and update project design tokens.
Search 700+ design layers and fetch the build prompt for HTML, Next.js, React, Vue and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Figma files through intelligent API access, providing navigation, asset extraction, and design token retrieval with 95% token-optimized compact tree output format.151MIT
- AlicenseNot gradedqualityDmaintenanceEnables developers to extract and organize Figma design files, including complete node data (tree structure and images) for AI understanding and code generation.MIT
- AlicenseNot gradedqualityDmaintenanceEnables seamless integration with Figma API for extracting design tokens, generating production-ready code in multiple frameworks, capturing screenshots, and managing design assets directly from Figma.5MIT
- AlicenseAqualityCmaintenanceProvides AI coding agents with structured access to Lanhu design data, enabling direct inspection of artboards, extraction of pixel-perfect layer styles and CSS attributes, and downloading of design assets without vision token overhead.9MIT