20 min read

Set Up UniFi MCP for Claude Code and Remote HTTP Access

Install and verify UniFi MCP for Claude Code, configure Network, Protect, or Access, then expose the standalone API securely with Localtonet.

AI & MCP ยท Claude Code ยท Localtonet

UniFi MCP for Claude Code: local setup and remote-access readiness

Start with the UniFi MCP project's guided Claude Code installation, verify a low-risk local operation, and understand what must be established before considering remote access. This guide separates a local MCP subprocess, an HTTP-based MCP service, and an independent application API. It covers the documented plugin entry point and deployment acceptance checks, not a release-specific remote HTTP installation. We explain where Localtonet fits without assuming an HTTP port, authentication mechanism, or streaming capability that has not been verified.

๐Ÿ”’ Keep controller credentials and public-client authentication separate ๐ŸŒ Distinguish MCP transport from ordinary HTTP APIs โšก Validate locally before adding a remote route

Choose the interface and UniFi component first

UniFi MCP is an independent, community-maintained open-source project, not an official Ubiquiti product. Its project website describes separate MCP servers for UniFi Network, Protect, and Access, an independent HTTP API for applications, and an optional Cloud Relay for remote MCP access. These are different deployment choices, not interchangeable names for the same endpoint.

Start with the consumer. Claude Code needs an MCP connection to discover and call tools. A conventional dashboard or script may instead need an application API. A public HTTPS URL does not resolve that distinction: the service behind the URL still has to implement the protocol the client expects.

๐Ÿง  Local MCP client A command-based MCP integration can communicate with a local subprocess through standard input and output. This arrangement does not inherently create an HTTP listener.
๐ŸŒ Remote MCP client A remote consumer needs a compatible MCP transport, an exact endpoint, and a verified authentication boundary. An ordinary REST endpoint is not a substitute.
๐Ÿ”Œ Application integration The project describes its independent API as a separate route for applications and automation. Installing it is not a prerequisite for the local Claude Code plugin workflow.
Conceptual routes from Claude Code and remote HTTP consumers toward UniFi services
Use this as an interface-selection diagram, not proof that a particular package has an HTTP listener enabled.

Select only the product server you need

The UniFi MCP project overview identifies Network, Protect, and Access as separate stable MCP products. Choose according to the UniFi application involved, not simply the device on which the controller runs. Installing unnecessary servers increases the configuration and permission surface you must review.

ProductProject-described focusInitial validation goal
NetworkInventory, clients, routing, Wi-Fi, firewall policy, traffic, and controlled configurationRead a limited inventory or status result without changing configuration.
ProtectCameras, events, detections, recordings, and incident investigationVerify access to only the camera or event information the operator needs.
AccessDoors, visitors, credentials, policies, devices, and activity recordsBegin with an authorized read, not a door or credential mutation.
Comparison of UniFi Network, Protect, and Access MCP targets
The selected product determines which controller permissions and operations need review.

Keep the independent API outside this installation

The project describes unifi-api-server as running independently of the MCP servers while sharing the unifi-core manager layer. Its advertised interfaces include typed REST reads, read-only GraphQL, supported REST actions, SSE streams, scoped API keys, and audit records. These capabilities explain when an application might choose it; they do not make it a directly interchangeable MCP server.

This guide does not install the API, bootstrap its administration, or publish it. Those tasks require their own release-specific procedure, including storage, credentials, health checks, upgrades, and recovery. Keeping that deployment separate avoids leaving an additional privileged service partially configured during a Claude Code installation.

Prepare the local environment and permissions

The local walkthrough assumes Claude Code is already installed, signed in, and able to use plugin marketplace commands. It begins at the UniFi plugin installation boundary. It does not install Claude Code itself or claim a tested combination of operating system, controller firmware, and UniFi MCP package release.

