moonvy-ui-mcp
This server is a Moonvy design-reading MCP that extracts precise UI specs, tokens, and assets from Moonvy design URLs for frontend development.
Parse URLs:
moonvy_parse_urlextracts project, directory, and file IDs from a Moonvy URL.List files and pages:
moonvy_list_pageslists folders/design files below a project/directory URL.Get design metadata:
moonvy_get_designreturns title, frame IDs, dimensions, and genome version.List layers:
moonvy_list_layersprovides a flat layer index with node IDs, names, bounds, and positions for finding specific nodes.Get exact node styles:
moonvy_get_node_stylereturns precise CSS-ready properties (size, coordinates, fills, typography, borders, radius, effects, etc.) for a single node.Get layer tree:
moonvy_get_treereturns a nested tree with optional styling, controlled by depth and node limits.Extract design tokens:
moonvy_extract_tokenscollects reusable colors, gradients, fonts, text metrics, radii, shadows, and inferred spacing.Get full UI spec:
moonvy_get_ui_speccombines metadata, tokens, and a styled tree in one call — recommended for development.Download assets:
moonvy_download_assetdownloads slices, snapshots, image fills, or file previews to an absolute local directory.Clear cache:
moonvy_clear_cacheinvalidates the in-memory genome cache after design updates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@moonvy-ui-mcp Get the UI spec for the login page and download its assets."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Moonvy UI MCP
An MCP for reading Moonvy design files, built for front-end development. Enter a project page or design file URL to get the page list, frame dimensions, layer tree, node styles, design tokens, and slice/snapshot/image-fill assets.
This project references the tool boundaries of lanhu-mcp, but reads data specifically from Moonvy: it extracts precise parameters from Moonvy's design data file (Genome) instead of guessing colors, font sizes, and spacing from screenshots.
What it can do
MCP tool | Purpose |
| Parse project, directory, and design file IDs |
| List design files from a project/directory; call it first when you only have a folder URL |
| Get the title, frame IDs, frame width/height, and Genome version |
| Flattened layer index for finding node IDs by name |
| Get a single node's dimensions, relative coordinates, margins, fills, text, corner radius, strokes, shadows, and CSS |
| Get a nested layer tree with UI parameters |
| Extract colors, gradients, fonts, font sizes, font weights, line heights, corner radii, shadows, and inferred spacing |
| Returns metadata, tokens, and a styled layer tree in one call; recommended first for development |
| Download slices, snapshots, image fills, or top-level file previews |
| Clear the in-memory cache after a design is updated |
moonvy_get_node_style and moonvy_get_ui_spec provide:
Absolute position, plus
relativeX/relativeYrelative to the parent nodeDistance to the parent node's right and bottom edges
Width/height, visibility, opacity, and clipping state
Solid color, gradient, and image fill references
Font family, font size, font weight, line height, letter spacing, text color, and alignment
Corner radius, strokes, and shadows
A CSS property object you can reference directly
Related MCP server: figma-mcp-server
Data pipeline
Moonvy URL
-> projectId / dirId / fileId
-> POST https://global-api.moonvy.com/v2/anynode/get
-> files.genome.url
-> 下载并解压 Genome JSON
-> 解析图层、样式、Token、资源
-> MCP JSON 响应Project/directory listing uses POST /v2/anynode/list. These are non-public endpoints currently used by the Moonvy web app. If Moonvy changes its endpoints or the Genome structure in the future, the adapter layer will need to be updated accordingly.
Installation
Requires Node.js 20 or higher.
cd C:\path\to\moonvy-ui-mcp
npm install
Copy-Item .env.example .envConfigure the Moonvy login token
Log in to Moonvy in your browser and open the Moonvy page you need to read.
Open the developer tools Console.
Run:
copy(window.app?.api?.$options?.token)Write the copied value into this project's
.env:
MOONVY_TOKEN=你的本机令牌The token is stored only on your local machine. Don't send it to chat, commit it to Git, or write it into front-end code. The service responses proactively hide JWTs and resource URLs with query parameters.
Self-check
npm run check
npm test
npm startnpm start runs the stdio MCP service. Under normal conditions it won't print ordinary logs and will wait for an MCP client to connect.
Connecting to Codex / ChatGPT desktop app
In Settings, choose MCP servers -> Add server and select STDIO as the type:
Command:
nodeArguments:
C:\path\to\moonvy-ui-mcp\src\server.jsWorking directory:
C:\path\to\moonvy-ui-mcp
You can also add the following to ~/.codex/config.toml or to .codex/config.toml inside a trusted project:
[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 = 180The service reads MOONVY_TOKEN from .env under cwd by default. If you'd rather forward it from a local environment variable, you can also add:
env_vars = ["MOONVY_TOKEN"]After saving, restart Codex/the desktop app and use /mcp in the input box to check the connection.
Connecting to Cursor / Windsurf / Claude Code
Use the standard stdio MCP configuration:
{
"mcpServers": {
"moonvy": {
"command": "node",
"args": ["C:/path/to/moonvy-ui-mcp/src/server.js"],
"cwd": "C:/path/to/moonvy-ui-mcp"
}
}
}Usage order for the current Moonvy link
Current link:
https://moonvy.com/project/89f75621-a0e7-4122-b9ee-b6b703e1c826/cf67c54c-8e2b-4809-9e4d-fc6512d0e0beIt contains projectId + dirId and points to a folder rather than a specific design file, so the recommended flow is:
Call
moonvy_list_pagesto get the file list.Pick the specific design URL from the returned results.
Call
moonvy_get_designto view the frame list.Call
moonvy_get_ui_specon the target frame, starting withmaxDepth=4andmaxNodes=500.If you need to inspect a specific element precisely, first use
moonvy_list_layersto find the node ID, then callmoonvy_get_node_style.Use
moonvy_download_assetto download icons, background images, or page snapshots into the actual front-end project's asset directory.
Example prompt:
使用 Moonvy MCP 列出这个项目目录里的设计文件。找到“新增学生”页面后,
读取它的 UI spec,保留原始颜色、字号、间距和圆角,并把需要的切图下载到
C:/work/school-web/src/assets/moonvy。Correspondence with lanhu-mcp
lanhu-mcp concept | This project's implementation |
Get design list |
|
Analyze design parameters |
|
Get slices |
|
Reuse login permissions via Cookie/JWT |
|
Cache design data | In-process Genome TTL cache |
Control model context |
|
The current version focuses on "design -> front-end implementation" and does not replicate Lanhu's requirement-document analysis, team message board, or Feishu collaboration features.
Security and limitations
Only use Moonvy projects you already have permission to access.
.envis already in.gitignore; still, avoid committing the token manually.moonvy_download_assetrequires an absolute output directory to prevent assets from being written to an unclear location by accident.You'll need to re-fetch the Moonvy token once it expires.
This project does not bypass login, project permissions, or Moonvy server-side access controls.
Fields in the Genome may not be fully consistent across different design tool versions; the parser keeps common compatibility fields, but we still recommend running an end-to-end acceptance test with your team's actual design files.
Development and testing
Unit tests use synthetic Genome data and don't require Moonvy credentials:
npm testEnd-to-end testing against a real project requires a valid 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.
Loading tool schema changelog…
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.
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