30 min read

Self-Host Lanhu MCP and Connect with Localtonet

Install and verify Lanhu MCP for Cursor and Claude Code, then provide authorized remote access to its HTTP endpoint with Localtonet.

AI and MCP ยท Lanhu MCP ยท Localtonet ยท 2026

Run Lanhu MCP locally, validate its tools, and prepare a controlled HTTP connection for remote MCP clients

Lanhu MCP connects compatible AI development tools to Lanhu requirements, design assets, visual evidence, and shared team knowledge. This guide covers the verified Docker Compose and Python 3.10+ installation paths, Lanhu cookie handling, HTTP and stdio transports, local verification, client connection patterns, and Localtonet HTTP tunnel setup. It deliberately does not claim to provide a production-ready public deployment because the available Lanhu documentation does not establish built-in HTTP authorization, and the supplied evidence does not define a tested authentication gateway that every named MCP client can use. Complete the local workflow first, then add and test a client-compatible authorization layer before enabling remote access.

๐Ÿ”’ Keep the Lanhu cookie on the server ๐ŸŒ Verify http://localhost:8000/mcp locally first โšก Choose Docker Compose, Python, HTTP, or stdio deliberately
Lanhu MCP serving local MCP clients with an optional protected route for an authorized remote client through Localtonet
Lanhu MCP can serve local clients directly. Remote HTTP access should target a separately protected listener only after authorization has been configured and tested.

What Lanhu MCP provides and how the deployment works

Lanhu MCP is a self-hosted Model Context Protocol server for working with Lanhu design delivery and requirement material. A compatible AI assistant can use the MCP tools to retrieve supported project information instead of relying on users to copy requirements, screenshots, annotations, and design references into every conversation.

The current upstream project describes requirement-document extraction, Axure page analysis, design previews, source parameters, image assets, image slicing, and shared team knowledge workflows. Requirement analysis can be approached from development, testing, or quick-exploration perspectives. The server supplies source information and visual material, while the connected AI model and user remain responsible for interpreting that material and checking conclusions against the original requirement or design.

Lanhu MCP v1.8.6 adds focused visual inspection for ambiguous Axure requirements. After retrieving pages, a client can use lanhu_inspect_requirement_region with exactly one supported anchor: rendered text through query, a stable block_id, a long-page tile_id, or an explicit source rectangle defined by coordinates. Repeated text can return candidate previews for the vision model to distinguish. The tool does not perform OCR and does not infer meaning from layer names.

The same v1.8.6 release keeps the established full screenshot and adds full-width long-page strips that split vertically. Its release notes specify source strips of at most 960 pixels high with 96 pixels of overlap by default. Screenshot cache schema 4 rebuilds tile metadata once after an upgrade. These are release-specific behaviors, not general performance or accuracy guarantees. Review the Lanhu MCP v1.8.6 release notes before relying on them.

๐Ÿ“‹ Requirement analysis Retrieve supported Axure pages, rendered text, resources, and annotations for development, testing, or exploratory analysis.
๐ŸŽจ Design context Return design previews, source parameters, image assets, and derived implementation references that can be checked against the original design.
๐Ÿ”Ž Focused visual evidence Version 1.8.6 can select a requirement region by unique text, stable block ID, long-page tile ID, or explicit source coordinates.
๐Ÿ’ฌ Shared team context Compatible assistants can connect to the same service and use its team knowledge workflows instead of isolating all context inside individual chats.
๐Ÿ–ผ๏ธ Vision-model workflow Screenshot and design interpretation requires a model with image-understanding capability. A text-only model is not sufficient for the intended visual workflows.
๐ŸŒ HTTP or stdio transport HTTP runs a persistent network service. Stdio lets a compatible local MCP client launch Lanhu MCP as an on-demand child process.

HTTP and stdio are different operating models

Use stdio when the MCP client runs on the same computer and can launch a command with arguments. The repository includes run-stdio.sh and run-stdio.bat for that pattern. The client owns the child process and communicates through standard input and output, so there is no HTTP listener to tunnel.

Use HTTP when Lanhu MCP must remain running independently as a network service. With the documented example configuration, the endpoint is http://localhost:8000/mcp. Localtonet applies only to this HTTP deployment. Installing with Docker or Python does not by itself create an HTTP listener. The listener exists only when the service is started with HTTP transport and the selected host and port are reachable.