Before installing, establish the following:

  • Controller reachability: the machine running the MCP server must be able to reach the intended UniFi controller through an authorized network route.
  • Product selection: know whether the task belongs to Network, Protect, or Access. The concrete command sequence below uses Network.
  • Dedicated credentials: prepare a UniFi account with the smallest permissions that support the intended task.
  • Secret handling: identify where the setup workflow will store settings and ensure that location is not shared or committed to source control.
  • Change control: choose a read-only acceptance task and decide who can approve any later state-changing operation.
  • Version record: record the installed client, plugin, server, and controller versions for troubleshooting and upgrades.

The project explicitly says compatibility varies by product, controller, firmware, and exposed API surface. A successful login is therefore not proof that every advertised operation works in your deployment. Test the particular reads or changes you intend to use.

Begin with restricted controller access

Do not use a broadly privileged administrator account merely to make initial setup easier. A read-only account, where supported and sufficient, limits the consequences of mistaken tool use. Keep passwords out of chat transcripts, screenshots, shell history, container images, and repository files.

Understand the documented execution alternatives

The project's installation overview presents Claude Code plugins as the default route with a server, skills, and guided setup. It also lists direct uvx, Docker, and pipx paths. Those are alternatives, not extra steps to perform after installing the plugin.

For direct package execution, the overview identifies UNIFI_HOST, UNIFI_USERNAME, and UNIFI_PASSWORD as controller connection settings. It shows uvx unifi-network-mcp@latest for Network, with equivalent Protect and Access package names. That command is not an HTTP startup recipe and does not establish a port, endpoint path, or public-client authentication method.

Avoid mixing execution paths during the first installation. If the plugin launches one server and you independently start another, you can end up diagnosing the wrong process or different configuration. Similarly, @latest is a moving package selection, not a reproducible version pin.

Install the Network plugin through Claude Code

The following three commands are the Network installation entry point published in the project's Claude Code installation instructions. Enter them inside Claude Code, not in an operating-system shell. They invoke the project's guided setup rather than replacing it with an undocumented static configuration file.

Sequence from Claude Code plugin installation through UniFi MCP tool discovery
Installation is followed by guided configuration and a separate local acceptance test.
1

Add the project marketplace

Register the UniFi MCP repository as the plugin marketplace.

/plugin marketplace add sirkirby/unifi-mcp
2

Install the Network plugin

Install the product plugin used by this local walkthrough.

/plugin install unifi-network@unifi-plugins
3

Run the guided Network setup

Invoke the supplied setup skill and review its requested configuration changes before approving them.

/unifi-network:unifi-network-setup

During guided setup, use the intended controller and dedicated account. Review where credentials are saved, which server command will run, and whether any permissions or exposure settings are changed. If the workflow requests a client reload, complete it before diagnosing missing tools.

The available primary instructions establish these commands but do not specify every prompt, operating-system dependency, or configuration-file location for every plugin release. Treat the installed setup skill as an interactive component, not a fixed transcript. If it cannot complete or asks for an unexplained privilege increase, stop and resolve that issue locally. Do not add a tunnel as a workaround.

Verify the local MCP session before using it

A plugin installation message proves only that installation completed. Acceptance requires a running server, successful MCP communication, controller access, and a correct result from the intended product.

Check discovery and a limited read

  1. Confirm that Claude Code recognizes the installed plugin and its MCP integration.
  2. Confirm that the server starts without a missing executable, dependency, or configuration error.
  3. Check that the client can initialize the MCP session and discover available functionality.
  4. Request one small, authorized read against the intended controller.
  5. Compare the result with the controller's own interface and confirm that no configuration changed.

A suitable initial request is:

Use the UniFi Network integration to retrieve a small read-only
inventory or status summary from the configured controller.
Do not create, update, delete, restart, or otherwise change anything.
Report any permission or connectivity error without attempting to
increase privileges.

This wording is a testing instruction, not a technical security boundary. Controller permissions and server-side controls must still constrain what tools can do.

Separate protocol behavior from controller behavior

