lanhu-mcp: an MCP server that lets AI coding tools read Lanhu prototypes and design files
200% AI MCP . Docker lanhu_mcp_server.py 3.
At a glance
- What is it?
- dsphper/lanhu-mcp wraps the Lanhu design collaboration platform in a Model Context Protocol server, so Cursor, Claude Code and other MCP clients can pull Axure requirement pages and UI specs directly. The catch is that it needs a browser cookie and a vision-capable model.
- Who is it for?
- Adopt lanhu-mcp if your team already keeps requirements and designs in Lanhu and your AI client speaks MCP, because the extraction work is otherwise manual. Skip it if you are not on Lanhu, if your model cannot read images, or if you want a tool that runs without a personal browser cookie.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 6 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What lanhu-mcp actually removes from the working day
Lanhu is a design collaboration platform where teams keep Axure prototypes, UI mockups and exported assets. The problem the project names is that an AI coding assistant cannot see any of that. A developer opens Lanhu in a browser, reads a page, copies field rules or spacing values into the chat, and repeats the exercise for the next screen. The README frames the older state as every developer's AI working alone and re-analysing the same requirements, with no shared context.
lanhu-mcp is a Model Context Protocol server that sits between Lanhu and the AI client. According to the README, it downloads and parses Axure prototype pages, resources and interactions, offers three analysis modes (development, testing, and a quick exploration view), and for UI work downloads design files, extracts slices, and returns component dimensions, spacing, colours and font sizes together with generated HTML and CSS. The intended users are frontend and backend developers, testers and product people whose AI client supports MCP and whose team stores design material in Lanhu. The README lists Cursor, Windsurf, Claude Code, OpenClaw, ClawBot, Trae, Cline and Tongyi Lingma as example clients, plus any other MCP-capable tool.
The second claim is collaboration. The project describes a shared message board backed by one server instance, where one developer's AI writes analysis results and another developer's or tester's AI reads them. That is a real architectural difference from a per-machine helper script: the knowledge lives in the server's data directory, not in one person's chat history.
Inside the server: FastMCP, Playwright and a version-keyed cache
The architecture is visible from the dependency list and the repository layout. The server is a Python package named lanhu-mcp-server, built on fastmcp (>=3.0.2,<4) and requiring Python 3.10 or newer. httpx handles HTTP requests, BeautifulSoup and lxml parse HTML, Pillow handles images, and Playwright with Chromium is the browser automation layer. That last dependency explains why installation is heavier than a typical Python package: the Dockerfile runs `playwright install --with-deps chromium`, which pulls system libraries as well.
Data flow is roughly: the MCP client calls a tool, the server authenticates to Lanhu using the cookie you supply, fetches the prototype or design resource, renders or downloads it, stores it under the data directory, and returns text plus image content to the model. The README describes a cache keyed on document version numbers, incremental updates that download only changed resources, and concurrent processing for batch screenshots and asset downloads. It also states that the server persists downloaded resources, screenshots and cache under `./data`, with logs under `./logs`; the Docker Compose file mounts both so they survive container restarts.
Two transport modes exist. The default HTTP service listens on port 8000 with the MCP endpoint at `http://localhost:8000/mcp`. The stdio mode is launched through `run-stdio.sh` or `run-stdio.bat`, which the README says enters the project directory, reads `.env`, and starts the MCP service over stdio so clients such as Cursor and Claude Code can start it on demand instead of keeping an HTTP process running. The Dockerfile's default command is `lanhu-mcp --transport http --host 0.0.0.0`.
Installing lanhu-mcp with Docker and connecting Claude Code
The README gives two manual paths and one AI-assisted path. Docker is described as the recommended manual option. Clone the repository, run the interactive environment setup, then start Compose. The setup script is what asks for your Lanhu cookie and writes the `.env` file.
git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
bash setup-env.sh
docker-compose up -dAfter that, `docker-compose logs -f` should show the service starting, and the MCP endpoint should answer at `http://localhost:8000/mcp`. The Compose file maps host port 8000 to container port 8000 and mounts `./data` and `./logs`.
For a source checkout instead, the README points at the one-shot installer, which installs dependencies, walks you through obtaining the cookie and configures the environment. Python 3.10 or newer is required.
bash easy-install.sh
python lanhu_mcp_server.pyThe manual fallback is `pip install -r requirements.txt` followed by `playwright install chromium`, plus a `LANHU_COOKIE` environment variable. To get that cookie the README says to log in to the Lanhu web app, open the browser developer tools, and copy the Cookie value from a request header.
Finally, register the server in the client. This is the Claude Code example from the README, with the role and name passed as URL parameters used for collaboration tracking and mentions.
{
"mcpServers": {
"lanhu": {
"type": "http",
"url": "http://localhost:8000/mcp?role=Developer&name=YourName"
}
}
}If you prefer on-demand startup, the README shows a stdio configuration that runs `run-stdio.sh` through `/bin/bash` with `LANHU_USER_NAME` and `LANHU_USER_ROLE` in `env`, and instructs you to replace `<ABSOLUTE_PATH_TO_LANHU_MCP>` with the absolute path of the checkout. Note the README's warning that some AI tools do not handle non-ASCII URL parameter values, so keep `role` and `name` in English.
The cookie, the vision requirement and the missing rollback story
The most consequential constraint is authentication. lanhu-mcp does not use an OAuth flow or an API token; it uses your personal Lanhu browser cookie, passed as `LANHU_COOKIE`. That means the server acts as you for as long as the cookie is valid, and the README's security note in the Compose comments asks you to keep `.env` out of version control and to rotate the cookie periodically. It also means the tool inherits the failure mode of session cookies: when Lanhu expires the session, the server stops fetching until you paste a new value. There is no documented refresh flow, and the README does not document rollback if a bad configuration is deployed.
The second constraint is the model. The README states in a prominent warning that the AI model must support image recognition and analysis, and explicitly lists text-only models as unsupported. Design analysis returns images and design parameters, so a text-only client can connect to the server and still fail to do the work. That is a selection criterion for the client, not a bug, but it narrows the audience.
Third, the project describes itself as Beta in its PyPI classifier, and the version history shows frequent releases: v1.6.2 on 2026-05-21, v1.7.0 on 2026-06-10, and v1.7.1 on 2026-07-06. The last push to the repository was on 2026-07-06. Fast iteration is not the same as stability, and the README's own AI-assisted installation path, where you ask an assistant to clone and install the project, is a sign that the manual path has enough steps to be worth automating.
Where it is the wrong tool: if your team uses Figma, Sketch or plain Markdown specs rather than Lanhu, nothing here applies. If you need an unattended CI integration that runs without a human's session, the cookie model fights you.
lanhu-mcp compared with a general browser-automation MCP server
The obvious alternative is a general-purpose browser automation MCP server, such as a Playwright-based one, paired with a prompt that tells the model to open Lanhu and read the page. The difference is where the domain knowledge lives. A generic browser server gives the model a page and lets it decide what matters; lanhu-mcp encodes Lanhu-specific behaviour: parsing Axure page structures, extracting design parameters, generating HTML and CSS from a design schema, naming slices from layer paths, and caching by document version so a second request does not re-download everything.
That encoding is also the limitation. A generic browser tool works on any site, including the ones lanhu-mcp does not support, and it does not need a dedicated cookie variable. lanhu-mcp only pays off if you are repeatedly pulling the same class of Lanhu artefacts, because the version-keyed cache and the three analysis modes are the value, and neither helps on a single one-off page. If your team's design source is not Lanhu, the generic route is the only route.
Licence, maintenance and what an upgrade costs you
The project is MIT licensed, and `pyproject.toml` declares `license = {text = "MIT"}` with a `LICENSE` file at the repository root. MIT is permissive: you can use, modify and redistribute it, including commercially, provided the copyright notice and licence text are kept. It offers no patent grant and no warranty, and nothing here is legal advice; if you redistribute the server inside a product, read the licence text yourself.
The maintenance picture from the repository data: the last push was on 2026-07-06, and the most recent release is v1.7.1 on the same date. The repository is not archived. Upgrade cost comes from three places. The Python floor is 3.10, so older interpreters are out. The fastmcp dependency is pinned to a major range (`>=3.0.2,<4`), which limits surprise breakage but will require attention when a 4.x line appears. Playwright and its Chromium download are the heaviest part of any rebuild, and the Dockerfile installs them with system dependencies, so image rebuilds are not cheap. The Docker Compose file documents `docker-compose up -d --build` for a rebuild, which is the command to use when you change the image rather than just the environment.
Editorial conclusion
Adopt lanhu-mcp if your team already keeps requirements and designs in Lanhu and your AI client speaks MCP, because the extraction work is otherwise manual. Skip it if you are not on Lanhu, if your model cannot read images, or if you want a tool that runs without a personal browser cookie. Before trusting it, verify that your Lanhu cookie still authenticates after a fresh login, confirm the client config uses `run-stdio.sh` with an absolute path, and read `config.example.env` against your own deployment because the README does not document rollback.
Frequently asked questions
What is lanhu-mcp and which AI tools can use it?
It is a Model Context Protocol server that extracts Lanhu Axure prototypes and UI design material for AI assistants. The README lists Cursor, Windsurf, Claude Code, OpenClaw, ClawBot, Trae, Cline and Tongyi Lingma as examples, plus any other MCP-capable client.
How do I install and start lanhu-mcp?
The README's recommended manual route is to clone the repository, run `bash setup-env.sh` to configure the Lanhu cookie, then `docker-compose up -d`. For a source checkout with Python 3.10 or newer, `bash easy-install.sh` installs dependencies and configures the environment, after which you run `python lanhu_mcp_server.py`.
Why does lanhu-mcp need a Lanhu cookie, and what happens when it expires?
The server authenticates to Lanhu with your personal browser session cookie, set through the `LANHU_COOKIE` environment variable, which the README says to copy from a request header in the browser developer tools. The README asks you to rotate it periodically and does not document an automatic refresh, so an expired session means fetching stops until you supply a new value.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/dsphper-lanhu-mcp)