Select the transport before configuring clients

A stdio client needs a local command and arguments. An HTTP client needs a complete endpoint URL and may also need a supported method for sending gateway credentials. Do not mix these configuration models or assume a stdio script can be reached through an HTTP tunnel.

The upstream repository is the primary location for current project behavior and installation files. Consult the Lanhu MCP repository and README alongside this tutorial when selecting a release.

Prerequisites and security preparation

Docker users need Git, Docker, and a working Docker Compose command. Current installations commonly expose Compose as docker compose, while an older installation may use docker-compose. Source users need Git and Python 3.10 or newer. The project explicitly notes that Python 3.9, including the version historically bundled with some macOS systems, does not meet its requirement.

Check the interpreter before creating a virtual environment:

python3 --version

On Windows, the available launcher may instead be:

python --version

You also need an authorized Lanhu account with access to the projects the server will read. The required LANHU_COOKIE is obtained from an authenticated browser session. Log in to Lanhu, open the browser developer tools, inspect an authenticated request to Lanhu, and copy the complete Cookie request-header value into the server's protected environment configuration. The upstream Lanhu cookie tutorial provides the project-specific procedure.

Treat the Lanhu cookie as a credential

The cookie may grant the access associated with its Lanhu account. Never paste it into an MCP client definition, public command, container image, source file, Git commit, screenshot, issue, or support request. Store it in a restricted environment file or secret mechanism on the server. Replace it if it is disclosed, expires, or no longer reflects the intended account permissions. The v1.8.6 release states that no account cookie is stored in the source, wheel, or release assets.

Reserve local TCP port 8000 unless you intend to change SERVER_PORT. Check that another program is not already listening on that port. If our Localtonet client will run on another device, that device must be able to reach the chosen server address and port over the private network. A loopback listener such as 127.0.0.1 is reachable only from the same network namespace or host.

Requirement Docker Compose path Python source path
Git Used to clone and update the repository Used to clone and update the repository
Runtime Docker with Compose support Python 3.10 or newer
Browser dependency Handled by the container build Playwright Chromium must be installed in the selected environment
Lanhu credential LANHU_COOKIE in the local .env file LANHU_COOKIE in .env or the process environment
Typical use Persistent, isolated service operation Development, source inspection, or operation without Docker

Install Lanhu MCP with Docker Compose

Docker Compose is the upstream project's recommended manual deployment path. It isolates the application dependencies and provides a repeatable build and startup workflow. The commands below follow the current repository instructions. Additional deployment details are maintained in the upstream Lanhu MCP deployment guide.

1

Clone the repository

Download the current project and enter its working directory.

git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
2

Create the environment file

Copy the supplied example. Use the command that matches the operating system.

cp .env.example .env
copy .env.example .env
3

Set the authorized Lanhu cookie

Open .env in a local editor and replace the example LANHU_COOKIE value with the complete cookie from the authorized browser session. Do not commit the completed file.

4

Build and start the Compose service

Build the image and start the configured service in detached mode.

docker compose up -d --build

If the installed release uses the legacy Compose executable, substitute docker-compose.

Inspect service state and logs after startup:

docker compose ps
docker compose logs

A running container does not prove that the application initialized successfully. Review the logs for a missing cookie, dependency failure, browser setup problem, port conflict, or application exception. Redact credentials, private project names, internal paths, and request data before sharing logs.

Understand Docker listener binding

Container networking changes the meaning of a bind address. The documented example uses SERVER_HOST=0.0.0.0, which lets the process accept traffic through the container's network interface. Changing the process inside the container to 127.0.0.1 can prevent traffic arriving through Docker's published port from reaching it.

This does not mean the host port must be exposed to every LAN interface. Container binding and host port publication are separate controls. Review the repository's current Compose file and the effective Docker port mapping. If you need host-only access, constrain the host-side publication using a configuration supported by your Docker deployment, then verify it from both the host and another LAN device. This guide does not provide an unverified replacement Compose file.

Install Lanhu MCP from source with Python 3.10+