MCP uses protocol operations such as tools/list and tools/call for tool discovery and invocation. A discovery success demonstrates communication with the MCP server; it does not establish that every controller operation is authorized or supported.

If results differ between clients, record the client version, server version, negotiated protocol information, and actual response shape. Do not assume that a particular response field or tool count must appear. This guide does not prescribe the earlier article's content-mode variables or lazy/eager discovery settings because their precise behavior is not established by the supplied primary documentation.

Likewise, an idle command-based server may be waiting for MCP input rather than serving a web page. Do not open arbitrary ports or invent an HTTP path to test a standard-input integration. Use the MCP client that owns the session.

Treat remote HTTP as a separate deployment decision

The project overview describes an optional Cloud Relay path:

Remote MCP client
โ†’ Worker gateway
โ†’ outbound WebSocket
โ†’ Relay sidecar
โ†’ local MCP servers over HTTP

According to the project's Cloud Relay overview, the Worker exposes an authenticated Cloudflare-hosted MCP endpoint, brokers locations, and is managed through an npm CLI. The LAN-side relay discovers configured local servers and maintains the outbound connection. Reads can fan out across locations, while writes require an explicit location target.

Those are architectural statements, not a complete deployment procedure. In particular, the authenticated Worker endpoint does not prove that a local MCP HTTP listener independently authenticates requests. Authentication at one hop must not be assumed at another.

No remote HTTP listener is configured by this guide

The available primary material does not establish a complete, release-specific UniFi MCP HTTP startup command, bind address, port, endpoint path, and direct-listener authentication procedure. We therefore do not provide a guessed remote setup or claim that a release has been tested. The local plugin workflow above should remain local until those details are independently established.

What a complete remote deployment must establish

Before approving a future remote deployment, require a runbook containing all of the following. These are acceptance criteria, not implied UniFi MCP configuration options.

  • The exact server release and installation artifact, plus the remote client's supported transport.
  • The documented command or configuration that enables HTTP, including bind address, listening port, and endpoint path.
  • The component responsible for authenticating remote callers, its credential provisioning process, and its revocation procedure.
  • A local MCP initialization and discovery test using the intended client.
  • A successful read-only tool call and a separate unauthorized-request rejection test.
  • Any session-header, protocol-version, origin-validation, or streaming requirements applicable to that implementation.
  • Startup supervision, restart behavior, upgrade rollback, and credential recovery procedures.
A local HTTP service being checked before remote publication
For a future HTTP deployment, a responding socket is only the first check. MCP initialization and authentication must also succeed locally.

Test streaming explicitly when it is used

A successful ordinary HTTP response does not prove Server-Sent Events compatibility. If the selected MCP transport uses an SSE response, test it directly against the local listener first. Confirm that events arrive incrementally rather than only when the connection closes.

Repeat the same test through the proposed public route. Include an idle interval, an intentional disconnect, and reconnection using the client's supported behavior. Compare local and remote results. Check each HTTP layer for buffering or timeout behavior if they differ.

This is a deployment test requirement, not a blanket claim that every client, relay, or Localtonet route supports every MCP streaming implementation. Do not substitute a browser landing page or a successful REST request for a working remote MCP session.

Understand where a Localtonet HTTP tunnel fits

With Localtonet, our client establishes an outbound connection to a Localtonet relay and provides a public URL for a configured HTTP service. The device does not need inbound router port forwarding, a public IP address, or a VPN setup for that workflow. Use it only in environments where this exposure is authorized.

An HTTP tunnel targets an IP address and port reachable from the selected Localtonet client. It does not convert standard input and output into HTTP, implement MCP on behalf of a REST API, or create a missing application authentication layer.

Remote HTTP traffic passing through a Localtonet tunnel to a local service
This routing diagram applies only after a real HTTP listener and its access controls have been independently verified.

