Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
基于 [dsphper/lanhu-mcp](https://github.com/dsphper/lanhu-mcp) 开源项目修改和扩展,添加功能与约束
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Fetched from the repository for this visit.
本项目基于 dsphper/lanhu-mcp 开源项目修改和扩展,感谢原作者 @dsphper 的出色工作。
原项目已提供完整的蓝湖 MCP 能力(需求文档分析、设计稿查看、切图提取、团队留言板等),请先前往 原项目 了解基础功能。
本仓库在此基础上新增了以下功能。
直接把下面这段话发给你的 AI 助手(Claude Code / Cursor / Windsurf 等),AI 会自动完成所有安装和配置:
请阅读 https://github.com/dj931567261/lanhu-mcp 项目中的 ai-install-guide.md 文件,
按照里面的步骤帮我安装和配置这个蓝湖 MCP 服务器。
或者如果你已经克隆了项目:
请阅读当前项目下的 ai-install-guide.md,帮我完成安装和配置。
AI 会自动:创建虚拟环境 → 安装依赖 → 引导你获取 Cookie → 配置 AI 客户端 → 安装 Skill 文件
📖 手动安装参考 AI 助手安装指南
原项目使用 HTTP SSE 方式连接(http://localhost:8000/mcp),本项目改为 stdio 方式,直接通过脚本启动,无需单独运行服务。
AI 客户端配置示例(Claude Code / Cursor / Windsurf 等):
{
"mcpServers": {
"Lanhu-mcp": {
"command": "bash",
"args": ["/path/to/lanhu-mcp/run_lanhu_mcp_stdio.sh"],
"env": {
"LANHU_MCP_USER_NAME": "YourName",
"LANHU_MCP_USER_ROLE": "Developer"
}
}
}
}
OpenAI Codex CLI 配置:
在 Codex 的配置文件 config.toml(通常位于 ~/.codex/config.toml)中添加 MCP 配置,添加后每次对话都可以直接使用蓝湖 MCP 工具。
macOS / Linux:
[mcp_servers.Lanhu-mcp]
type = "stdio"
command = "bash"
args = ["/path/to/lanhu-mcp/run_lanhu_mcp_stdio.sh"]
Windows(方式一:使用 Git Bash,推荐):
[mcp_servers.Lanhu-mcp]
type = "stdio"
command = "D:\\Git\\bin\\bash.exe"
args = ["C:/path/to/lanhu-mcp/run_lanhu_mcp_stdio.sh"]
command填 Git 安装目录下bin\\bash.exe的实际路径,args中可使用正斜杠。
Windows(方式二:使用 cmd):
[mcp_servers.Lanhu-mcp]
type = "stdio"
command = "cmd"
args = ["/c", "C:\\path\\to\\lanhu-mcp\\run_lanhu_mcp_stdio.bat"]
config.toml文件位置:macOS / Linux 为~/.codex/config.toml,Windows 为%USERPROFILE%\.codex\config.toml。
Cookie 配置:将蓝湖 Cookie 写入项目根目录的
cookie文件,或设置环境变量LANHU_COOKIE。获取方式参考 Cookie 获取教程。
⚠️ 关于链接中的
tid参数:蓝湖 URL 必须包含tid(团队 ID)和pid(项目 ID)才能正常使用。如果提示缺少tid,请在蓝湖网页上回退到首页,再依次点击团队 → 项目 → 设计稿进入,此时浏览器地址栏中的 URL 就会包含完整的tid和pid参数。
安装完成后,在 AI 对话中使用对应平台的 Skill 名称 + 蓝湖设计图链接,即可生成 UI 代码:
/lanhu-compose-plan https://lanhuapp.com/web/#/item/project/detailDetach?pid=xxx&image_id=xxx
帮我实现一下这个页面,注意复用底部的导航栏,输出到 app/src/main/java/com/example/ui/ 目录下
你可以在消息中补充任何额外要求,例如:
注意复用底部的导航栏和顶部状态栏输出到 src/pages/ 目录下这是一个底部弹窗,不是整屏页面列表数据从 ViewModel 获取,这里只写 UI不同平台使用对应的 Skill 名称:
| 命令 | 平台 |
|---|---|
/lanhu-compose-plan | Jetpack Compose |
/lanhu-xml-plan | Android XML |
/lanhu-flutter-plan | Flutter |
/lanhu-rn-plan | React Native |
/lanhu-swiftui-plan | SwiftUI |
/lanhu-vue-plan | Vue 3 |
/lanhu-html-plan | HTML + CSS |
/lanhu-uniapp-plan | uni-app |
| 功能 | 说明 |
|---|---|
| 设计标注数据(annotations) | 精确提取图层坐标、尺寸、颜色、字体、间距、圆角等 dp 级参数 |
| 布局分析 | 兄弟间距、布局方向检测、层级树、最近邻关系 |
| 设计图分组与搜索 | 按分组查看、按关键词搜索设计图 |
| Skill 代码生成(8 平台) | 配合 annotations 数据,约束 AI 生成高还原度 UI 代码 |
新增 lanhu_get_design_annotations 工具,从蓝湖设计图中提取结构化标注数据,自动转换为 dp 单位。
| 字段 | 说明 |
|---|---|
sibling_spacings | 同级元素间距 + 布局方向检测(horizontal / vertical / stack) |
layout_tree | 图层层级树结构(Figma 用 path 构建,Sketch 用几何包含推断) |
nearest_neighbors | 最近邻元素关系(已排除父子包含关系) |
text_container_paddings | 文本与容器的内边距 |
icon_text_distances | 图标与文本的距离 |
| 工具 | 说明 |
|---|---|
lanhu_get_designs_by_sector | 按分组名称查看设计图(支持精确/模糊匹配) |
lanhu_search_designs | 按关键词搜索设计图名称 |
内置 8 个平台的 Skill 文件(位于 skills/ 目录),配合 lanhu_get_design_annotations 返回的标注数据,约束 AI 生成高还原度 UI 代码。
| Skill | 输出格式 |
|---|---|
lanhu-compose-plan | Jetpack Compose |
lanhu-xml-plan | Android XML |
lanhu-flutter-plan | Flutter Dart |
lanhu-rn-plan | React Native TSX |
lanhu-swiftui-plan | SwiftUI |
lanhu-vue-plan | Vue 3 SFC |
lanhu-html-plan | HTML + CSS |
lanhu-uniapp-plan | uni-app |
将 skills/ 目录下的文件复制到 AI 客户端的 Skill 目录:
Claude Code:
cp -r skills/lanhu-*-plan ~/.claude/skills/
其他 AI 客户端参考对应的 Skill/Plugin 配置方式,将 SKILL.md 文件导入即可。
安装 Skill 后,给 AI 发送蓝湖设计图链接即可触发:
/lanhu-compose-plan https://lanhuapp.com/web/#/item/project/detailDetach?...&image_id=xxx
AI 会自动:
style.opacity 并应用到组件lanhu_get_design_slices 返回的资源,禁止手绘statusBarsPadding() 处理lanhu-mcp/
├── lanhu_mcp_server.py # MCP 服务端主文件
├── run_lanhu_mcp_stdio.sh # MCP 启动脚本(macOS / Linux)
├── run_lanhu_mcp_stdio.bat # MCP 启动脚本(Windows)
├── requirements.txt # Python 依赖
├── pyproject.toml # 项目配置
├── config.example.env # 环境变量示例
├── cookie # 蓝湖 Cookie(需自行填写,勿提交)
├── skills/ # Skill 文件
│ ├── lanhu-compose-plan/
│ ├── lanhu-xml-plan/
│ ├── lanhu-flutter-plan/
│ ├── lanhu-rn-plan/
│ ├── lanhu-swiftui-plan/
│ ├── lanhu-vue-plan/
│ ├── lanhu-html-plan/
│ └── lanhu-uniapp-plan/
├── tests/ # 测试文件
├── LICENSE
├── README.md
├── README_EN.md
├── GET-COOKIE-TUTORIAL.md # Cookie 获取教程
└── ai-install-guide.md # AI 客户端安装指南
MIT License — 详见 LICENSE
Loading reviews...
GitHub freshness not yet checked. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.