Content
```html
<div align="center">
# 🎨 Lanhu MCP Server
**Share team knowledge with all AI assistants and break the AI IDE island**
**lanhumcp | lanhu-mcp | Lanhu AI Integration**
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://modelcontextprotocol.io/)
[](https://github.com/jlowin/fastmcp)
[](CONTRIBUTING.md)
[](https://github.com/dsphper/lanhu-mcp/stargazers)
[](https://github.com/dsphper/lanhu-mcp/issues)
[](https://github.com/dsphper/lanhu-mcp/releases)
[](CODE_OF_CONDUCT.md)
[English](README_EN.md) | 简体中文
[Quick Start](#-quick-start) • [Features](#-key-features) • [Documentation](#-usage-guide) • [Contribution Guide](CONTRIBUTING.md)
</div>
---
## 🌟 Project Highlights
A powerful [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server designed for the AI programming era, perfectly supporting the Lanhu design collaboration platform.
🔥 **Core Innovations**:
- 📋 **Intelligent Requirement Analysis**: Automatically extracts Axure prototypes with three analysis modes (development/testing/exploration), achieving >95% accuracy in requirement analysis.
- 💬 **Team Knowledge Base**: Breaks the AI IDE island, allowing all AI assistants to share the knowledge base and context.
- 🎨 **UI Design Support**: Automatically downloads design drafts, intelligently extracts slices, and provides semantic naming.
- ⚡ **Performance Optimization**: Intelligent version-based caching, incremental updates, and concurrent processing.
🎯 **Applicable Scenarios**:
- ✅ Cursor + Lanhu: Allows Cursor AI to directly read Lanhu requirement documents and design drafts.
- ✅ Windsurf + Lanhu: Allows Windsurf Cascade AI to directly read Lanhu requirement documents and design drafts.
- ✅ Claude Code + Lanhu: Allows Claude AI to directly read Lanhu requirement documents and design drafts.
- ✅ Trae + Lanhu: Allows Trae AI to directly read Lanhu requirement documents and design drafts.
- ✅ 通义灵码 + Lanhu: 通义灵码 AI 直接读取蓝湖需求文档和设计稿
- ✅ Cline + Lanhu: Cline AI directly reads Lanhu requirement documents and design drafts.
- ✅ Any AI development tool that supports the MCP protocol.
🎯 **Solves Pain Points**:
- ❌ **Old World**: Each developer's AI works independently, repeatedly analyzing requirements and unable to share experiences.
- ✅ **New World**: All AIs connect to the same knowledge hub, analyzing requirements once and reusing them by everyone, with permanently saved experience from pitfalls.
---
## 📑 Table of Contents
- [Key Features](#-key-features)
- [Quick Start](#-quick-start)
- [Team Bulletin Board: Breaking the Last Mile of AI Collaboration](#-team-bulletin-board-breaking-the-last-mile-of-ai-collaboration)
- [Usage Guide](#-usage-guide)
- [Available Tools](#-available-tools)
- [System Architecture](#-system-architecture)
- [Project Structure](#-project-structure)
- [Advanced Configuration](#-advanced-configuration)
- [Performance Metrics](#-performance-metrics)
- [FAQ](#-faq)
- [Security Notes](#-security-notes)
- [Contribution Guide](#-contribution-guide)
- [License](#-license)
- [Acknowledgements](#-acknowledgements)
- [Contact](#-contact)
- [Roadmap](#-roadmap)
---
## ✨ Key Features
### 📋 Requirement Document Analysis
- **Intelligent Document Extraction**: Automatically downloads and parses all pages, resources, and interactions of Axure prototypes.
- **Three Analysis Modes**:
- 🔧 **Development Perspective**: Detailed field rules, business logic, and global flowcharts.
- 🧪 **Testing Perspective**: Test scenarios, use cases, boundary values, and validation rules.
- 🚀 **Quick Exploration**: Core function overview, module dependencies, and review points.
- **Four-Stage Workflow**: Global scanning → Group analysis → Reverse verification → Deliverable generation.
- **Zero-Omission Guarantee**: Systematized analysis process driven by TODOs.
### 🎨 UI Design Support
- **Design Draft Viewing**: Batch download and display of UI design drawings.
- **Slice Extraction**: Automatically identifies and exports design slices and icon resources.
- **Intelligent Naming**: Automatically generates semantic filenames based on layer paths.
### 💬 Team Collaboration Bulletin Board - Breaking the AI IDE Island
> 🌟 **Core Innovation**: Allows each developer's AI assistant to share team knowledge and context.
**Problem Background**:
- Each developer's AI IDE (Cursor, Windsurf) is independent and cannot share context.
- Pitfalls encountered by developer A are unknown to developer B's AI.
- Requirement analysis results cannot be passed to the testing team's AI.
- Team knowledge is fragmented across various chat windows and cannot be accumulated.
**Innovative Solution**:
- 🔗 **Unified Knowledge Base**: All AI assistants connect to the same MCP server, sharing bulletin board data.
- 🧠 **Context Passing**: The requirements analyzed by the development AI can be directly queried and used by the testing AI.
- 💡 **Knowledge Accumulation**: Pitfalls, experiences, and best practices are permanently saved as "knowledge base" entries.
- 📋 **Task Collaboration**: Use "task" type messages to have AI help query code and databases.
- 📨 **@Mention Mechanism**: Supports Feishu notifications, connecting AI collaboration with human communication.
- 👥 **Collaboration Tracking**: Automatically records which AI has accessed which documents, ensuring team transparency.
### ⚡ Performance Optimization
- **Intelligent Caching**: Permanent caching mechanism based on document version numbers.
- **Incremental Updates**: Only downloads changed resources.
- **Concurrent Processing**: Supports batch page screenshots and resource downloads.
## 🚀 Quick Start
> ⚠️ **Important: You must use an AI model that supports visual functions!**
>
> This project requires the AI model to have **image recognition and analysis capabilities**. It is recommended to use the following mainstream visual models in 2026:
> - 🤖 **Claude** (Anthropic)
> - 🌟 **GPT** (OpenAI)
> - 💎 **Gemini** (Google)
> - 🚀 **Kimi** (Moonshot AI)
> - 🎯 **Qwen** (Alibaba)
> - 🧠 **DeepSeek** (DeepSeek AI)
>
> Pure text models (such as GPT-3.5, Claude Instant, etc.) are not supported.
---
> 💡 **Newbie user?** Just tell AI "Help me clone and install the https://github.com/dsphper/lanhu-mcp project", and AI will guide you through all the steps!
### Method 1: Let AI Help You Install (Recommended)
Directly say to AI in Cursor:
```
"Help me clone and install the https://github.com/dsphper/lanhu-mcp project"
```
AI will automatically complete: Cloning the project → Installing dependencies → Guiding to obtain Cookie → Configuring and starting the service
📖 Reference Documents: [AI Installation Guide](ai-install-guide.md) • [Cookie Acquisition Tutorial](GET-COOKIE-TUTORIAL.md)
---
### Method 2: Manual Installation
**2.1 Docker Deployment (Recommended)**
Advantages: Environment isolation, one-click deployment, easy management
```bash
# 1. Clone the project
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
# 2. Configure the environment (will guide you to enter Cookie)
bash setup-env.sh # Linux/Mac
# Or
setup-env.bat # Windows
# 3. Start the service
docker-compose up -d
```
> 💡 `setup-env.sh` will interactively guide you to obtain and configure the Lanhu Cookie, and automatically generate the `.env` file
📖 Detailed Documentation: [Docker Deployment Guide](DEPLOY.md)
**2.2 Source Code Execution**
Prerequisites: Python 3.10+
```bash
# 1. Clone the project
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
# 2. One-click installation (recommended, will guide you to configure Cookie)
bash easy-install.sh # Linux/Mac
# Or
easy-install.bat # Windows
```
> 💡 `easy-install.sh` will automatically install dependencies, guide you to obtain Cookie and configure the environment
<details>
<summary>Or install manually (not recommended)</summary>
```bash
# Install dependencies
pip install -r requirements.txt
playwright install chromium
# Manual configuration (see "Configuration" section below)
```
</details>
### Configuration (Required for Source Code Execution)
1. **Set Lanhu Cookie** (Required)
```bash
export LANHU_COOKIE="your_lanhu_cookie_here"
```
> 💡 Get Cookie: Log in to the Lanhu web version, open the browser developer tools, and copy the Cookie from the request header
2. **Configure Feishu Robot** (Optional)
**Method 1: Environment Variables (Recommended, Supports Docker)**
```bash
export FEISHU_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"
```
**Method 2: Modify Code**
In `lanhu_mcp_server.py`, modify:
```python
DEFAULT_FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"
```
3. **Configure User Information Mapping** (Optional)
Update the `FEISHU_USER_ID_MAP` dictionary to support the @mention feature.
4. **Other Environment Variables** (Optional)
```bash
# Server configuration
export SERVER_HOST="0.0.0.0" # Server listening address
export SERVER_PORT=8000 # Server port
# Data storage
export DATA_DIR="./data" # Data storage directory
# Performance tuning
export HTTP_TIMEOUT=30 # HTTP request timeout (seconds)
export VIEWPORT_WIDTH=1920 # Browser viewport width
export VIEWPORT_HEIGHT=1080 # Browser viewport height
# Debug options
export DEBUG="false" # Debug mode (true/false)
```
> 📝 For complete environment variable descriptions, please refer to the `config.example.env` file
### Run the Service
**Source Code Execution:**
```bash
python lanhu_mcp_server.py
```
**Docker Execution:**
```bash
docker-compose up -d # Start
docker-compose logs -f # View logs
docker-compose down # Stop
```
The server will start at `http://localhost:8000/mcp`
### Connect to AI Client
Configure in an MCP-supporting AI client (such as Claude Code, Cursor, Windsurf):
**Cursor Configuration Example:**
```json
{
"mcpServers": {
"lanhu": {
"url": "http://localhost:8000/mcp?role=test&name=123"
}
}
}
```
> 📌 URL Parameter Description:
> - `role`: User role (backend/frontend/testing/product, etc.)
> - `name`: User name (for collaboration tracking and @mentions)
## 🎯 Team Bulletin Board: Breaking the Last Mile of AI Collaboration
### Why Do We Need a Team Bulletin Board?
In the AI programming era, every developer has their own AI assistant (Cursor, Windsurf, Claude Code). But this brings a **serious problem**:
```
🤔 Pain Point Scenario:
┌─────────────────────────────────────────────┐
│ Backend Xiao Wang's AI: │
│ "I have analyzed the requirements for the │
│ login interface, and the field validation │
│ rules are very clear. Starting to write │
│ code..." │
└─────────────────────────────────────────────┘
❌ Context Break
┌─────────────────────────────────────────────┐
│ Testing Xiao Li's AI: │
│ "What? Login interface? Let me look at the │
│ requirement document again... What do │
│ these field rules mean? How to test the │
│ boundary values?" │
└─────────────────────────────────────────────┘
```
**Each AI is repeating work and cannot reuse the analysis results of other AIs!**
### How Does the Team Bulletin Board Solve This?
**Design Concept: Connect All AI Assistants to the Same "Brain"**
```
┌─────────────────────────────┐
│ Lanhu MCP Server │
│ (Unified Knowledge Hub) │
│ │
│ 📊 Requirement Analysis Results │
│ 🐛 Development Pitfall Records │
│ 📋 Test Case Templates │
│ 💡 Technical Decision Documents │
└──────────┬──────────────────┘
│
┌────────────┼────────────┐
│ │ │
┌────▼───┐ ┌───▼────┐ ┌──▼─────┐
│Backend AI │ │Frontend AI │ │Testing AI │
│(Xiao Wang)│ │(Xiao Zhang)│ │(Xiao Li) │
└────────┘ └────────┘ └────────┘
Cursor Windsurf Claude
```
### Core Usage Scenarios
#### Scenario 1: Sharing Requirement Analysis Results
**After the backend AI (Xiao Wang) analyzes the requirements:**
```
@Testing Xiao Li @Frontend Xiao Zhang I have analyzed the "User Login" requirements, key information:
- Mobile phone number is required, 11 digits
- Password is 6-20 characters, must contain letters + numbers
- Verification code is 4 digits, valid for 5 minutes
- 3 incorrect attempts lock for 30 minutes
[Message Type: knowledge]
```
**When the testing AI (Xiao Li) queries:**
```
AI: Query all knowledge base messages about "login"
→ Immediately get the analysis results of Xiao Wang's AI, no need to look at the requirements again!
```
#### Scenario 2: Development Pitfall Records
**Backend AI (Xiao Wang) encounters a pitfall:**
```
[Knowledge Base] Redis connection timeout issue resolved
Problem: Frequent Redis timeouts in the production environment
Reason: Improper connection pool configuration, maxIdle set too small
Solution: Adjusted to maxTotal=20, maxIdle=10
[Message Type: knowledge]
```
**Other development AIs encounter the same problem:**
```
AI: Search for knowledge base related to "Redis timeout"
→ Find the solution and avoid repeating the same pitfalls!
```
#### Scenario 3: Cross-Role Task Collaboration
**Product AI initiates a query task:**
```
@Backend Xiao Wang Please help me check how many test data entries are in the user table in the database?
[Message Type: task] // ⚠️ Security Restriction: Can only query, cannot modify
```
**Backend AI (Xiao Wang) sees the notification:**
```
AI: Someone @mentioned me, view details
→ Execute SELECT COUNT(*) FROM user WHERE status='test'
→ Reply to the message: There are 1234 test data entries
```
#### Scenario 4: Emergency Issue Broadcast
**Operations AI discovers a production issue:**
```
🚨 Urgent: Payment interface exception in the production environment, please investigate immediately!
Time: 2026-01-15 14:30
Phenomenon: Payment success rate dropped from 99% to 60%
Impact: Approximately 200 orders affected
@Everyone
[Message Type: urgent]
→ Automatically send Feishu notifications to everyone
```
### Message Type Design
| Type | Purpose | Search Strategy | Lifecycle |
|------|------|----------|----------|
| 📢 **normal** | General notification | Decays over time | Archived after 7 days |
| 📋 **task** | Query task (security restriction: read-only) | Archived after completion | Task lifecycle |
| ❓ **question** | Question that needs to be answered | Pinned until answered | Archived after answering |
| 🚨 **urgent** | Urgent notification | Forced push | Downgraded after 24 hours |
| 💡 **knowledge** | **Knowledge Base (core)** | **Permanently searchable** | **Permanently saved** |
### Security Mechanism
**Security Restrictions for Task Type (task):**
```python
✅ Allowed Query Operations:
- Query code location, code logic
- Query database table structure, data
- Query test methods, coverage
- Query TODOs, comments
❌ Prohibited Dangerous Operations:
- Modify code
- Delete files
- Execute commands
- Commit code
```
### Search and Filtering
**Intelligent Search (Prevent Context Overflow):**
```python
# Scenario 1: Query all test-related knowledge bases
lanhu_say_list(
url='all', # Global search
filter_type='knowledge',
search_regex='测试|test|单元测试',
limit=20
)
# Scenario 2: Query urgent messages for a project
lanhu_say_list(
url='项目URL',
filter_type='urgent',
limit=10
)
```
# Scene 3: Find Unresolved Issues
```python
lanhu_say_list(
url='all',
filter_type='question',
search_regex='待解决|pending'
)
```
### Collaborator Tracking
**Automatically record team member access history:**
```python
lanhu_get_members(url='项目URL')
返回结果:
{
"collaborators": [
{
"name": "小王",
"role": "后端",
"first_seen": "2026-01-10 09:00:00",
"last_seen": "2026-01-15 16:30:00"
},
{
"name": "小李",
"role": "测试",
"first_seen": "2026-01-12 10:00:00",
"last_seen": "2026-01-15 14:00:00"
}
]
}
💡 用途:
- 了解哪些同事的 AI 看过这个需求
- 发现潜在的协作伙伴
- 团队透明化
```
### Feishu Notification Integration
**Connect AI collaboration with human communication:**
```python
# AI automatically sends Feishu notifications (when @someone)
lanhu_say(
url='项目URL',
summary='需要你帮忙review代码',
content='登录模块的密码加密逻辑,麻烦看一下',
mentions=['小王', '小张'] # 必须是真实姓名
)
# 飞书群收到:
┌──────────────────────────────────┐
│ 📢 蓝湖协作通知 │
│ │
│ 👤 发布者:小李(测试) │
│ 📨 提醒:@小王 @小张 │
│ 🏷️ 类型:normal │
│ 📁 项目:用户中心改版 │
│ 📄 文档:登录注册模块 │
│ │
│ 📝 内容: │
│ 登录模块的密码加密逻辑,麻烦看一下 │
│ │
│ 🔗 查看需求文档 │
└──────────────────────────────────┘
```
### Technical Advantages
1. **Zero learning cost**: AI automatically processes, developers only need natural dialogue
2. **Real-time synchronization**: All AI assistants are connected to the same data source
3. **Global search**: Cross-project query knowledge base
4. **Version association**: Comments are automatically associated with document version numbers
5. **Complete metadata**: Automatically record 10 standard fields such as project, document, author, etc.
6. **Intelligent filtering**: Supports regular expression search, type filtering, and quantity limits (to prevent token overflow)
---
## 📖 Usage Guide
### Requirements Document Analysis Workflow
**1. Get the page list**
```
请帮我看看这个需求文档:
https://lanhuapp.com/web/#/item/project/product?tid=xxx&pid=xxx&docId=xxx
```
**2. AI automatically performs four-stage analysis**
- ✅ STAGE 1: Global text scanning to establish overall cognition
- ✅ STAGE 2: Group detailed analysis (based on the selected mode)
- ✅ STAGE 3: Reverse verification to ensure zero omissions
- ✅ STAGE 4: Generate delivery documents (requirements document/test plan/review PPT)
**3. Get deliverables**
- Development perspective: Detailed requirements document + global business process diagram
- Testing perspective: Test plan + test case list + field verification table
- Quick exploration: Review document + module dependency diagram + discussion points
### UI Design Draft View
```
请帮我看看这个设计稿:
https://lanhuapp.com/web/#/item/project/stage?tid=xxx&pid=xxx
```
### Image Asset Download
```
帮我下载"首页设计"的所有切图
```
AI will automatically:
1. Detect project type (React/Vue/Flutter, etc.)
2. Select the appropriate output directory
3. Generate semantic file names
4. Batch download image assets
### Team Comments
**Post a comment:**
```
@张三 @李四 这个登录页面的密码校验规则需要确认一下
```
**View comments:**
```
查看所有 @我的消息
```
**Filter query:**
```
查看所有关于"测试"的知识库类型留言
```
## 🛠️ Available Tool List
| Tool Name | Function Description | Usage Scenario |
|---------|---------|---------|
| `lanhu_resolve_invite_link` | Resolve invitation link | When the user provides a sharing link |
| `lanhu_get_pages` | Get prototype page list | Must be called before analyzing requirements documents |
| `lanhu_get_ai_analyze_page_result` | Analyze prototype page content | Extract requirement details |
| `lanhu_get_designs` | Get UI design list | Must be called before viewing design drafts |
| `lanhu_get_ai_analyze_design_result` | Analyze UI design | View design drafts |
| `lanhu_get_design_slices` | Get image asset information | Download icons, materials |
| `lanhu_say` | Post a comment | Team collaboration, @reminder |
| `lanhu_say_list` | View comment list | Query historical messages |
| `lanhu_say_detail` | View comment details | View complete content |
| `lanhu_say_edit` | Edit comment | Modify published messages |
| `lanhu_say_delete` | Delete comment | Remove message |
| `lanhu_get_members` | View collaborators | View team members |
## 🏗️ System Architecture
```
┌─────────────────────────────────────────────────────────────────┐
│ AI 客户端层 │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Cursor │ │ Windsurf │ │ Claude │ │ ... │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │ │
│ └─────────────┴──────────────┴─────────────┘ │
└───────────────────────────┬─────────────────────────────────────┘
│ MCP Protocol (HTTP)
│
┌───────────────────────────▼─────────────────────────────────────┐
│ Lanhu MCP Server │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ FastMCP 服务框架 │ │
│ │ ┌──────────┐ ┌──────────┐ ┌───────────────────┐ │ │
│ │ │ Tool API │ │ Resource │ │ Context Provider │ │ │
│ │ └────┬─────┘ └────┬─────┘ └─────────┬─────────┘ │ │
│ └───────┼─────────────┼──────────────────┼─────────────┘ │
│ │ │ │ │
│ ┌───────▼─────────────▼──────────────────▼─────────────┐ │
│ │ 核心业务逻辑层 │ │
│ │ │ │
│ │ ┌─────────────────┐ ┌──────────────────────────┐ │ │
│ │ │ 需求文档分析 │ │ 团队协作留言板 │ │ │
│ │ │ │ │ │ │ │
│ │ │ • 页面提取 │ │ • 消息存储管理 │ │ │
│ │ │ • 内容分析 │ │ • 类型分类(5种) │ │ │
│ │ │ • 智能缓存 │ │ • @提醒功能 │ │ │
│ │ │ • 三种模式 │ │ • 搜索筛选 │ │ │
│ │ └────────┬────────┘ └──────────┬───────────────┘ │ │
│ │ │ │ │ │
│ │ ┌────────▼──────────┐ ┌───────▼──────────────┐ │ │
│ │ │ UI设计支持 │ │ 协作者追踪 │ │ │
│ │ │ │ │ │ │ │
│ │ │ • 设计图下载 │ │ • 访问记录 │ │ │
│ │ │ • 切图提取 │ │ • 团队透明 │ │ │
│ │ │ • 智能命名 │ │ • 元数据关联 │ │ │
│ │ └───────────────────┘ └──────────────────────┘ │ │
│ └──────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ 数据存储层 │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌──────────────┐ │ │
│ │ │ 留言数据 │ │ 资源缓存 │ │ 截图缓存 │ │ │
│ │ │ (JSON) │ │ (Files) │ │ (PNG) │ │ │
│ │ └─────────────┘ └─────────────┘ └──────────────┘ │ │
│ └────────────────────────────────────────────────────────┘ │
└────────────────┬─────────────────────┬────────────────────────┘
│ │
│ │ 飞书通知
│ ▼
│ ┌─────────────────┐
│ │ Feishu Webhook │
│ └─────────────────┘
│
│ HTTP/JSON API
▼
┌─────────────────────────────────────────────────────────────────┐
│ 蓝湖平台 API │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │
│ │ 文档元数据 │ │ Axure资源 │ │ UI设计图&切图 │ │
│ └──────────────┘ └──────────────┘ └──────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
```
### Data Flow Diagram
```
用户请求 → AI客户端 → MCP协议
↓
Tool调用
↓
┌─────────┴─────────┐
│ │
检查缓存 提取元数据
│ │
命中? 关联版本号
│ │
是/否 记录协作者
│ │
├─是→返回缓存 │
│ │
└─否→调用蓝湖API ←──┘
↓
下载资源
↓
处理转换
↓
保存缓存
↓
返回结果
↓
AI客户端展示
```
## 📁 Project Structure
```
lanhu-mcp-server/
├── lanhu_mcp_server.py # 主服务器文件(3800+ 行)
├── requirements.txt # Python 依赖
├── Dockerfile # Docker 镜像
├── docker-compose.yml # Docker Compose 配置
├── config.example.env # 配置文件示例
├── quickstart.sh # Linux/Mac 快速启动脚本
├── quickstart.bat # Windows 快速启动脚本
├── .gitignore # Git 忽略文件
├── LICENSE # MIT 许可证
├── README.md # 中文文档(本文件)
├── README_EN.md # 英文文档
├── CONTRIBUTING.md # 贡献指南
├── CHANGELOG.md # 更新日志
├── data/ # 数据存储目录(自动创建)
│ ├── messages/ # 留言数据(JSON文件)
│ │ └── {project_id}.json # 每个项目一个文件
│ ├── axure_extract_*/ # Axure 资源缓存
│ │ ├── *.html # 页面HTML
│ │ ├── data/ # Axure数据文件
│ │ ├── resources/ # CSS/JS资源
│ │ ├── images/ # 图片资源
│ │ └── .lanhu_cache.json # 缓存元数据
│ └── lanhu_designs/ # 设计稿缓存
│ └── {project_id}/ # 按项目分类
└── logs/ # 日志文件(自动创建)
└── *.log # 运行日志
```
## 🔧 Advanced Configuration
### Custom Role Mapping
Modify `ROLE_MAPPING_RULES` in the code to support more roles:
```python
ROLE_MAPPING_RULES = [
(["后端", "backend", "server"], "后端"),
(["前端", "frontend", "web"], "前端"),
# 添加更多规则...
]
```
### Cache Control
The cache directory is controlled by the environment variable `DATA_DIR`:
```bash
export DATA_DIR="/path/to/cache"
```
### Feishu Notification Customization
Customize the message format and style in the `send_feishu_notification()` function.
## 🤖 AI Assistant Integration
This project is designed for AI assistants, with a built-in "ErGou" assistant persona:
- 🎯 **Professional Analysis**: Automatically identify document types and optimal analysis modes
- 📋 **TODO Driven**: Task list-based systematic workflow
- 🗣️ **Chinese Interaction**: Professional Chinese dialogue experience
- ✨ **Automated Service**: No manual operation required, AI automatically completes the entire process
- 🔍 **Detailed and Rigorous**: Focus on accuracy and quality, providing high-quality technical analysis
- 📝 **Code Quality**: Follow strict code standards to avoid common issues with AI-generated code
## 📊 Performance Metrics
- ⚡ Page Screenshot: ~2 seconds/page (with cache)
- 💾 Resource Download: Supports breakpoint resume and incremental updates
- 🔄 Cache Hit: Version number-based permanent cache
- 📦 Batch Processing: Supports concurrent download and analysis
## 🐛 Common Issues
<details>
<summary><b>Q: What if the Cookie expires?</b></summary>
A: Log in to the Lanhu web version again, get the new Cookie, and update the environment variables or configuration file.
</details>
<details>
<summary><b>Q: Screenshot failed or shows blank?</b></summary>
A: Make sure Playwright browser is installed:
```bash
playwright install chromium
```
</details>
<details>
<summary><b>Q: Feishu notification failed to send?</b></summary>
A: Check:
1. Whether the Webhook URL is correct
2. Whether the Feishu robot has been added to the group
3. Whether the User ID mapping is configured correctly
</details>
<details>
<summary><b>Q: How to clear the cache?</b></summary>
A: Delete the corresponding cache file in the `data/` directory. The system will automatically download it again.
</details>
## 🔒 Security Notes
- ⚠️ **Cookie Security**: Do not submit configuration files containing Cookies to public repositories
- 🔐 **Access Control**: It is recommended to deploy in the internal network environment or configure firewall rules
- 📝 **Data Privacy**: Comment data is stored locally, please keep it safe
## 🤝 Contribution Guide
Contributions are welcome! Please follow these steps:
1. Fork this repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
### Development Guide
```bash
# Install development dependencies
pip install -r requirements.txt
# Run tests
python -m pytest tests/
# Code formatting
black lanhu_mcp_server.py
```
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🙏 Acknowledgements
### Open Source Projects
- [FastMCP](https://github.com/jlowin/fastmcp) - Excellent MCP server framework
- [Playwright](https://playwright.dev/) - Reliable browser automation tool
- [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) - HTML parsing tool
- [HTTPx](https://www.python-httpx.org/) - Modern asynchronous HTTP client
### Service Platforms
- [蓝湖](https://lanhuapp.com/) - Provides a high-quality design collaboration platform
- [飞书](https://www.feishu.cn/) - Provides enterprise collaboration and robot notifications
### Contributors
Thanks to all the developers who contributed to this project!
<!-- ALL-CONTRIBUTORS-LIST:START -->
<!-- 这里将自动生成贡献者列表 -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
### Special Thanks
- All contributors who submitted Issues and PRs
- All teams that use it in production and provide feedback
- All friends who helped improve the documentation
## 📮 Contact Information
- Submit Issue: [GitHub Issues](https://github.com/dsphper/lanhu-mcp/issues)
- Email: dsphper@gmail.com
## 🗺️ Roadmap
- [ ] Support more design platforms (Figma, Sketch)
- [ ] Web management interface
- [ ] More analysis dimensions (front-end and back-end man-hour estimation, technology stack recommendation)
- [ ] Support enterprise-level permission management
- [ ] API documentation auto-generation
- [ ] Internationalization support
---
<p align="center">
If this project helps you, please give it a ⭐️
</p>
<p align="center">
Made with ❤️ by the Lanhu MCP Team
</p>
---
## Star History
[](https://www.star-history.com/#dsphper/lanhu-mcp&type=date&legend=top-left)
---
## 🏷️ Tags Tags
`lanhumcp` `蓝湖mcp` `lanhu-mcp` `蓝湖AI` `lanhu-ai` `mcp-server` `cursor-plugin` `windsurf-integration` `claude-integration` `axure-automation` `requirement-analysis` `design-collaboration` `ai-development-tools` `model-context-protocol` `蓝湖插件` `蓝湖API` `AI需求分析` `设计协作` `前端开发工具` `后端开发工具`
---
## 🔍 FAQ Search
- **How to let Cursor AI read Lanhu requirement documents?** → Use Lanhu MCP Server
- **How does Windsurf connect to Lanhu?** → Configure this MCP server
- **How does Claude Code analyze Axure prototypes?** → Integrated through Lanhu MCP
- **Does Lanhu have an API?** → This project provides MCP protocol interface
- **How to automatically extract Lanhu slices?** → Use the slice tool of this project
- **How does AI automatically generate test cases?** → Use the test analysis mode
- **How to integrate Lanhu with Cursor?** → Install Lanhu MCP Server
- **Lanhu API for AI tools?** → Use this MCP server
- **Automated Axure analysis?** → Use this project
## 🔍 SEO Keywords Index
**中文关键词**: 蓝湖mcp | lanhumcp | 蓝湖AI | 蓝湖插件 | 蓝湖API | 蓝湖Cursor | 蓝湖Windsurf | 蓝湖Claude | 蓝湖需求文档 | 蓝湖Axure | 蓝湖切图 | 蓝湖设计稿 | AI需求分析 | AI测试用例 | MCP服务器 | 模型上下文协议
**English Keywords**: lanhu mcp | lanhu-mcp | lanhu ai | lanhu cursor | lanhu windsurf | lanhu claude | lanhu api | lanhu integration | mcp server | model context protocol | axure automation | design collaboration | requirement analysis | ai development tools
**适用人群**: 产品经理 | 前端开发 | 后端开发 | 测试工程师 | UI设计师 | 使用Cursor的开发者 | 使用Windsurf的开发者 | 使用Claude的开发者 | AI编程爱好者
---
## ⚠️ Disclaimer
This project (Lanhu MCP Server) is a **third-party open source project** independently developed and maintained by community developers and is **not an official Lanhu product**.
**Important notes:**
- This project has no official affiliation or partnership with Lanhu Company
- This project interacts with the Lanhu platform through public web interfaces and does not involve any unauthorized access
- Using this project requires you to have a legitimate Lanhu account and access rights
- Please abide by the Lanhu platform's terms of service and usage policies
- This project is for learning and research purposes only, and users are responsible for the risks of using it
- The developer is not responsible for any data loss, account problems or other losses caused by using this project
**Data and privacy:**
- This project processes and caches data locally and does not transmit your data to third-party servers
- Your Lanhu Cookies and project data are only stored in your local environment
- Please keep your credentials safe and do not share them with others
**Open source agreement:**
- This project is licensed under the MIT open source license and is provided "as is" without any warranty of any kind
- See the [LICENSE](LICENSE) file for details
If you have any questions or suggestions, please feel free to communicate with us via [GitHub Issues](https://github.com/dsphper/lanhu-mcp/issues).
<!-- Last checked: 2026-02-15 05:17 -->
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...