For a future verified HTTP deployment, use our HTTP tunnel documentation for the dashboard configuration sequence. We do not reproduce a generalized setup sequence here as though it were a tested UniFi MCP procedure. The following product concepts are important when reviewing that configuration:

  • Device: the selected device-specific token identifies the Localtonet client that must reach the service. Protect that token separately from controller and application credentials.
  • Relay: choose an available server or region from the current dashboard rather than copying an old server code.
  • Target: use the listener address and port verified from the client device's network context.
  • Public address: HTTP process types include Random Sub Domain, Custom Sub Domain, and Custom Domain, subject to current availability. Check current documentation before giving a custom domain DNS settings.
  • Lifecycle: creating a tunnel does not start it. It must be started with Start and is available only while the selected client is connected and the tunnel is running.

Loopback deserves particular attention. If a service binds to 127.0.0.1, another computer cannot reach it through that address. Containers can introduce a separate network namespace as well. Validate connectivity from the actual Localtonet client environment, not merely from a terminal somewhere on the LAN.

Public verification is separate from tunnel creation

After an independently documented deployment is ready, public acceptance should repeat the local MCP initialization, discovery, and read-only call through the assigned HTTPS address using the intended remote client. Verify that requests without valid application credentials are rejected before tools or sensitive data are exposed.

If streaming is required, perform the explicit streaming test described above through that same route. Record the client and server versions and the outcome rather than claiming universal compatibility. Stop or delete the tunnel when remote access is no longer required.

Make each authentication and authorization boundary explicit

The project's control and safety overview describes default mutation previews that wait for confirmation, policy gates that can disable create, update, or delete behavior globally or at server and category scope, and default redaction of known secret-bearing response values. These are useful controls, but they solve different problems from public-client authentication.

BoundaryWhat is establishedWhat not to assume
Controller accountThe MCP service uses controller access to perform operations.A dedicated account is automatically read-only or appropriately scoped.
Mutation controlsThe project describes confirmation and policy gates.A confirmation prompt authenticates an internet caller or replaces controller permissions.
Response redactionThe project describes redaction of known secret-bearing values.Every sensitive infrastructure detail or every log entry is removed.
Cloud Relay WorkerThe project describes an authenticated hosted MCP endpoint.The same authentication automatically protects a directly exposed local listener.
Localtonet device and tunnelOur platform supplies public reachability to the selected service while the tunnel runs.The device token is the remote MCP client's application credential.

For the local workflow, the main boundaries are workstation access, the MCP client and server configuration, and controller authorization. For direct public HTTP, an additional caller-authentication boundary is essential. It must belong to the verified application or an explicitly deployed and tested access-control layer. This guide does not establish a direct UniFi MCP HTTP authentication scheme.

Keep controllers private. Publishing an MCP service does not require publishing the controller management interface. Avoid using a broad proxy route that accidentally exposes administration, unrelated services, or sensitive endpoints alongside the intended integration.

Treat returned inventory, client identifiers, camera information, and access records as potentially sensitive even when passwords are redacted. Restrict who can run the client, inspect its transcript, or collect diagnostic output. Human approval of a mutation should include the target controller, proposed change, and expected impact.

Operate and troubleshoot from the inside out

Keep a short local runbook containing the product selection, installed versions, controller identity, credential owner, protected configuration location, accepted read-only test, and recovery contact. Do not include passwords in the runbook itself.

After upgrading a plugin, client, controller, or firmware, repeat the same acceptance test. Check the project repository's upgrade guidance before updating existing installations. Do not change credentials, transport settings, and package versions simultaneously unless necessary: doing so makes regressions harder to isolate.