Docker Compose and Python installation paths leading to Lanhu MCP with either HTTP or stdio transport
Both installation paths can run Lanhu MCP, but neither guarantees an HTTP listener by itself. An HTTP endpoint exists only when HTTP transport is started; either installation can also use stdio.

A source installation is useful when you want to inspect or modify the code, cannot use Docker, or need to integrate the process with an existing Python-oriented service manager. The repository supplies installer scripts for Linux, macOS, and Windows. It also documents a manual virtual-environment procedure.

Installer-script path

1

Clone and enter the repository

Download the source and change to the project directory.

git clone https://github.com/dsphper/lanhu-mcp.git
cd lanhu-mcp
2

Run the installer for the operating system

The installer handles project dependencies and guides cookie configuration.

bash easy-install.sh
easy-install.bat

The current shell installer can select package and browser-download mirrors and fall back to other configured sources. The upstream documentation names PIP_INDEX_URL, PLAYWRIGHT_DOWNLOAD_HOST, and PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST as overrides. Leave these unset unless your network or package policy requires a different source.

Manual virtual-environment path

On Linux or macOS:

python3 -m venv venv
./venv/bin/python -m pip install -e .
./venv/bin/python -m playwright install chromium
cp .env.example .env

On Windows:

python -m venv venv
venv\Scripts\python.exe -m pip install -e .
venv\Scripts\python.exe -m playwright install chromium
copy .env.example .env

Edit .env and set LANHU_COOKIE before startup. The project also documents supplying the cookie through the process environment. Avoid entering a real cookie directly into a command that will be retained in shell history. A restricted environment file or managed secret facility is safer for persistent operation.

Source-host loopback binding

A source process runs directly in the host network namespace. If the Localtonet client and Lanhu MCP are on the same host, a loopback-only source listener can reduce LAN exposure, provided the current Lanhu MCP release accepts the selected SERVER_HOST value and the client can reach it. Test the actual listener after changing the value.

If our client runs on another device, a source process bound to 127.0.0.1 will not be reachable from that device. In that topology, the service needs an appropriate private interface binding and host firewall policy, or both components should be moved to the same host. Do not confuse this source-host behavior with the container requirement to accept traffic through Docker's network interface.

Configure the server and its HTTP listener

The required variable is LANHU_COOKIE. The repository also documents settings for the listener, data directory, outbound timeout, browser viewport, debugging, and optional Feishu integration. Begin with the example file included in the selected release and change only values you understand.

Variable Documented example Purpose
LANHU_COOKIE User-supplied credential Authenticates authorized server requests to Lanhu and is required.
SERVER_HOST 0.0.0.0 Controls the address on which HTTP transport listens.
SERVER_PORT 8000 Controls the HTTP port used by the documented endpoint.
DATA_DIR ./data Selects the local data-storage directory.
HTTP_TIMEOUT 30 Sets the HTTP request timeout in seconds.
VIEWPORT_WIDTH 1920 Sets the browser viewport width for applicable rendering workflows.
VIEWPORT_HEIGHT 1080 Sets the browser viewport height for applicable rendering workflows.
DEBUG false Controls debug mode. Keep it disabled unless diagnosing a specific problem.
FEISHU_WEBHOOK_URL Optional webhook URL Enables the supported optional Feishu robot integration.
A broad listener can create LAN exposure

A host value of 0.0.0.0 accepts traffic through available interfaces, subject to container networking, host firewall rules, and operating-system policy. It may be necessary inside Docker, but it should not be treated as an access-control mechanism. Review the effective listener and port publication before assuming that port 8000 is private.

The optional Feishu webhook is also credential-like. Prefer an environment variable over embedding its URL in application code. User-ID mappings depend on the team's Feishu environment and must be supplied by the operator rather than guessed.

Start HTTP transport and verify Lanhu MCP locally

Verification sequence from starting Lanhu MCP through checking the local HTTP endpoint and testing an MCP client
Confirm process health and network reachability before asking an MCP client to initialize a session and invoke a narrow read-only tool.

Docker Compose starts the configured service when docker compose up -d --build succeeds. For a source installation, start the installed command explicitly with HTTP transport.

On Linux or macOS:

./venv/bin/lanhu-mcp --transport http

