Loading...
Loading...
AI-powered design collaboration server connecting Lanhu design platform with AI coding assistants for requirements analysis, UI design extraction, and team knowledge sharing
npx skill4agent add aradotso/mcp-skills lanhu-mcp-collaborationSkill by ara.so — MCP Skills collection.
"Help me clone and install https://github.com/dsphper/lanhu-mcp"# Clone repository
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
# Configure environment (interactive cookie setup)
bash setup-env.sh # Linux/Mac
# or
setup-env.bat # Windows
# Start service
docker-compose up -d# Clone repository
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
# One-click installation (includes cookie setup)
bash easy-install.sh # Linux/Mac
# or
easy-install.bat # Windowspip install -r requirements.txt
playwright install chromiumexport LANHU_COOKIE="your_lanhu_cookie_here"export FEISHU_WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"lanhu_mcp_server.pyDEFAULT_FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/your-webhook-url"export SERVER_HOST="0.0.0.0"
export SERVER_PORT=8000
export DATA_DIR="./data"
export HTTP_TIMEOUT=30
export VIEWPORT_WIDTH=1920
export VIEWPORT_HEIGHT=1080
export DEBUG="false"python lanhu_mcp_server.pydocker-compose up -d
docker-compose logs -f # View logs
docker-compose down # Stophttp://localhost:8000/mcpclaude_desktop_config.json{
"mcpServers": {
"lanhu": {
"type": "http",
"url": "http://localhost:8000/mcp?role=Developer&name=YourName"
}
}
}{
"mcpServers": {
"lanhu": {
"url": "http://localhost:8000/mcp?role=Developer&name=YourName"
}
}
}rolenameanalyze_requirements_document# User prompt example:
"Please analyze this requirements document using MCP:
https://lanhuapp.com/web/#/item/project/product?tid=xxx&pid=xxx&docId=xxx"
# The AI will call:
analyze_requirements_document(
url="https://lanhuapp.com/web/#/item/project/product?tid=xxx&pid=xxx&docId=xxx",
mode="development" # Options: development | testing | exploration
)developmenttestingexplorationview_design_document# User prompt:
"Please view this design document using MCP:
https://lanhuapp.com/web/#/item/project/stage?tid=xxx&pid=xxx"
# Returns:
# - Design image previews
# - Precise parameters (dimensions, spacing, colors, fonts)
# - HTML + CSS code conversionexport_design_slices# User prompt:
"Export all design slices from this Lanhu page"
export_design_slices(
design_url="https://lanhuapp.com/web/#/item/project/stage?tid=xxx&pid=xxx",
output_dir="./assets"
)create_messagelist_messagessearch_messages# Create knowledge entry
create_message(
project_url="https://lanhuapp.com/web/#/item/project/...",
content="User authentication requires OAuth2 flow with refresh token rotation",
message_type="knowledge", # Options: knowledge | task | question | experience
tags=["auth", "security", "backend"]
)
# Search team knowledge
search_messages(
project_url="https://lanhuapp.com/web/#/item/project/...",
keyword="authentication",
message_type="knowledge"
)
# @mention team member (triggers Feishu notification)
create_message(
project_url="https://lanhuapp.com/web/#/item/project/...",
content="@zhangsan Please review the API error handling logic",
message_type="task",
mentioned_users=["zhangsan"]
)knowledgetaskquestionexperience# Step 1: User provides Lanhu URL
user: "Analyze requirements: https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456&docId=789"
# Step 2: AI calls analyze_requirements_document
result = analyze_requirements_document(
url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456&docId=789",
mode="development"
)
# Step 3: AI processes four-stage analysis
# - Stage 1: Scans all pages and extracts text
# - Stage 2: Groups pages and analyzes by business modules
# - Stage 3: Reverse validates for missing items
# - Stage 4: Generates structured requirements document
# Step 4: Save insights to team knowledge base
create_message(
project_url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456",
content="Key finding: User role permissions require cascading delete logic",
message_type="knowledge",
tags=["permissions", "database"]
)# Step 1: View design and get parameters
user: "Implement this design: https://lanhuapp.com/web/#/item/project/stage?tid=123&pid=456"
design_data = view_design_document(
url="https://lanhuapp.com/web/#/item/project/stage?tid=123&pid=456"
)
# Step 2: Extract design parameters
# Returns:
# {
# "preview_image": "base64_image_data",
# "parameters": {
# "width": "375px",
# "height": "812px",
# "spacing": {"top": "20px", "left": "16px"},
# "colors": {"primary": "#1677FF", "text": "#333333"},
# "fonts": {"title": "16px/bold", "body": "14px/regular"}
# },
# "html_css": "<div class='container'>...</div>\n<style>...</style>"
# }
# Step 3: Export required assets
export_design_slices(
design_url="https://lanhuapp.com/web/#/item/project/stage?tid=123&pid=456",
output_dir="./src/assets/images"
)
# Step 4: AI generates implementation code using parameters + HTML/CSS reference# Developer A's AI analyzes requirements
analyze_requirements_document(
url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456&docId=789",
mode="development"
)
# Save analysis results
create_message(
project_url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456",
content="Requirements analysis complete. 5 core modules identified: User, Product, Order, Payment, Notification",
message_type="knowledge",
tags=["requirements", "architecture"]
)
# Tester B's AI searches team knowledge
messages = search_messages(
project_url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456",
keyword="requirements analysis",
message_type="knowledge"
)
# Returns Developer A's analysis — no duplicate work!
# Tester B's AI now performs test-focused analysis
analyze_requirements_document(
url="https://lanhuapp.com/web/#/item/project/product?tid=123&pid=456&docId=789",
mode="testing"
)# Never hardcode secrets
# ❌ BAD:
LANHU_COOKIE = "abc123..."
FEISHU_WEBHOOK = "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
# ✅ GOOD: Use environment variables
import os
LANHU_COOKIE = os.getenv("LANHU_COOKIE")
FEISHU_WEBHOOK = os.getenv("FEISHU_WEBHOOK_URL")
# Validate required config
if not LANHU_COOKIE:
raise ValueError("LANHU_COOKIE environment variable is required")CookieLANHU_COOKIEproject_urlrm -rf ./data/cache/*# Check port availability
lsof -i :8000
# Verify environment variables
docker-compose config
# Check logs
docker-compose logs lanhu-mcp
# Restart with clean state
docker-compose down -v
docker-compose up -dexplorationexport HTTP_TIMEOUT=60
export VIEWPORT_WIDTH=1920
export VIEWPORT_HEIGHT=1080lanhu_mcp_server.pyANALYSIS_MODES = {
"development": "Developer perspective with detailed field rules",
"testing": "QA perspective with test cases and validation",
"exploration": "Quick overview for stakeholder review",
"security": "Security-focused analysis for audit" # Custom mode
}FEISHU_USER_ID_MAPFEISHU_USER_ID_MAP = {
"zhangsan": "ou_1234567890abcdef",
"lisi": "ou_abcdef1234567890",
# Add your team members
}# Increase concurrent downloads
export HTTP_TIMEOUT=60
# Larger viewport for high-res screenshots
export VIEWPORT_WIDTH=2560
export VIEWPORT_HEIGHT=1440
# Enable debug logging
export DEBUG="true"// In Cursor, add to .cursor/mcp.json
{
"mcpServers": {
"lanhu": {
"url": "http://localhost:8000/mcp?role=Frontend&name=Alice"
}
}
}
// Then prompt:
// "Using Lanhu MCP, analyze the design at https://lanhuapp.com/...
// and generate React components with Tailwind CSS"// In Windsurf settings
{
"mcp": {
"servers": {
"lanhu": {
"url": "http://localhost:8000/mcp?role=Fullstack&name=Bob"
}
}
}
}// In claude_desktop_config.json
{
"mcpServers": {
"lanhu": {
"type": "http",
"url": "http://localhost:8000/mcp?role=Backend&name=Charlie"
}
}
}GET-COOKIE-TUTORIAL.mdai-install-guide.mdDEPLOY.mdCONTRIBUTING.mdLICENSE