# lanhu-design-mcp

An MCP server that reads Lanhu projects and hands your agent a design's UI structure with units matched to the target platform.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: blantian
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/blantian/lanhu-design-mcp
- Updated: 2026-07-19
- HTML: https://affpapa.org/en/nevibecode/mcp/lanhu-design-mcp

## What it does

The server talks to Lanhu and works through projects: it lists every design in one, analyses the design you pick, and returns the UI structure with sizes converted to Android dp, iOS pt, Web px or WeChat rpx. It also returns the full design plus fine-grained slices from Sketch, Figma and Photoshop, each with links for multiple densities. One tool bundles the assets and the analysis into a single context an agent can rebuild a screen from.

Login runs through a dedicated local Chrome profile. You call `lanhu-design-mcp auth login` once, finish signing in in the window that opens, and later MCP calls reuse that session without showing a browser. Cookies are not accepted any other way — no environment variables, no cookie file. Check the state with `lanhu-design-mcp auth status`; sign out with `lanhu-design-mcp auth logout --confirm`.

macOS is required, along with Google Chrome and Python 3.10 or newer. On anything else the server answers `unsupported_platform`, so Linux and Windows are out. A missing Chrome or Playwright library shows up as `dependency_missing`, which an upgrade of the package fixes. Pull signed asset URLs down into your project right away — building on those remote Lanhu links long term is a bad idea.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add lanhu-design-mcp -- uvx lanhu-design-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from lanhu-design-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add lanhu-design-mcp -- uvx lanhu-design-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from lanhu-design-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "lanhu-design-mcp": {
            "command": "uvx",
            "args": [
                "lanhu-design-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from lanhu-design-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "lanhu-design-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "lanhu-design-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from lanhu-design-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add lanhu-design-mcp uvx lanhu-design-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from lanhu-design-mcp <command>

## When to use it
- pull a Lanhu design's structure into an agent
- convert design sizes into dp, pt, px or rpx
- export fine-grained slices from a design
- gather context for rebuilding a screen from a design
- check whether the server is signed in to Lanhu

## Example prompts
- List every design in the Lanhu project
- Analyse this design and give me the structure in iOS units
- Build the UI rebuild context for this design

## Similar
- [suede-design](https://affpapa.org/en/nevibecode/skills/suede-design.md) — skill · ★ 126
- [design-brief](https://affpapa.org/en/nevibecode/skills/design-brief.md) — skill · 5300 installs
- [frontend-design](https://affpapa.org/en/nevibecode/skills/bytedance-frontend-design.md) — skill · 3700 installs
- [no-ai-design-slop](https://affpapa.org/en/nevibecode/skills/no-ai-design-slop.md) — skill · 1300 installs
- [ui-design](https://affpapa.org/en/nevibecode/skills/frappe-ui-design.md) — skill · 832 installs
- [design](https://affpapa.org/en/nevibecode/skills/subframeapp-design.md) — skill · 775 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