On Windows:

venv\Scripts\lanhu-mcp.exe --transport http

Leave a foreground source process running during testing. If it exits, read the terminal output before restarting. Check the Python version, installed dependencies, Playwright Chromium installation, cookie configuration, and port availability.

The documented local MCP URL is:

http://localhost:8000/mcp

Verify in layers

  1. Confirm that the source process remains running or that Compose reports an active service.
  2. Inspect startup logs for fatal configuration or dependency errors.
  3. Check that the local TCP listener accepts a connection.
  4. Use an MCP-compatible client to initialize the transport and discover tools.
  5. Perform a narrow, read-only request against a project the configured Lanhu account is authorized to access.

Use curl only as a basic reachability check:

curl --verbose --max-time 5 http://localhost:8000/mcp
An HTTP response is not a complete MCP test

MCP over HTTP has protocol requirements that a simple GET request may not satisfy. A response reporting an unsupported method, media type, or missing protocol data can still prove that a server accepted the connection. Connection refused indicates that nothing accepted the connection at that address and port. A timeout can indicate an unreachable address, filtering, or a stalled service. Functional verification requires an MCP client to initialize and discover or invoke tools.

For the functional test, connect locally and allow the client to enumerate the available tools. Perform a read-only operation against a known project or requirement. Confirm that returned project, page, and design information belongs to the expected workspace. This checks more than listener health: it exercises the cookie, Lanhu account permissions, MCP transport, and tool execution.

If text retrieval works but visual interpretation does not, verify the model selected in the MCP client. Lanhu MCP can provide screenshots and design resources, but the connected model must support image understanding.

Connect Cursor, Claude Code, or another MCP client

Client configuration depends on the transport. The upstream project lists Cursor, Windsurf, Claude Code, and other MCP-capable tools as relevant clients. Its AI installation guide and English project documentation provide current project context. Client interfaces and configuration schemas can change independently, so verify the settings accepted by the installed client release.

Connection pattern Client configuration needs Operational behavior
Local stdio A local command and any required arguments The client starts Lanhu MCP and communicates through standard input and output.
Local HTTP The complete URL http://localhost:8000/mcp Lanhu MCP must already be running with HTTP transport.
Protected remote HTTP A public HTTPS MCP URL plus a client-supported gateway credential method The protected gateway, Lanhu MCP service, Localtonet client, and tunnel must all remain available.

Local stdio connection

The repository includes platform scripts that enter the project directory, read .env, and start stdio transport:

./run-stdio.sh
run-stdio.bat

In a client that supports command-and-arguments MCP definitions, select the appropriate script as the command. Use an absolute path if the client starts with a different working directory. Do not start the HTTP service merely to use stdio.

Local HTTP connection

In a client that supports HTTP MCP servers, enter the complete endpoint:

http://localhost:8000/mcp

Do not put LANHU_COOKIE in this client definition. That cookie belongs on the Lanhu MCP host and authorizes server-side access to Lanhu.

Remote HTTP credentials are client-specific

A protected remote endpoint normally requires the MCP client to present a credential to the gateway, such as through an HTTP header or another supported access flow. The evidence supplied for this guide does not establish one credential configuration that works across current Cursor, Claude Code, Windsurf, and other HTTP MCP clients. It also does not establish a tested reverse-proxy configuration for Lanhu MCP.

Therefore, this article does not provide a production-ready authentication recipe. Before remote rollout, confirm from the selected client's current documentation that it can send the exact credential required by your chosen gateway. If the client cannot send that credential during MCP initialization and subsequent requests, the gateway and client are not compatible for this deployment.

Define and test the authorization boundary before remote access

The available Lanhu MCP documentation does not establish built-in authentication or per-user authorization for its HTTP endpoint. HTTPS protects traffic in transit to the tunnel edge, but it does not identify an approved MCP user. A private URL, generated subdomain, or knowledge of the /mcp path is not access control.

This tutorial stops short of a production-ready public deployment

We do not have evidence for a tested authentication gateway configuration that is guaranteed to preserve Lanhu MCP transport behavior and work with every named client. Do not publish the unprotected listener. Select an authenticated gateway independently, confirm that your MCP client can transmit its required credentials, and tunnel the gateway's protected listener rather than port 8000 directly.

