Lanhu Design Mcp

io.github.blantianPublished by GitHub account blantianv0.2.0Updated Oct 24, 2026

Read Lanhu design specs and export fine-grained UI assets with platform-adjusted units

VerifiedSTDIODesktop onlyDeveloper ToolsMedia & Design

Overview

AI-generated overview

A macOS-only MCP server that lets an assistant read Lanhu design projects, analyze specs into platform-adjusted UI structures, and export fine-grained UI assets

What you can do
List all design images in a Lanhu project and fetch their details by ID or URL, with optional filtering and pagination for large projects and multi-page designs, plus a health check that reports local configuration status without network access or exposing credentials. Analyze a design and return its UI structure adjusted for the target platform (Android dp, iOS pt, Web px, WeChat rpx). Return full design images together with fine-grained downloadable slice assets from Sketch, Figma and Photoshop, including multi-resolution URLs. Export a complete Agent UI restoration context bundling assets and analysis. Manage authentication through a dedicated managed Chrome profile: interactive login, a
When to use it
Useful when you are turning Lanhu design specs into front-end or mobile UI code and want the assistant to read the design, get platform-adjusted measurements, and pull slice assets directly. It fits macOS users who already work in Lanhu and want to avoid manually copying cookies or downloading slices by hand.
Requirements
macOS only; Google Chrome installed; Python 3.10 or later; install the lanhu-design-mcp package from PyPI and run it as a local stdio process. A Lanhu account is needed for a one-time interactive login through a dedicated local Chrome profile; no cookie environment variables or cookie files are supported. Playwright Python library and Chrome must be available.
Before you install
The first run opens a visible Chrome window for interactive Lanhu login; the managed profile is stored locally and credentials are never sent over MCP, but the profile should be logged out with confirm=true when no longer needed. Returned asset URLs are signed and temporary, so download them into the local project rather than depending on them long term. Design data is read from Lanhu's remote service, so network access is required.

Installation

In SourceWeft

  1. Open Lanhu Design Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

蓝湖设计 MCP

项目简介

面向 macOS 的蓝湖设计读取与细粒度 UI 资源导出 MCP 服务器。

功能

  • 读取蓝湖设计项目,列出所有设计图
  • 分析设计稿并返回平台调整后的 UI 结构(Android dp / iOS pt / Web px / 微信 rpx)
  • 返回完整设计图与 Sketch、Figma、Photoshop 细粒度切图资源及多倍率地址
  • 导出包含资产和分析的完整 Agent UI 还原上下文
  • 托管 Chrome Profile 自动登录,无需手动复制 Cookie

系统要求

  • macOS
  • Google Chrome(已安装)
  • Python 3.10 及以上

安装

bash
pip install lanhu-design-mcp

首次登录

bash
lanhu-design-mcp auth loginlanhu-design-mcp auth status

首次运行打开独立的本地 Chrome Profile,完成一次交互式 Lanhu 登录。后续 MCP 进程自动重用会话,正常设计工具调用不会打开可见浏览器。认证仅使用托管 Chrome Profile,不需要也不支持通过 Cookie 环境变量或 Cookie 文件配置凭据。

bash
lanhu-design-mcp auth logout --confirm

MCP 配置

json
{  "mcpServers": {    "lanhu-design-mcp": {      "type": "stdio",      "command": "/Users/your-name/.local/bin/lanhu-design-mcp",      "args": []    }  }}

将 /Users/your-name 替换为你的本机用户名。此配置适用于 cc-switch 导入。

工具

工具说明
lanhu_health_check返回本地配置状态,不访问网络且不暴露凭据
lanhu_get_designs获取项目的所有设计图列表
lanhu_analyze_design分析指定设计稿并返回平台调整后的 UI 结构
lanhu_get_design_assets返回完整设计图与细粒度可下载切图资源
lanhu_export_ui_context返回包含资产和分析的完整 Agent UI 还原上下文
lanhu_auth_login打开专属 Chrome Profile 进行交互式 Lanhu 登录
lanhu_auth_status报告托管认证状态,不含凭据
lanhu_auth_logout登出并删除托管 Profile,需要 confirm=true

使用规范

  • 调用方应将返回的签名资源 URL 下载到本地项目,不要生成对远程 Lanhu 签名 URL 的长期依赖。
  • 不得在日志、异常或 MCP 响应中记录或输出凭据信息。
  • 登出必须调用 lanhu_auth_logout 并传 confirm=true,或 CLI --confirm,仅删除托管的标记 Profile。
  • 托管 Chrome Profile 仅存在于本地;认证凭据从不通过 MCP 网络传输。

常见错误

状态说明处理
auth_required凭据无效或过期运行 lanhu-design-mcp auth login
unsupported_platform仅在 macOS 支持使用 macOS 设备
dependency_missingPlaywright Python 库或 Chrome 不可用pip install --upgrade lanhu-design-mcp
profile_locked托管 Profile 被其他进程占用等待完成后重试
cancelled登录窗口在认证完成前关闭重新运行 lanhu-design-mcp auth login
timed_out登录窗口 5 分钟内未完成认证重新运行 lanhu-design-mcp auth login

开发验证

bash
git clone https://github.com/blantian/lanhu-design-mcpcd lanhu-design-mcpuv sync --devuv run pytest

许可证

MIT

Source: README.md at commit b547d6b

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.2.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts