Labsco
MCP SERVER

Lanhu MCP

by dsphper

Read Lanhu prototypes and design boards from your AI IDE — page contents, design measurements turned into HTML and CSS, exported slices — and leave notes the next person's assistant can find.

Design Systems & UI Component Libraries
Summary
Design specs and requirement docs reach the agent that is writing the code.

Beyond reading Lanhu, it adds something a design tool does not have: a shared board where one developer's assistant records what it worked out, and another developer's assistant can read it back.

What it is

A server for the Lanhu design collaboration platform. It signs in with your Lanhu cookie, pulls prototype pages and design boards, and adds a shared message board so several developers' assistants can read the same project context.

What you get
  • Requirements work: `lanhu_resolve_invite_link` turns a shared link into something addressable, `lanhu_get_pages` lists the prototype's pages, and `lanhu_get_ai_analyze_page_result` reads a page's contents
  • Design work: `lanhu_get_designs` lists the UI boards and `lanhu_get_ai_analyze_design_result` returns both a preview and the concrete parameters — component sizes, spacing, colour values, font sizes — converted into HTML and CSS reference code
  • Assets: `lanhu_get_design_slices` finds the exported slices and icons, named from the layer path
  • A shared board across assistants: `lanhu_say` posts, `lanhu_say_list` and `lanhu_say_detail` read, `lanhu_say_edit` and `lanhu_say_delete` maintain it, and `lanhu_get_members` shows who is on the project
  • Feishu webhook notifications when a message mentions someone
  • Caching keyed on document version, so unchanged resources are not downloaded again
Requirements

Python 3.10+ and a Lanhu cookie in `LANHU_COOKIE`, taken from a signed-in browser session. `playwright install chromium` is needed for the screenshot path. Docker Compose is the packaged route; from source, `python lanhu_mcp_server.py` serves at `http://localhost:8000/mcp`, and `run-stdio.sh` / `run-stdio.bat` let a client launch it over stdio on demand. Pass `role` and `name` as URL parameters — or `LANHU_USER_ROLE` and `LANHU_USER_NAME` over stdio — so the message board can attribute posts. The model on the other end must be vision-capable; a text-only model cannot read the design boards. `FEISHU_WEBHOOK_URL` is optional and only powers the mention notifications.

Setup effort

Build from source — clone the repository and build it