Keep the two credentials separate. LANHU_COOKIE lets the server access Lanhu. A gateway credential identifies or authorizes the remote MCP client. A remote user should never receive the Lanhu browser cookie.

Required authorization tests

Run these tests against the gateway's local protected address before creating or starting a public tunnel. Use the same path and transport that the remote client will use.

Test Request condition Required result
Missing credential Connect without the gateway credential The gateway rejects the request before Lanhu MCP tools or project data are available.
Invalid credential Connect with an incorrect, expired, or revoked credential The gateway rejects the request and does not fall back to anonymous access.
Valid credential Connect using the exact method supported by the selected MCP client The MCP session initializes and tool discovery succeeds.
Authorized read Invoke one narrow read-only tool against an expected project The expected data is returned without exposing unrelated projects.
Revoked credential Revoke the test credential and retry Previously accepted access is denied.

Record the tested client version, gateway version, credential mechanism, protected local URL, and expected rejection behavior. Repeat both negative and positive tests after upgrades. An HTTP status alone is not enough for the positive test: the authorized client must complete MCP initialization and discover tools through the gateway.

If you cannot complete all tests, keep Lanhu MCP local. An alternative private-access architecture may be more appropriate, but standard Localtonet HTTP tunneling should not be described as a VPN or as an authorization system.

Configure a Localtonet HTTP tunnel for a protected listener

Authorized remote MCP traffic passing through a Localtonet HTTP tunnel to a protected local gateway in front of Lanhu MCP
Localtonet provides the public route to the selected local target. Authentication must be enforced by a compatible protective layer before traffic reaches Lanhu MCP.

After local MCP verification and authorization testing, our client can establish an outbound connection to a Localtonet relay server. This provides public HTTP connectivity without inbound router port forwarding, a public IP address, VPN setup, or direct inbound firewall changes. The tunnel is available only while the selected Localtonet device is connected and the tunnel is running.

Follow the current Localtonet HTTP tunnel documentation when working in the dashboard. The sequence below includes the documented HTTP Process Type, device token, relay server, local target, and Start action.

1

Install and run the Localtonet client

Install our client on the Lanhu MCP host or another trusted device that can reach the authenticated gateway's local listener. Keep the client running whenever remote access is required.

2

Open the HTTP tunnel configuration and select Process Type

Create an HTTP tunnel and choose the required Process Type: Random Sub Domain, Custom Sub Domain, or Custom Domain. Each option serves the configured local HTTP content at a public HTTPS address. Availability can vary, and exact custom-domain DNS requirements should be checked in the current product before changing DNS.

3

Select the connected device token

Select the device-specific authentication token for the client that will run the tunnel. The token identifies the device and must remain private. Do not place it in an MCP client, repository, screenshot, or public guide.

4

Select an available relay server

Choose a currently available relay server or region from the dashboard. Use the values displayed in the current product rather than copying a server code from an older tutorial.

5

Enter the protected local target

Set the local IP address and port to the authenticated gateway, not directly to an unprotected Lanhu MCP listener. If our client and gateway run on the same host, use the gateway address reachable from that client. If they run on different devices, use the gateway's reachable private address. Do not use localhost for a service on another machine.

6

Press Start and copy the assigned address

Creating the tunnel does not start it. Press Start, wait for the tunnel to run, and copy its assigned public HTTPS address. Preserve the MCP path when configuring the remote client, normally by using the public origin followed by /mcp.

7

Stop or delete the tunnel when access ends

Stop the tunnel to remove active reachability while retaining its configuration. Delete it when the endpoint should no longer exist. The public route also becomes unavailable if the selected client disconnects, but planned shutdown should use the dashboard controls rather than relying on an accidental disconnection.

Repeat the authorization tests remotely

Test from a network outside the server's local network. First connect without credentials and confirm that the gateway rejects access. Repeat with an invalid credential. Then use the chosen client's supported credential method and confirm that MCP initialization, tool discovery, and one narrow read-only operation succeed.

Finally, stop the Localtonet tunnel and confirm that the public endpoint is no longer reachable. Restart it only when remote access is required. If the unauthenticated or invalid-credential tests succeed unexpectedly, stop the tunnel immediately and correct the gateway before sharing the URL.

