lanhumcp | lanhu-mcp | Lanhu AI Integration | MCP Server for Lanhu
A powerful Model Context Protocol (MCP) server for automatically extracting and analyzing Lanhu design documents, including Axure prototypes, UI designs, image slices, with built-in team collaboration message board.
Perfect integration with:
International Mainstream AI IDEs: - ✅ Cursor - Cursor AI directly reads Lanhu requirements and designs - ✅ Windsurf - Windsurf Cascade AI directly reads Lanhu documents - ✅ Claude Desktop - Claude AI desktop app directly accesses Lanhu - ✅ Continue - VSCode/JetBrains AI coding assistant - ✅ Cline - Powerful VSCode AI programming plugin - ✅ GitHub Copilot Workspace - GitHub AI development environment
Chinese AI IDEs & Coding Assistants: - ✅ ByteDance Trae - China's first AI-native IDE (Doubao-1.5-pro) - ✅ Alibaba Tongyi Lingma - AI assistant based on Tongyi model - ✅ Tencent CodeBuddy - Full-cycle AI integrated workbench - ✅ Baidu Wenxin Kuaima - Baidu AI coding assistant - ✅ Kuaishou KwaiCoder - Kuaishou AI programming tool - ✅ Zhipu CodeGeeX - Tsinghua-based AI coding assistant - ✅ Huawei Cloud CodeArts Snap - Huawei Cloud AI assistant - ✅ SenseTime SenseCode - SenseTime AI programming tool
Any MCP-compatible AI development tools
English | 简体中文
🔍 SEO Keywords: lanhu mcp | lanhumcp | lanhu-mcp-server | lanhu ai | lanhu cursor | lanhu windsurf | lanhu claude | lanhu trae | lanhu tongyi | lanhu codebuddy | lanhu cline | lanhu continue | lanhu api | lanhu integration | lanhu axure | mcp server | model context protocol | ai requirement analysis | design collaboration tool | bytedance ai coding | alibaba ai coding | tencent ai coding | baidu ai coding
Perfect for: Product Managers | Frontend Developers | Backend Developers | QA Engineers | UI Designers | Cursor Users | Windsurf Users | Claude Users | Trae Users | Tongyi Lingma Users | CodeBuddy Users | Wenxin Kuaima Users | Cline Users | Continue Users | AI Coding Enthusiasts
🌟 Core Innovation: Enable all developers' AI assistants to share team knowledge and context
Problem Background: - Each developer's AI IDE (Cursor, Windsurf) is isolated, cannot share context - Pitfall encountered by Developer A is unknown to Developer B's AI - Requirement analysis results cannot be passed to Tester's AI - Team knowledge is fragmented across chat windows, cannot be accumulated
Innovative Solution: - 🔗 Unified Knowledge Base: All AI assistants connect to the same MCP server, sharing message board data - 🧠 Context Transfer: Requirements analyzed by Developer's AI can be directly queried by Tester's AI - 💡 Knowledge Accumulation: Pitfalls, experiences, best practices saved permanently as "Knowledge Base" type - 📋 Task Collaboration: Use "Task" type messages to let AI help query code and database - 📨 @Mention Mechanism: Support Feishu notifications, bridging AI collaboration and human communication - 👥 Collaborator Tracking: Auto-record which team member's AI accessed which documents, full transparency
⚠️ IMPORTANT: Vision-Capable AI Model Required!
This project requires AI models with image recognition and analysis capabilities. Recommended 2025 mainstream vision models: - 🤖 Claude (Anthropic) - 🌟 GPT (OpenAI) - 💎 Gemini (Google) - 🚀 Kimi (Moonshot AI) - 🎯 Qwen (Alibaba) - 🧠 DeepSeek (DeepSeek)
Text-only models (e.g., GPT-3.5, Claude Instant) are NOT supported.
# Clone the repository
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
# Install dependencies
pip install -r requirements.txt
# Or use uv (recommended)
uv pip install -r requirements.txt
export LANHU_COOKIE="your_lanhu_cookie_here"
💡 Get Cookie: Log in to Lanhu web version, open browser developer tools, and copy Cookie from request headers
Method 1: Environment Variable (Recommended, Docker-friendly)
export FEISHU_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"
Method 2: Modify Code
Modify in lanhu_mcp_server.py:
DEFAULT_FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"
Update FEISHU_USER_ID_MAP dictionary to support @mention feature.
# Server Configuration
export SERVER_HOST="0.0.0.0" # Server listen 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 documentation, see
config.example.env
Method 1: Direct Run
python lanhu_mcp_server.py
Server will start at http://localhost:8000/mcp.
Method 2: Docker Deployment
docker build -t lanhu-mcp-server .
docker run -p 8000:8000 \
-e LANHU_COOKIE="your_cookie" \
-e FEISHU_WEBHOOK_URL="your_feishu_webhook_url" \
-v $(pwd)/data:/app/data \
lanhu-mcp-server
Or use docker-compose:
# Edit environment variables in docker-compose.yml
docker-compose up -d
Configure in MCP-compatible AI clients (e.g., Claude Code, Cursor, Windsurf):
Cursor Configuration Example:
{
"mcpServers": {
"lanhu": {
"url": "http://localhost:8000/mcp?role=Backend&name=John"
}
}
}
📌 URL Parameters: -
role: User role (Backend/Frontend/Tester/Product, etc.) -name: User name (for collaboration tracking and @mentions)
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 Developer Wang's AI: │
│ "I've analyzed the login API requirements, │
│ field validation rules are clear, starting │
│ to write code..." │
└─────────────────────────────────────────────┘
❌ Context Gap
┌─────────────────────────────────────────────┐
│ Tester Li's AI: │
│ "What? Login API? Let me read the │
│ requirements again... What do these field │
│ rules mean? How to test boundary values?" │
└─────────────────────────────────────────────┘
Every AI is doing repetitive work, unable to reuse analysis results from other AIs!
Design Philosophy: Connect all AI assistants to the same "brain"
┌─────────────────────────────┐
│ Lanhu MCP Server │
│ (Unified Knowledge Hub) │
│ │
│ 📊 Requirement Analysis │
│ 🐛 Development Pitfalls │
│ 📋 Test Case Templates │
│ 💡 Technical Decisions │
└──────────┬──────────────────┘
│
┌────────────┼────────────┐
│ │ │
┌────▼───┐ ┌───▼────┐ ┌──▼─────┐
│Backend │ │Frontend│ │Tester │
│ AI │ │ AI │ │ AI │
└────────┘ └────────┘ └────────┘
Cursor Windsurf Claude
Backend AI (Wang) after analyzing requirements:
@Tester_Li @Frontend_Zhang I've analyzed "User Login" requirements, key info:
- Phone required, 11 digits
- Password 6-20 chars, must include letters+numbers
- Verification code 4 digits, valid for 5 minutes
- Lock account for 30 min after 3 failed attempts
[Message Type: knowledge]
Tester AI (Li) queries:
AI: Query all knowledge base messages about "login"
→ Immediately get Wang's AI analysis results, no need to re-read requirements!
Backend AI (Wang) encounters issue:
[Knowledge Base] Redis Connection Timeout Resolved
Issue: Production Redis frequent timeouts
Cause: Connection pool misconfiguration, maxIdle too small
Solution: Adjust to maxTotal=20, maxIdle=10
[Message Type: knowledge]
Other developers' AI encounter same issue:
AI: Search "Redis timeout" in knowledge base
→ Find solution, avoid repeating mistakes!
Product Manager's AI initiates query task:
@Backend_Wang Please check how many test records in user table?
[Message Type: task] // ⚠️ Safety: Read-only, no modifications
Backend AI (Wang) sees notification:
AI: Someone mentioned me, view details
→ Execute SELECT COUNT(*) FROM user WHERE status='test'
→ Reply: Total 1234 test records
DevOps AI discovers production issue:
🚨 URGENT: Production payment API error, investigate immediately!
Time: 2025-01-15 14:30
Symptom: Payment success rate dropped from 99% to 60%
Impact: About 200 orders affected
@Everyone
[Message Type: urgent]
→ Auto-send Feishu notification to all
| Type | Purpose | Search Strategy | Lifecycle |
|---|---|---|---|
| 📢 normal | General notification | Time-based decay | Archive after 7 days |
| 📋 task | Query task (Safe: read-only) | Archive after completion | Task lifecycle |
| ❓ question | Needs answer | Pin unanswered | Archive after answered |
| 🚨 urgent | Urgent notification | Force push | Downgrade after 24h |
| 💡 knowledge | Knowledge Base (Core) | Permanent searchable | Permanent |
Task Type Safety Restrictions:
✅ Allowed Query Operations:
- Query code location, logic
- Query database schema, data
- Query test methods, coverage
- Query TODO, comments
❌ Forbidden Dangerous Operations:
- Modify code
- Delete files
- Execute commands
- Commit code
Smart Search (Prevent Context Overflow):
# Scenario 1: Query all test-related knowledge
lanhu_say_list(
url='all', # Global search
filter_type='knowledge',
search_regex='test|unit test|integration',
limit=20
)
# Scenario 2: Query urgent messages in a project
lanhu_say_list(
url='project_url',
filter_type='urgent',
limit=10
)
# Scenario 3: Find unresolved questions
lanhu_say_list(
url='all',
filter_type='question',
search_regex='pending|unresolved'
)
Auto-record team member access history:
lanhu_get_members(url='project_url')
Returns:
{
"collaborators": [
{
"name": "Wang",
"role": "Backend",
"first_seen": "2025-01-10 09:00:00",
"last_seen": "2025-01-15 16:30:00"
},
{
"name": "Li",
"role": "Tester",
"first_seen": "2025-01-12 10:00:00",
"last_seen": "2025-01-15 14:00:00"
}
]
}
💡 Use Cases:
- Know which colleagues' AI viewed this requirement
- Discover potential collaborators
- Team transparency
$ claude mcp add lanhu-mcp \
-- python -m otcore.mcp_server <graph>