Layered diagnostic checks across Claude Code, UniFi MCP, HTTP routing, and a UniFi controller
For local use, stop at the local MCP and controller layers. Investigate HTTP routing only when an HTTP deployment actually exists.
SymptomFirst checksAvoid
Plugin command is not recognizedConfirm Claude Code supports the plugin workflow and that commands are being entered inside Claude Code.Running slash commands in the operating-system shell.
Plugin installed but server does not startInspect startup errors, executable availability, dependencies, and saved configuration. Reload if requested.Creating a tunnel to fix a local process failure.
Server connects but tools failCheck controller reachability, credentials, product permissions, and operation compatibility.Immediately switching to an unrestricted administrator account.
Expected functionality is missingCheck the selected product, installed release, discovered tool descriptions, and account scope.Assuming an undocumented discovery-mode setting will fix it.
Results look different across clientsCompare client/server versions, negotiated protocol details, and raw responses with secrets removed.Applying unverified content-mode environment variables.
A running process has no HTTP portDetermine whether it is a command-based MCP subprocess.Guessing a port or endpoint path.
A future HTTP route works locally but not publiclyCheck the client device, target reachability, tunnel running state, endpoint path, and application authentication.Removing authentication to make the public test pass.
Ordinary HTTP works but a stream stallsCompare local and remote incremental delivery, idle behavior, timeouts, and reconnection.Treating an HTTP success status as proof of SSE compatibility.

Recovery and shutdown

If local behavior becomes unexpected, stop using the integration for changes and preserve sanitized error information. Restore the last known working configuration through your normal change-control process, then repeat the read-only test. Reinstallation should not be the first response to a permission or controller-connectivity problem.

If credentials may have leaked, revoke or rotate the affected credential at its issuing system. Restarting a process does not revoke a password or token. Remove exposed copies from shared logs and review who could have accessed them.

For any later remote deployment, stop the public route first when investigating an exposure concern. Then assess the service configuration and credentials. A stopped tunnel removes that route, but it does not undo earlier disclosure or disable other routes to the same application.

Frequently asked questions

Does local Claude Code use require a public tunnel?

No. A local command-based MCP integration can communicate through standard input and output while the server reaches the controller privately. Localtonet is unnecessary for that connection.

Does this guide configure remote UniFi MCP HTTP access?

No. It covers the documented local plugin entry point and remote-readiness criteria. A complete version-specific HTTP startup and authentication procedure is not established here, so no port, path, or tested remote release is claimed.

Does the Cloud Relay's authentication protect a directly tunneled listener?

Not by assumption. The project describes authentication at its Worker endpoint. A direct route to a local listener needs its own verified authentication boundary, and must be tested independently.

Is the independent API required for the plugin?

No. The project describes the API as an independent application interface. It is not part of the local Network plugin command sequence shown here and should not be installed merely to troubleshoot MCP discovery.

Does a successful HTTPS request prove MCP streaming works?

No. Test MCP initialization, discovery, and a read-only call with the intended client. If the transport uses SSE, also test incremental delivery, idle behavior, disconnects, and reconnection locally and through the public route.

Is UniFi MCP an official Ubiquiti product?

No. It is an independent community project. Validate the selected release against your UniFi application, controller, firmware, permissions, and intended operations before relying on it.

Keep local MCP local until remote access is ready

Begin with the guided plugin workflow and a restricted read-only test. When a separately documented HTTP deployment has passed authentication and protocol checks, our HTTP tunneling platform can provide its public route. Publish only the service you intend to expose, and stop the tunnel when access is no longer needed.

Get Started Free โ†’

Corrections & updates

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

Remove the outer article wrapper and repair the malformed code tag. Rework the guide navigation so every major retained section is represented by a valid fragment link. Verify all detailed UniFi MCP, Cloud Relay, protocol-version, discovery-mode, API, authentication, and security-control claims against current project documentation and add contextual primary-source links. Add a complete, reproducible remote MCP HTTP setup for a named and tested UniFi MCP release, including prerequisites, exact startup configuration, bind behavior, por

Add the required hero-first layout and clickable guide navigation with matching section IDs; remove the outer article wrapper; update the scope and title to distinguish local Claude Code MCP, optional HTTP-based MCP, Cloud Relay, and the independent non-MCP API; document the current UniFi MCP and API prerequisites, installation paths, configuration, startup, local verification, authentication, API-key handling, SSE considerations, routine operation, and troubleshooting from primary project documentation; explain that the Cloud Relay r

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