Keep the dependency order visible

Remote operation requires Lanhu MCP, the authenticated gateway, the Localtonet client, and the HTTP tunnel to be running. A failure at any layer can make the public endpoint unavailable. Test each local layer before troubleshooting the public route.

Routine operation, shutdown, and upgrades

Treat a shared MCP server as an application service. Monitor process state, review failures without publishing sensitive logs, keep the Lanhu cookie current, and periodically perform a small read-only verification. Also test the gateway's negative authorization cases after configuration changes.

Docker Compose operations

Inspect status and logs:

docker compose ps
docker compose logs

Stop and remove the running Compose containers:

docker compose down

After checking out an intended release and reviewing its configuration changes, Docker deployments must rebuild the image:

docker compose up -d --build

Source process operation

Stop a foreground source process from its terminal. For persistent use, apply the operating system's normal service-management mechanism while preserving the repository working directory, virtual environment, protected environment configuration, and required data-directory permissions. Do not invent additional Lanhu MCP flags beyond those documented by the selected release.

Upgrade evidence limitation

The v1.8.6 release notes define the required upgrade outcome but do not provide one complete command sequence that is valid for every source checkout, wheel installation, branch strategy, virtual environment, or service manager. They state that a normal source installation should retrieve the intended tag, upgrade dependencies, reinstall the package, and restart the MCP client. Docker users must rebuild the image.

Because repository state and installation method determine the safe Git and package commands, this guide does not invent a universal upgrade sequence. Before upgrading, stop remote access, back up required data, identify the currently installed method and version, and follow the upstream v1.8.6 upgrade instructions together with the repository's current deployment documentation. Compare the new environment examples with your local configuration without overwriting the protected cookie.

After the upgrade, restart the service using the documented command for its installation path. Expect screenshot cache schema 4 to rebuild tile metadata once when moving to v1.8.6. Repeat local tool discovery, a known read-only Lanhu request, all gateway authorization tests, and the remote tunnel shutdown test.

The release also says that an existing compatible single-file deployment can replace lanhu_mcp_server.py because the file embeds the matching lanhu_design implementation. That statement assumes compatible dependencies. A full repository, wheel, or Docker installation remains the upstream recommendation for keeping code and dependencies synchronized.

Credential lifecycle

Replace the Lanhu cookie when its browser session expires, the account loses access, or disclosure is suspected. Where organizational policy permits, use an account limited to the projects and permissions required by the MCP workflow. Removing someone from an MCP client does not revoke the server-side Lanhu cookie or a separately issued gateway credential.

Keep Localtonet device tokens private. Revoke or rotate gateway credentials when users, devices, or access requirements change. Stop tunnels that are not needed instead of leaving a protected but unused service continuously reachable.

Troubleshooting installation and connectivity

The source installer reports an unsupported Python version

Run python3 --version or python --version and confirm Python 3.10 or newer. A virtual environment retains the interpreter with which it was created. Recreate the environment using the correct interpreter if necessary.

The service cannot start on port 8000

Another process may be listening on the port. Stop the conflicting service or set SERVER_PORT to an available value. Update the local verification URL, Docker port publication where applicable, gateway upstream, MCP client URL, and Localtonet target so every layer uses the same effective port.

The local request returns connection refused

Confirm that the source command is still running or that Compose reports an active service. Review startup output for a missing cookie, package error, failed Chromium installation, or port conflict. Verify the actual bind address and port.

Docker reports a running container, but localhost does not work

Check the application logs and effective Docker port publication. The process inside the container must accept traffic on the container interface, which is why the documented 0.0.0.0 value matters. A healthy internal process is not reachable from the host unless the Compose configuration publishes the required port.

A source listener works locally but not from the Localtonet device

If our client runs on another machine, the Lanhu MCP or gateway service cannot remain bound only to the source host's loopback interface. Use an appropriate private interface and firewall policy, or run our client on the same host. Test the target directly from the Localtonet device before changing the tunnel.

The endpoint returns an HTTP error to curl

A basic request does not perform a complete MCP handshake. If curl receives an HTTP response, network reachability may be working even when the method or protocol data is rejected. Continue with a compatible MCP client and review server logs.

