
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
lanhu-developer-mcp
Advanced tools
为CursorIDE提供访问蓝湖设计文件的能力,通过Model Context Protocol服务器实现。
当Cursor能够访问蓝湖设计数据时,它在一次性准确实现设计方面比其他方法(如粘贴截图)要优秀得多。
快速开始,详情请参阅配置:
npx lanhu-developer-mcp
这个MCP服务器专为Cursor设计。在响应来自蓝湖API的请求之前,它会简化并转换响应,只提供最相关的布局和样式信息给模型。
减少提供给模型的上下文量有助于使AI更准确,响应更相关。
你可以使用NPM快速运行服务器,无需安装或构建仓库:
npx lanhu-developer-mcp
# 或
pnpx lanhu-developer-mcp
关于如何获取蓝湖用户Token的说明可以在这里找到。
许多工具如Windsurf、Cline和Claude Desktop使用配置文件来启动服务器。
lanhu-developer-mcp
服务器可以通过在配置文件中添加以下内容来配置:
{
"mcpServers": {
"lanhu-developer-mcp": {
"command": "npx",
"args": ["-y", "lanhu-developer-mcp", "--stdio"],
"env": {
"LANHU_TOKEN": "<your-lanhu-token>"
}
}
}
}
服务器可以使用环境变量(通过.env
文件)或命令行参数进行配置。建议优先使用.env文件配置。
LANHU_TOKEN
:你的蓝湖用户Token(必需)PORT
:运行服务器的端口(默认:3333)--token
:你的蓝湖用户Token--port
:运行服务器的端口> npx lanhu-developer-mcp
# 在端口3333上以HTTP模式初始化蓝湖MCP服务器...
# HTTP服务器监听端口3333
# SSE端点可用于http://localhost:3333/sse
# 消息端点可用于http://localhost:3333/messages
一旦服务器运行,将Cursor连接到MCP服务器,在Cursor的设置中,在功能选项卡下。
服务器连接后,你可以在开始之前确认Cursor的连接是否有效。如果你看到绿点并且工具显示出来,那么你就可以开始了!
一旦MCP服务器连接,你可以开始在Cursor的编辑器中使用工具,只要编辑器处于代理模式。
在编辑器中放置蓝湖文件的链接并要求Cursor对其进行操作应该会自动触发get_lanhu_data
工具。
大多数蓝湖文件最终都很大,所以你可能想链接到文件中的特定设计稿。你可以从蓝湖设计稿页面复制链接:
一旦你有了特定设计稿的链接,你可以将其放在编辑器中并要求Cursor对其进行操作。
服务器提供以下MCP工具:
获取有关蓝湖设计稿的信息。
参数:
project_id
(字符串,必需):要获取的蓝湖项目ID,通常在URL中找到,如lanhuapp.com/web/#/item/project/detailDetach?project_id=<project_id>&...
image_id
(字符串,必需):要获取的设计稿ID,通常在URL中找到,如lanhuapp.com/web/#/item/project/detailDetach?image_id=<image_id>&...
服务器提供以下主要功能特性:
蓝湖MCP服务器能够自动从设计稿中提取和下载所有图片资源,并保存到本地src/assets/LanHuImgFile
目录。系统会自动:
系统会自动检测当前项目是否为Taro项目(通过检查package.json中的依赖),并提供以下特性:
对于内容过长的设计稿(常见于复杂页面),系统会:
src/assets/LanHuPageFile.json
文件FAQs
Model Context Protocol server for Lanhu integration
The npm package lanhu-developer-mcp receives a total of 18 weekly downloads. As such, lanhu-developer-mcp popularity was classified as not popular.
We found that lanhu-developer-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.