loading…
Search for a command to run...
loading…
Enables AI to directly read and analyze Lanhu design drafts and requirement documents to generate HTML, CSS, and structural analyses. It allows users to extract
Enables AI to directly read and analyze Lanhu design drafts and requirement documents to generate HTML, CSS, and structural analyses. It allows users to extract design slices and process prototype pages directly within AI clients.
mcp-lanhu 是蓝湖的 MCP 服务器,装上之后 Cursor、Windsurf、Claude Desktop、Claude Code 都能直接连接蓝湖。AI 可以读取设计稿、提取 HTML/CSS、解析 PRD、下载切图,全程不用离开编辑器。
一行命令,零配置 —
npx -y mcp-lanhu,粘贴蓝湖链接就能用。
复制下面这段话,发给你的 AI 助手(Cursor / Claude Code / Windsurf):
帮我安装蓝湖 MCP 服务器:https://github.com/MrDgbot/lanhu-mcp
AI 会自动读取仓库说明并完成配置,你只需要提供蓝湖 Cookie。
无需 clone 代码,npx 自动安装。
Cursor / Windsurf — 编辑 .cursor/mcp.json(或 .windsurf/mcp.json):
{
"mcpServers": {
"lanhu": {
"command": "npx",
"args": ["-y", "mcp-lanhu"],
"env": { "LANHU_COOKIE": "your_cookie_here" }
}
}
}
Claude Desktop — 编辑 claude_desktop_config.json:
{
"mcpServers": {
"lanhu": {
"command": "npx",
"args": ["-y", "mcp-lanhu"],
"env": { "LANHU_COOKIE": "your_cookie_here" }
}
}
}
Claude Code:
claude mcp add lanhu -- npx -y mcp-lanhu
然后设置环境变量 LANHU_COOKIE。
Cookie 请求头配置完成后重启客户端,粘贴蓝湖链接即可使用。
lanhu_design — 设计稿通过 mode 参数切换功能:
| Mode | 说明 |
|---|---|
list |
列出项目所有设计图 |
analyze |
设计图 → HTML+CSS + Design Tokens(默认) |
tokens |
仅提取 Design Tokens(字体、颜色、阴影等) |
slices |
提取切图资源 |
analyze 模式支持 include 参数按需选择输出:html、image、tokens、layout、layers、slices。默认 ["html", "tokens"]。
Design Tokens 输出示例:
=== Design Tokens ===
Colors (12 unique):
rgba(140,140,140,1) x48
rgba(255,255,255,1) x28
rgba(51,51,51,1) x12
...
Fonts (7 unique):
Source Han Sans CN / Regular / 14px x25
PingFang SC / Bold / 10px x3
...
Shadows (3 unique):
rgba(0,81,187,0.03) 0px 0px 0px 1px x3
...
lanhu_page — PRD / 原型| Mode | 说明 |
|---|---|
list |
列出 PRD 所有页面 |
analyze |
PRD/原型 → 结构化分析(默认) |
lanhu_resolve_invite — 解析邀请链接将蓝湖分享链接解析为可用的项目 URL。
| 类型 | 名称 | 说明 |
|---|---|---|
| Resource | project-designs |
项目设计稿列表(lanhu://project/{pid}/designs?tid={tid}) |
| Prompt | frontend-dev |
根据设计稿生成像素级前端代码 |
| Prompt | design-review |
审查设计一致性和可实现性 |
| 客户端 | 支持 | 传输 |
|---|---|---|
| Cursor | ✅ | stdio |
| Windsurf | ✅ | stdio |
| Claude Desktop | ✅ | stdio |
| Claude Code | ✅ | stdio |
| 其他 MCP 兼容 IDE | ✅ | stdio |
git clone https://github.com/MrDgbot/lanhu-mcp.git && cd lanhu-mcp
npm install && cp config.example.env .env # 填入 LANHU_COOKIE
npm run dev # 开发模式
npm run build # 构建
npm test # 测试
Q: 什么是 MCP? A: Model Context Protocol,让 AI 助手安全连接外部工具的开放标准。
Q: 支持哪些蓝湖套餐? A: 任何可网页访问的蓝湖账号,通过浏览器 Cookie 认证。
Q: analyze 返回太大怎么办?
A: 用 include 参数,如 ["tokens"] 只返回 Design Tokens。默认不含 base64 图片。
Q: 不用 Cursor 也能用? A: 能。支持所有 MCP 客户端。
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"lanhu-mcp-server": {
"command": "npx",
"args": []
}
}
}