The client connects but cannot retrieve Lanhu data

Confirm that LANHU_COOKIE contains the current complete Cookie request-header value and that the account can access the project in the browser. Check for accidental whitespace or quoting introduced while editing. Replace an expired cookie and restart the service so it receives the new value.

Text works but screenshot analysis fails

Verify that Playwright Chromium was installed in the same virtual environment used to run Lanhu MCP. For Docker, inspect build and runtime logs. Confirm that the AI client uses a vision-capable model.

The Localtonet address cannot reach the protected service

Test the gateway's local target from the device running our client. Confirm the selected device is connected, the correct relay is selected, the target IP and port are accurate, and the tunnel was started. Creating the tunnel alone does not run it.

The gateway rejects the authorized MCP client

Confirm that the client can transmit the gateway's required credential on MCP HTTP requests, not only on an initial browser request. Check the exact client version and gateway configuration. If compatibility cannot be established, stop the tunnel and keep the service local.

The endpoint works without gateway credentials

Stop the tunnel immediately. Verify that the tunnel targets the gateway rather than port 8000 directly, that the gateway protects the /mcp path, and that anonymous access is disabled. Repeat missing, invalid, valid, and revoked credential tests before restarting remote access.

Frequently asked questions

What is the default Lanhu MCP HTTP endpoint?

The documented local endpoint is http://localhost:8000/mcp. If you change SERVER_PORT, update every client, gateway, container publication, and Localtonet target that depends on it.

Does installing Lanhu MCP automatically start an HTTP listener?

No. Docker and Python are installation paths. An HTTP listener exists only when the configured service starts HTTP transport. Lanhu MCP can also run through stdio without a network listener.

Should I use Docker Compose or Python?

Docker Compose is the upstream project's recommended manual deployment and is usually suitable for a persistent isolated service. Use Python 3.10+ when you need direct source access, cannot use Docker, or want to integrate the process into an existing Python environment.

Should the Lanhu cookie be sent to Cursor or Claude Code?

No. The Lanhu cookie is a server-side credential. Store it only in the protected Lanhu MCP environment. A remote client may need a separate gateway credential, but it should never receive the browser cookie.

Can stdio be exposed through a Localtonet HTTP tunnel?

No. Stdio communicates through a local child process's standard input and output. A Localtonet HTTP tunnel needs a reachable HTTP service, so Lanhu MCP must be started with HTTP transport.

Does a Localtonet HTTP tunnel authenticate MCP users?

Do not assume that it does. The tunnel provides connectivity to the selected local target. Put a tested, client-compatible authorization layer in front of Lanhu MCP and target that protected listener.

Why does this guide not include a reverse-proxy configuration?

The supplied evidence does not establish a tested gateway configuration that preserves the required MCP HTTP behavior and works with every named client. Providing an unverified recipe would create a false sense of security. This guide therefore narrows its scope and requires operators to validate their selected gateway and client credential mechanism independently.

Can the Localtonet client run on another device?

Yes, if that device can reach the protected gateway's private IP address and port. Do not use localhost as the target when the gateway runs on another machine, because localhost refers to the Localtonet client device itself.

Does creating a tunnel immediately make the endpoint reachable?

No. The selected device must be connected and the tunnel must be started with the Start action. The endpoint remains available only while the client is connected and the tunnel is running.

Prepare a protected Lanhu MCP connection with Localtonet

Install Lanhu MCP, verify its tools locally, and test a client-compatible authorization layer before creating an HTTP tunnel to the protected listener. Our outbound tunneling workflow can then provide the public route without opening an inbound router port.

Get Started Free โ†’

Corrections & updates

Substantive changes approved by the Localtonet editorial team are listed transparently below.

Remove the outer article wrapper; move the opening figure so the hero is first and the clickable guide card immediately follows it; retain unique matching section IDs; verify all Lanhu commands, environment variables, Docker behavior, and v1.8.6 statements against the current repository and release; qualify the HTTP-listener diagram caption; add contextual links to the primary Lanhu deployment, cookie, release, MCP transport, MCP client, and Localtonet HTTP tunnel documentation; revise the Localtonet steps to match the current documen

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

support