unifi-rmcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@unifi-rmcplist all connected clients"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
unifi-rmcp
MCP server and CLI for UniFi Network controllers: clients, devices, WLANs, firewall, and health over stdio or streamable HTTP, with auth.
It exposes one MCP tool, unifi, plus the runifi CLI. Agents can inspect
clients, devices, WiFi networks, health, alarms, events, controller sysinfo, and
authenticated identity, and can use generated official_* / unifi_* actions
when their MCP auth scope permits it.
30-second path: set UNIFI_URL and UNIFI_API_KEY, then run
npx -y unifi-rmcp health --json -> start loopback HTTP with
UNIFI_MCP_HOST=127.0.0.1 npx -y unifi-rmcp serve -> call tools/call with
{"action":"health"}.
Status: operational RMCP upstream-client server. The preserved convenience
actions are read-oriented; generated mutating actions require unifi:admin
authorization. HTTP MCP supports loopback dev mode, static bearer tokens, and
Google OAuth through lab-auth.
Not for: replacing the UniFi console, storing controller credentials for callers, bypassing UniFi permissions, generic HTTP proxying, multi-tenant isolation, or passing UniFi API keys through MCP tool arguments.
Contents
Related MCP server: UniFi Network MCP Server
Naming
Surface | This repo |
Repository |
|
Rust crate |
|
Binary / CLI |
|
npm package |
|
npm binary aliases |
|
MCP tool |
|
Config home |
|
Env prefixes |
|
The repo and npm package use the RMCP family name, while the shipped binary uses
the short Rust CLI name runifi.
Capabilities And Boundaries
Read connected wireless and wired clients, network devices, WLAN configs, site health, active alarms, recent events, controller sysinfo, and current authenticated user.
Dispatch generated
official_*actions for documented Network Integration API endpoints.Dispatch model-backed
unifi_*internal controller actions and hybrid aliases such aslist_clients,list_devices,list_networks,list_wifi, andget_system_info.Enforce
unifi:readfor read actions andunifi:adminfor mutating actions in mounted HTTP MCP mode.Provide setup, doctor, and endpoint-verification commands for local runtime checks.
This repo owns | UniFi owns | Explicitly out of scope |
MCP/CLI projection, action registry, request validation, HTTP MCP auth policy, response shaping, generated action dispatch, setup checks, and endpoint verification. | Controller state, site/device/client data, UniFi users, API key issuance, upstream authorization, and actual network mutations. | Replacing the controller UI, credential brokerage, arbitrary HTTP proxying, long-lived polling, policy-as-code, multi-tenant sandboxing, and local gateway provisioning. |
Install
Path | Command | Best for | Notes |
npm / npx |
| Local MCP clients and quick trials. | Downloads the matching |
Release installer |
| Host installs without Node. | Installs |
Docker / Compose |
| Shared HTTP MCP deployments. | Reads |
Build from source |
| Development and audits. | Produces |
Plugin |
| Claude Code local plugin setup from this checkout. | Ships the skill and |
npm / npx
Run the stdio MCP server or CLI without a manual binary install:
npx -y unifi-rmcp --help
npx -y unifi-rmcp mcp
npx -y unifi-rmcp health --jsonThe npm package downloads runifi during postinstall. Override download
behavior only when testing packaging:
Variable | Purpose |
| Skip postinstall binary download. |
| Select the GitHub Release tag. |
| Select the GitHub repo used for release downloads. |
| Select a custom release base URL. |
Build From Source
git clone git@github.com:dinglebear-ai/runifi.git
cd runifi
cargo build --release
./target/release/runifi --helpMinimum supported Rust version: 1.86. The Cargo workspace has three members:
the root unifi-rmcp package, crates/unifi (reusable core), and xtask
(dev tooling). All members inherit Rust edition 2024 and MSRV 1.97.1 from the
workspace root.
Quickstart
1. Create A UniFi API Key
In UniFi OS, go to Settings -> Admins & Users -> API Keys, create a key, and
copy it into UNIFI_API_KEY.
2. Configure The Controller
export UNIFI_URL=https://unifi.local
export UNIFI_API_KEY=...
export UNIFI_SITE=default
export UNIFI_SKIP_TLS_VERIFY=trueSet UNIFI_LEGACY=true only for older non-UDM controllers that do not use the
/proxy/network path prefix.
3. Run A Safe CLI Call
npx -y unifi-rmcp health --json4. Start Loopback HTTP MCP
UNIFI_MCP_HOST=127.0.0.1 npx -y unifi-rmcp serveIn another shell:
curl -sf http://127.0.0.1:40030/health5. Make A First MCP Call
curl -s -X POST http://127.0.0.1:40030/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"unifi","arguments":{"action":"health"}}}'Client Configuration
Claude Code Stdio
{
"mcpServers": {
"unifi": {
"command": "npx",
"args": ["-y", "unifi-rmcp", "mcp"],
"env": {
"UNIFI_URL": "https://unifi.local",
"UNIFI_API_KEY": "...",
"UNIFI_SITE": "default",
"UNIFI_SKIP_TLS_VERIFY": "true"
}
}
}
}Claude Code HTTP
{
"mcpServers": {
"unifi": {
"type": "http",
"url": "http://127.0.0.1:40030/mcp",
"headers": {
"Authorization": "Bearer ${UNIFI_MCP_TOKEN}"
}
}
}
}Codex / Labby Gateway
Register UniFi through Labby as an HTTP upstream when sharing one long-running server, or run it directly as stdio for local-only use.
[mcp_servers.unifi]
command = "npx"
args = ["-y", "unifi-rmcp", "mcp"]Generic MCP JSON
{
"command": "runifi",
"args": ["mcp"],
"env": {
"UNIFI_URL": "https://unifi.local",
"UNIFI_API_KEY": "..."
}
}Do not put UNIFI_API_KEY, OAuth secrets, passwords, SSH keys, or upstream
bearer tokens in MCP tool arguments. Use env, config files, or the MCP client's
secret storage. MCP callers never provide credentials, tokens, keys, or secrets
as action arguments.
Runtime Surfaces
Surface | Status | Entry point | Purpose |
MCP stdio | Supported |
| Local child-process MCP clients. |
MCP HTTP | Supported |
| Streamable HTTP MCP for local or shared server deployments. |
CLI | Supported |
| Scriptable parity and debugging. |
Prompts | Supported |
| Agent prompt for UniFi status summaries. |
Resource | Supported | MCP tool schema resource | Client-side schema discovery. |
REST API | Not shipped | N/A | UniFi already owns the REST APIs. |
Web UI | Not shipped | N/A | UniFi already owns the controller UI. |
MCP Tool Reference
One MCP tool is exposed: unifi. Pass the required action argument to select
the operation. The action enum is generated from the inventories in data/, so
the surface is large:
Family | Actions | Mutating |
| 78 | 36 |
| 175 | 87 |
Preserved convenience | 8 | 0 |
Hybrid aliases | 5 | 0 |
| 1 | 0 |
Total | 267 | 123 |
Counts are derived from data/unifi_official_network_v10_3_58.json and the
runtime: true entries of data/unifi_internal_endpoint_models.json.
crates/unifi/src/capabilities.rs is the source of truth at runtime.
Preserved Convenience Actions
Action | Description | Required params | Optional params |
| Connected wireless and wired clients. | none | none |
| Network devices: APs, switches, gateways. | none | none |
| WiFi network configurations. | none | none |
| Site health summary. | none | none |
| Active alarms and alerts. | none | none |
| Recent controller events. | none |
|
| Controller system information. | none | none |
| Authenticated UniFi identity. | none | none |
| Built-in action documentation. | none | none |
Generated Action Families
Family | Description | Scope behavior |
| Documented Network Integration API operations under | Read operations require |
| Model-backed internal controller-compatible actions under | Read operations require |
Hybrid aliases |
| Use internal actions by default, or official API when |
Endpoint coverage is tracked in docs/unifi_api_coverage.md; contract and safe
live verification are documented in docs/unifi_endpoint_verification.md.
CLI Reference
The binary calls the same service layer as the MCP tool:
runifi clients [--json]
runifi devices [--json]
runifi wlans [--json]
runifi health [--json]
runifi alarms [--json]
runifi events [--limit N] [--json]
runifi sysinfo [--json]
runifi me [--json]
runifi official_list_clients --param siteId=<uuid> --json
runifi official_create_network --param siteId=<uuid> --body-json '{"name":"IoT"}' --json
runifi list_clients --param siteId=<uuid> --json
runifi doctor [--json]
runifi setup check [--json]
runifi setup repair [--json]
runifi setup install [--json]
runifi setup plugin-hook [--no-repair] [--json]Generated actions accept --param k=v, --body-json JSON, and --json.
setup plugin-hook maps CLAUDE_PLUGIN_OPTION_* env vars into UNIFI_*,
refreshes the ~/.local/bin copy of the binary, and runs check + repair. It
used to run automatically from a Claude Code SessionStart/ConfigChange
hook; those hooks have been removed.
You do not need to run it to configure the plugin: plugins/unifi/.mcp.json
maps your plugin settings into the server's environment directly via
${user_config.*}. Run it by hand only when you want the ~/.local/bin binary
refresh or the preflight checks.
Configuration
Configuration loads from config.toml first, then UNIFI_* environment
variables override it. Host installs read ~/.unifi-rmcp/.env before loading
config; containers read /data/.env. Process environment overrides both.
Variable | Default | Purpose |
| unset | Controller base URL, e.g. |
| unset | API key for the |
|
| UniFi site name. |
| unset | Official API site UUID used by live tests and explicit generated calls. |
|
| Skip TLS certificate verification for self-signed controllers. |
|
| Legacy controller mode without |
|
| HTTP bind host. |
|
| HTTP bind port. |
| unset | Static bearer token for HTTP MCP. |
|
| Disable auth only for loopback development. |
|
| Compatibility alias for |
|
| Trust an upstream gateway to enforce auth. |
| empty | Comma-separated |
| empty | Comma-separated CORS |
| unset | Public URL for OAuth metadata. |
|
|
|
| unset | Google OAuth client ID. |
| unset | Google OAuth client secret. |
| unset | Admin email for OAuth bootstrap. |
|
| OAuth state database path. |
|
| OAuth JWT signing key path. |
|
| Appdata dir override; read by |
config.toml-only settings with no environment override: mcp.server_name
and the [mcp.auth] TTL, rate-limit, and allowlist fields
(access_token_ttl_secs, refresh_token_ttl_secs, auth_code_ttl_secs,
register_rpm, authorize_rpm, disable_static_token_with_oauth,
allowed_emails, allowed_client_redirect_uris). See config.example.toml.
xtask endpoint verification reads its own variables that the server never
touches: UNIFI_ALLOW_INSECURE_TLS, UNIFI_RESOLVE_IP,
UNIFI_VERIFY_TIMEOUT_SECS, UNIFI_VERIFY_RATE_LIMIT_MS,
UNIFI_VERIFY_MAX_REQUESTS, UNIFI_VERIFY_UNVERIFIED_INTERNAL.
Authentication
Stdio MCP runs as a local trusted child process and does not use HTTP auth.
HTTP MCP auth policy:
State | Condition | Behavior |
Loopback dev |
| Local unauthenticated development is allowed. |
Mounted bearer | Non-loopback with | Requires |
Mounted OAuth |
| Uses Google OAuth/JWT through |
Trusted gateway |
| Assumes a reverse proxy or gateway already enforced auth. |
unifi:admin satisfies unifi:read; unifi:read does not satisfy mutating
actions.
Safety And Trust Model
UniFi API keys are loaded from config/env only.
MCP callers select actions, params, and request bodies, not upstream credentials.
Preserved convenience actions are read-oriented.
Generated mutating actions require
unifi:adminin mounted HTTP MCP mode.Unknown actions and malformed generated-action params fail before upstream calls.
Non-loopback HTTP deployments must use bearer auth, OAuth, or a trusted authenticated gateway.
This bridge does not sandbox UniFi itself. UniFi remains responsible for API permissions and the actual network-side effect of a mutating call.
Architecture
Capabilities (src/capabilities.rs) official/internal/hybrid registry
|
UnifiClient (src/api.rs, src/unifi.rs) HTTP path families and transport
|
UnifiService (src/app.rs) action execution boundary
|
MCP shim (src/mcp/tools.rs) JSON args -> service -> Value
CLI shim (src/cli.rs) argv -> service -> stdoutDistribution Contract
Cargo.toml,Cargo.lock,packages/unifi-rmcp/package.json,.release-please-manifest.json, andserver.jsonmust agree on the released version.GitHub Releases publish the
runifibinary consumed by the npm launcher.The npm package name is
unifi-rmcp; binary aliases areunifi-rmcpandrunifi.Docker/OCI metadata uses
ghcr.io/dinglebear-ai/runifi:<version>. The GHCR namespace still readsjmagarbecause that is what.github/workflows/docker-publish.ymlpublishes; the git remote isdinglebear-ai/runifi. Do not "fix" one without the other.plugins/unifi/.mcp.jsonmust launchnpx -y unifi-rmcp mcpso stdio clients start the MCP transport rather than the HTTP server.plugins/unifi/ships no Claude Code hooks.scripts/validate-plugin-layout.shandtests/setup_cli.rsboth fail if ahooks/directory or a manifesthookskey reappears.The root README is curated. Source of truth for current actions and generated endpoint coverage is
src/capabilities.rs, thedata/inventories,docs/unifi_api_coverage.md, anddocs/unifi_endpoint_verification.md.
Development
cargo fmt --check
cargo test
cargo clippy -- -D warnings
cargo build --release
npm --prefix packages/unifi-rmcp run checkVerification
npm --prefix packages/unifi-rmcp run check
cargo check
cargo test
cargo clippy -- -D warnings
just validate-plugin
cargo run -p xtask -- verify-api-endpoints --mode contract
git diff --checkLive read probes require a controller:
UNIFI_URL=https://<gateway> \
UNIFI_API_KEY=<network-api-key> \
UNIFI_SITE=default \
UNIFI_SITE_ID=<official-site-uuid> \
UNIFI_SKIP_TLS_VERIFY=true \
cargo run -p xtask -- verify-api-endpoints --mode safe_liveDeployment
Use loopback for local development:
UNIFI_MCP_HOST=127.0.0.1 runifi serveUse Docker Compose for shared HTTP deployment:
cp .env.example .env
docker compose up -dWhen binding to a non-loopback address, configure UNIFI_MCP_TOKEN,
UNIFI_MCP_AUTH_MODE=oauth, or UNIFI_NOAUTH=true behind an authenticated
gateway.
Troubleshooting
Symptom | Check |
| Set it in env or |
TLS errors against a UniFi controller | Keep |
Legacy controller paths fail | Set |
HTTP | Set |
Stdio client hangs or logs JSON errors | Ensure client config runs |
Generated official action needs | Pass |
Mutating generated action is forbidden | Use an HTTP MCP token/session with |
Related Servers
All sibling servers live under the dinglebear-ai org.
soma - RMCP runtime and scaffold for provider-backed MCP servers.
rtailscale - Tailscale API bridge for devices, users, and tailnet operations.
unraid - Unraid monorepo;
unraid-rs/is the GraphQL bridge (binaryrunraid).rapprise - Apprise notification fan-out bridge for many delivery backends.
rgotify - Gotify push notification bridge for sends, messages, apps, and clients.
rarcane - Arcane Docker management bridge for containers and related resources.
yarr - Media-stack bridge for Sonarr, Radarr, Prowlarr, Plex, and related services.
rytdl - Media download and metadata workflow server.
synapse - Local Synapse workflow server for scout and flux actions.
cortex - Syslog and homelab log aggregation MCP server.
axon - RAG, crawl, scrape, extract, and semantic search project.
labby - Homelab control plane and MCP gateway project.
Documentation
CLAUDE.mdis the curated local operating guide for contributors and agents.docs/unifi_api_coverage.mdis the curated API-family and coverage summary.docs/unifi_endpoint_verification.mdis the curated endpoint verification guide.docs/SETUP.mdis curated plugin/setup guidance.docs/OAUTH.mdis curated OAuth setup guidance.plugins/unifi/skills/unifi/SKILL.mdis the agent usage guide.data/inventories are generated/reference inputs for the action registry.src/is the source of truth for current action dispatch, config defaults, auth behavior, and CLI parsing.
License
MIT. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenanceAn MCP server for self-hosted UniFi gateway management, providing tools for devices, networks, WiFi, firewall rules, switch port profiles, connected clients, and a one-shot IoT network creation with rollback.Last updated15MIT
- -license-quality-maintenanceTurns your UniFi Network Controller into programmable tools for querying and modifying network settings via MCP.Last updated
- FlicenseBqualityCmaintenanceMCP server for UniFi Network Controller that provides full API coverage for managing APs, clients, WLANs, firewall rules, VLANs, port forwards, and more.Last updated51
- AlicenseAqualityDmaintenanceControl your UniFi network via AI with a lightweight 2-tool MCP server that supports both cloud and local UniFi controllers.Last updated312MIT
Related MCP Connectors
MCP server for the FFmpeg Micro video transcoding API — create, monitor, download transcodes.
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dinglebear-ai/runifi'
If you have feedback or need assistance with the MCP directory API, please join our Discord server