Lanhu MCP Server logo

Lanhu MCP Server

Community
MrDgbot

蓝湖(lanhu) MCP 非浏览器 干净简洁

PublisherMrDgbot
Repositorylanhu-mcp
LanguageTypeScript
Forks
12
Stars
131
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Lanhu MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    131 stars and 12 forks from the linked repository.

🎨 蓝湖 MCP Server

让 AI 编程助手直接读取蓝湖设计稿、提取代码、解析需求文档

npm version npm downloads MIT License Node.js

English


这是什么

mcp-lanhu 是蓝湖的 MCP 服务器,装上之后 Cursor、Windsurf、Claude Desktop、Claude Code 都能直接连接蓝湖。AI 可以读取设计稿、提取 HTML/CSS、解析 PRD、下载切图,全程不用离开编辑器。

一行命令,零配置 — npx -y mcp-lanhu,粘贴蓝湖链接就能用。

核心能力

  • 设计稿 → 代码:生成像素级 HTML + CSS,含完整 Design Tokens(颜色、字体、阴影、渐变)
  • 结构化 Design Tokens:提取所有颜色、字体族/字号/字重、阴影、边框、圆角,按使用频率排序
  • PRD 驱动开发:将 PRD 或 Axure 原型交给 AI,需求感知编码
  • 自动切图:直接从蓝湖提取切图、图标和图片,无需手动导出
  • 并发 + 重试:多设计稿并行分析,网络异常自动重试
  • MCP Resources & Prompts:内置前端开发和设计走查 Prompt 模板

安装

最快方式:让 AI 帮你装

复制下面这段话,发给你的 AI 助手(Cursor / Claude Code / Windsurf):

帮我安装蓝湖 MCP 服务器:https://github.com/MrDgbot/lanhu-mcp

AI 会自动读取仓库说明并完成配置,你只需要提供蓝湖 Cookie。


手动配置

无需 clone 代码,npx 自动安装。

Cursor / Windsurf — 编辑 .cursor/mcp.json(或 .windsurf/mcp.json):

json
{
  "mcpServers": {
    "lanhu": {
      "command": "npx",
      "args": ["-y", "mcp-lanhu"],
      "env": { "LANHU_COOKIE": "your_cookie_here" }
    }
  }
}

Claude Desktop — 编辑 claude_desktop_config.json:

json
{
  "mcpServers": {
    "lanhu": {
      "command": "npx",
      "args": ["-y", "mcp-lanhu"],
      "env": { "LANHU_COOKIE": "your_cookie_here" }
    }
  }
}

Claude Code:

bash
claude mcp add lanhu -- npx -y mcp-lanhu

然后设置环境变量 LANHU_COOKIE。

获取 Cookie

  1. 登录 蓝湖
  2. F12 打开开发者工具 → Network 标签
  3. 复制任意请求的 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", "layers", "image"]。请求 layers 时可用 layer_depth 控制嵌套深度:默认 4,0 仅返回顶层,"all" 返回完整图层树。每个设计会按请求项返回 success、partial_success 或 error,结构化图层标注位于 layer_annotations。

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 所有页面
analyzePRD/原型 → 结构化分析(默认)

lanhu_resolve_invite — 解析邀请链接

将蓝湖分享链接解析为可用的项目 URL。


MCP Resources & Prompts

类型名称说明
Resourceproject-designs项目设计稿列表(lanhu://project/{pid}/designs?tid={tid})
Promptfrontend-dev根据设计稿生成像素级前端代码
Promptdesign-review审查设计一致性和可实现性

使用场景

  • 前端开发:粘贴蓝湖链接 → AI 生成与设计稿匹配的组件代码
  • 设计走查:对比实现与 Design Tokens(间距、颜色、字体)
  • 需求实现:将 PRD 交给 AI,需求驱动的功能开发
  • 资源导出:批量提取图标和图片

兼容性

客户端支持传输
Cursor✅stdio
Windsurf✅stdio
Claude Desktop✅stdio
Claude Code✅stdio
其他 MCP 兼容 IDE✅stdio

开发

bash
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       # 测试

FAQ

Q: 什么是 MCP? A: Model Context Protocol,让 AI 助手安全连接外部工具的开放标准。

Q: 支持哪些蓝湖套餐? A: 任何可网页访问的蓝湖账号,通过浏览器 Cookie 认证。

Q: analyze 返回太大怎么办? A: 用 include 参数,如 ["tokens"] 只返回 Design Tokens;不需要 base64 图片时请不要包含 image。

Q: 不用 Cursor 也能用? A: 能。支持所有 MCP 客户端。


License

MIT © MrDgbot

Installation

TypingMind
{
  "mcpServers": {
    "lanhu-mcp": {
      "command": "python",
      "args": [
        "lanhu_mcp_server.py"
      ]
    }
  }
}

Use Lanhu MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Lanhu MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Lanhu MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Lanhu MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "lanhu-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Lanhu MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Lanhu MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Lanhu MCP Server to help me with this task?
Lanhu MCP Server
Sure. I read it.
Here is what I found using Lanhu MCP Server.

Option 2: Add an MCP server URL

Use this when Lanhu MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for Lanhu MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Lanhu MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Lanhu MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Lanhu MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Lanhu MCP Server to help me with this task?
Lanhu MCP Server
Sure. I read it.
Here is what I found using Lanhu MCP Server.

Frequently asked questions

What is the Lanhu MCP Server MCP server used for?

Lanhu MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Lanhu MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Lanhu MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Lanhu MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Lanhu MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Lanhu MCP Server MCP to TypingMind?

Lanhu MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Lanhu MCP Server MCP provide in TypingMind?

Lanhu MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Lanhu MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Lanhu MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