Security-first MCP server for TP-Link Omada, with a stdio-first runtime, capability-gated tools, and OpenAPI-based network automation.
Overview
Security-focused MCP server for TP-Link Omada Open API workflows. - Production-safe baseline uses stdio - Omada credentials are environment-only - Capability profiles and category gating control what tools are exposed - HTTP remains in the codebase only as an explicitly unsafe, lab-only path - Validated against live Omada Controller 6.x environments and designed around the documented 5.x/6.x Open API surface If you do not publish an image yet, build locally instead: 2. Edit your Claude Desktop MCP config: - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Windows: %APPDATA%\Claude\claude_desktop_config.json 4. Restart Claude Desktop and verify the server by listing sites or devices. The server reads configuration from environment variables. See .env.example for the complete reference.
README
Safe Omada MCP
Security-focused MCP server for TP-Link Omada Open API workflows.
At a Glance
- Production-safe baseline uses
stdio - Omada credentials are environment-only
- Capability profiles and category gating control what tools are exposed
- HTTP remains in the codebase only as an explicitly unsafe, lab-only path
- Uses documented Open API routes; controller/device validation is operation-specific (see support matrix)
0.19 release candidate
This branch prepares 0.19.0-rc.2 with 68 additional preview-first networking tools and a bundled server icon for compatible MCP clients. Write previews, compact discovery, diagnostics and reliability changes are described in the migration guide. Stable write-tool release awaits disposable-controller and hardware validation; latest remains the existing stable version.
Quick Start
Option 1: Use with Claude Desktop via Docker
-
Pull or build an image:
docker pull ghcr.io/gaspareduard/omada-mcp:latestIf you do not publish an image yet, build locally instead:
npm run docker:build -
Edit your Claude Desktop MCP config:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server entry:
{ "mcpServers": { "safe-omada": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "OMADA_BASE_URL=https://your-omada-controller.local", "-e", "OMADA_CLIENT_ID=your-client-id", "-e", "OMADA_CLIENT_SECRET=your-client-secret", "-e", "OMADA_OMADAC_ID=your-omadac-id", "-e", "OMADA_SITE_ID=your-site-id", "-e", "OMADA_STRICT_SSL=true", "ghcr.io/gaspareduard/omada-mcp:latest" ] } } } -
Restart Claude Desktop and verify the server by listing sites or devices.
Option 2: Run the container directly
docker run --rm -it \
--env-file .env \
ghcr.io/gaspareduard/omada-mcp:latest
Option 3: Run locally for development
npm install
npm run build
npm start
Configuration
The server reads configuration from environment variables. See .env.example for the complete reference.
Required Omada Variables
| Variable | Required | Default | Description |
|---|---|---|---|
OMADA_BASE_URL |
Yes | - | Base URL of the Omada controller |
OMADA_CLIENT_ID |
Yes | - | OAuth client ID from Omada Platform Integration |
OMADA_CLIENT_SECRET |
Yes | - | OAuth client secret |
OMADA_OMADAC_ID |
Yes | - | Omada controller ID (omadacId) |
OMADA_SITE_ID |
No | - | Optional default site ID. When omitted and no tool-level site ID is supplied, a single available site is selected automatically; zero or multiple sites return an error. |
OMADA_STRICT_SSL |
No | true |
Enforce TLS certificate validation |
OMADA_CA_FILE |
No | - | PEM private CA bundle path; retains hostname verification. Mount the file read-only in Docker. |
OMADA_TIMEOUT |
No | 30000 |
HTTP timeout in milliseconds |
Capability and Logging
| Variable | Required | Default | Description |
|---|---|---|---|
OMADA_CAPABILITY_PROFILE |
No | safe-read |
Built-in profile: safe-read, ops-write, admin, compatibility |
OMADA_TOOL_CATEGORIES |
No | profile default | Explicit category override; recovery requires recovery:rw |
OMADA_CATALOG_MODE |
No | standard |
standard tools or compact discovery/dispatch |
OMADA_INCLUDE_DEPRECATED |
No | false |
Include deprecated aliases |
OMADA_ALLOW_TOOL_HEADERS |
No | false |
Expose only bounded X-Request-ID / X-Correlation-ID headers |
MCP_SERVER_LOG_LEVEL |
No | info |
debug, info, warn, error |
MCP_SERVER_LOG_FORMAT |
No | plain |
plain, json, or gcp-json |
Capability Profiles
| Profile | Intended use |
|---|---|
safe-read |
Default read-only operational visibility |
ops-write |
Client operations and maintenance writes, excluding recovery |
admin |
All implemented categories except recovery |
compatibility |
Deprecated alias for admin; no private API fallback |
OMADA_TOOL_CATEGORIES replaces profile defaults. Restore tools require explicit recovery:rw; neither admin, compatibility, nor all:rw grants recovery.
Mutation previews and recovery
Writes default to dryRun: true. Review the preview and explicitly pass dryRun: false to apply. submitted means the controller accepted a request; only verified indicates a matching readback. See the 0.19 migration guide for verification limits and partial outcomes.
Restore tools also require confirmDangerous: true. This is an argument check, not enforced human approval or a stateful second-call protocol. Configure approvals in the MCP host and grant recovery:rw only when recovery is intended.
Optional HTTP Lab Mode
HTTP is not part of the supported production baseline.
It only starts when both of these are set:
MCP_SERVER_USE_HTTP=trueMCP_UNSAFE_ENABLE_HTTP=true
Use it only for local lab/debug scenarios.
| Variable | Required | Default | Description |
|---|---|---|---|
MCP_SERVER_USE_HTTP |
No | false |
Legacy lab-only switch |
MCP_UNSAFE_ENABLE_HTTP |
No | false |
Explicit acknowledgement required |
MCP_HTTP_PORT |
No | 3000 |
HTTP port |
MCP_HTTP_BIND_ADDR |
No | 127.0.0.1 |
Loopback bind address only (127.0.0.1 or ::1) |
MCP_HTTP_PATH |
No | /mcp |
MCP endpoint path |
MCP_HTTP_ENABLE_HEALTHCHECK |
No | true |
Enable health check |
MCP_HTTP_HEALTHCHECK_PATH |
No | /healthz |
Health check path |
MCP_HTTP_ALLOW_CORS |
No | true |
Enable CORS |
MCP_HTTP_ALLOWED_ORIGINS |
No | 127.0.0.1, localhost |
Allowed origins |
MCP_HTTP_NGROK_ENABLED |
No | false |
Legacy placeholder; disabled in safe baseline |
MCP_HTTP_NGROK_AUTH_TOKEN |
No | - | Legacy placeholder |
Development and Validation
Common Commands
| Task | Command |
|---|---|
| Run dev server | npm run dev |
| Build | npm run build |
| Lint + type-check | npm run check |
| Unit tests | npm test |
| Coverage gates | npm run test:coverage |
| Symlink integrity | npm run symlinks:check |
| README/tool sync | node scripts/check-readme-sync.mjs |
| Tool/test mapping | node scripts/check-tool-tests.mjs |
Inspector
Use the MCP Inspector when you want to test the built server interactively:
npm run inspector
npm run inspector:build
Project Notes
- The safe baseline is
stdiofirst. - HTTP remains a legacy, explicitly unsafe lab path.
- The repo includes
docs/openapi/as the implementation reference for Omada endpoints. - README tool tables below are kept in sync with the registered MCP tools.
Tools
0.19 workflows and discovery
| Tool | Description |
|---|---|
getWifiHealthSummary |
Composes dashboard, channel, interference and retry evidence with timestamps, missing sections and bounded review heuristics. Read-only. |
diagnoseLogs |
Reads recent event, alert and audit pages plus log settings; distinguishes unavailable data from empty results and reports incomplete history. |
diagnoseCameraConnectivity |
Resolves a camera client and reads its detail/session evidence; reports missing data and network drilldowns without claiming to diagnose Frigate inference. |
setApRadio |
Previews or updates one supported AP band with advertised channel/width validation, preserved sibling settings and bounded readback verification. |
updateSsid |
Previews or updates SSID name, broadcast visibility, guest status or sharing policy while preserving required security fields. Broadcast visibility is not SSID enable/disable. |
setSwitchPorts |
Previews or updates name, status, PoE, profile or override for 1–32 explicit ports. Checks existence, guards known LAG disruption and reports per-port verification/partial completion. |
searchOperations |
Searches only enabled operations by name, description or category. |
describeOperation |
Returns an enabled operation’s exact argument schema and permission. |
getServerCapabilities |
Reports version, effective catalog, profile and validation limits. |
callOperation |
Compact mode only: invokes an enabled operation through its existing schema and handler. |
Each category below is collapsed by default. Click to expand and see the full tool list, split into read and write tools.
Network configuration writes
Create, update and delete the objects needed for VLAN segmentation and day-to-day network changes: LAN networks, switch port profiles, WLAN groups and SSIDs, IP/MAC groups, mDNS, NAT, routing, DNS, filtering, VPN, and device/client actions. Combined with the ACL and switch-port tools above, these cover the networking workflows of the UniFi MCP server for Omada.
Every write previews by default (dryRun omitted or true), validates its payload against strict schemas generated from the official OpenAPI specs (scripts/generate-request-schemas.mjs), sends at most one write with dryRun: false, and then reads the controller back. Results report verified, mismatch, unknown or unverifiable, or submitted for one-shot commands with no readable end state. Secrets such as PSKs, DDNS passwords and WireGuard private keys are write-only; they are listed in notVerifiedFields and are redacted from output. Controller rejections are returned with their Omada error code. Enable a group with OMADA_TOOL_CATEGORIES, for example network-lan:rw,wireless-ssid:rw,profiles:rw.
VLANs, port profiles and Wi-Fi segmentation
| Tool | Description | Category |
|---|---|---|
createGroupProfile |
Create an IP, IP-port, MAC, IPv6, country, or domain group used as a source/destination in ACLs, policy routes, URL filters and MAC filters (UniFi firewall/client groups). | profiles:rw |
updateGroupProfile |
Replace an existing group profile. Every ACL or rule that references the group changes behaviour immediately. | profiles:rw |
deleteGroupProfile |
Delete a custom group profile. Built-in groups are refused; the controller also refuses groups still referenced by rules. | profiles:rw |
createMdnsRule |
Create an mDNS (Bonjour) reflector rule so services such as AirPlay or Chromecast in one VLAN are discoverable from another. | network-services:rw |
updateMdnsRule |
Replace an existing mDNS rule, e.g. to enable/disable it or change which networks are bridged. | network-services:rw |
deleteMdnsRule |
Delete an mDNS rule by ID. Cross-VLAN service discovery it provided stops. | network-services:rw |
createLanProfile |
Create a switch port profile (native VLAN, tagged VLANs, isolation, PoE, STP). Assign it to ports with setSwitchPorts. | network-lan:rw |
updateLanProfile |
Replace an existing switch port profile. Every port using the profile is re-provisioned and may briefly lose connectivity. | network-lan:rw |
deleteLanProfile |
Delete a custom switch port profile. System profiles are refused. | network-lan:rw |
createWlanGroup |
Create a WLAN group (a set of SSIDs that APs can be assigned to with setApConfig configType wlan-group; UniFi AP groups). | wireless-ssid:rw |
updateWlanGroup |
Rename an existing WLAN group. | wireless-ssid:rw |
deleteWlanGroup |
Delete a WLAN group. The primary group is refused; the controller refuses groups still assigned to APs. | wireless-ssid:rw |
createSsid |
Create an SSID in a WLAN group, optionally mapped to a VLAN for segmentation. APs using the group start broadcasting it after provisioning, which can briefly interrupt their radios. | wireless-ssid:rw |
deleteSsid |
Delete an SSID. Clients connected to it are disconnected. | wireless-ssid:rw |
createLanNetwork |
Create a LAN network / VLAN (gateway interface with subnet and DHCP, or a switch-only VLAN) for segmentation. Gateways and switches re-provision. | network-lan:rw |
updateLanNetwork |
Replace an existing LAN network (subnet, DHCP, VLAN, interfaces). Clients on the network can lose connectivity while devices re-provision. | network-lan:rw |
deleteLanNetwork |
Delete a LAN network. The primary network is refused; clients on the network lose connectivity. | network-lan:rw |
listMdnsRules |
List mDNS (Bonjour) reflector rules: which Bonjour services (listMdnsProfile) are bridged between which networks or VLANs. Returns every page. | network-services:r |
NAT and routing
| Tool | Description | Category |
|---|---|---|
createStaticRoute |
Create a gateway static route to one or more destination subnets. Create it with status:false first if you want to review it before it takes effect. | network-routing:rw |
updateStaticRoute |
Replace an existing static route, e.g. to enable/disable it or change its next hop. Changes affect live routing. | network-routing:rw |
deleteStaticRoute |
Delete a static route by ID. Traffic to its destinations falls back to other routes. | network-routing:rw |
createPolicyRoute |
Create a gateway policy-based route that steers matching traffic out of a chosen WAN or VPN (equivalent to UniFi traffic routes). | network-routing:rw |
updatePolicyRoute |
Replace an existing policy route, e.g. to enable/disable it or retarget the WAN/VPN. | network-routing:rw |
deletePolicyRoute |
Delete a policy route by ID. | network-routing:rw |
createPortForwardingRule |
Create a gateway port forwarding (DNAT) rule exposing a LAN host to the WAN. Exposes services to the internet when enabled; create with status:false to stage it. | network-nat:rw |
updatePortForwardingRule |
Replace an existing port forwarding rule, e.g. to enable/disable it or change ports. | network-nat:rw |
deletePortForwardingRule |
Delete a port forwarding rule by ID. | network-nat:rw |
createOneToOneNat |
Create a one-to-one (static) NAT rule on the gateway. Enabled rules expose the internal host; create with status:false to stage it. | network-nat:rw |
updateOneToOneNat |
Replace an existing one-to-one NAT rule. | network-nat:rw |
deleteOneToOneNat |
Delete a one-to-one NAT rule by ID. | network-nat:rw |
DNS and gateway services
| Tool | Description | Category |
|---|---|---|
createLanDnsRule |
Create a LAN DNS rule (local DNS record: A/AAAA answer, CNAME, or conditional forward) served by the gateway to the selected LAN networks. | network-lan:rw |
updateLanDnsRule |
Replace an existing LAN DNS rule. The preview lists fields that differ from the current rule. | network-lan:rw |
deleteLanDnsRule |
Delete a LAN DNS rule by ID. | network-lan:rw |
createDdnsEntry |
Create a dynamic DNS entry that keeps a hostname pointed at a gateway WAN address. | network-services:rw |
updateDdnsEntry |
Replace an existing dynamic DNS entry. The provider password must be resent because reads never return it. | network-services:rw |
deleteDdnsEntry |
Delete a dynamic DNS entry by ID. | network-services:rw |
setUpnpSetting |
Enable or disable UPnP on the gateway. Enabling UPnP lets LAN devices open inbound ports automatically. | network-services:rw |
setAlgSetting |
Enable or disable gateway application layer gateways (FTP, H.323, PPTP, SIP, IPsec passthrough). | network-services:rw |
setSnmpSetting |
Enable or disable SNMPv1/v2c and SNMPv3 on site devices. The community string and v3 password are write-only and are not verified by readback. | network-services:rw |
Filtering and threat management
| Tool | Description | Category |
|---|---|---|
createUrlFilterRule |
Create a gateway or AP URL/content filtering rule that blocks or allows URLs, keywords or categories for chosen networks, IP groups or SSIDs. | firewall-acl:rw |
updateUrlFilterRule |
Replace an existing URL filtering rule, e.g. to enable/disable it. | firewall-acl:rw |
deleteUrlFilterRule |
Delete a URL filtering rule by ID. | firewall-acl:rw |
createMacFilter |
Create a gateway MAC filtering allow/deny entry (UniFi MAC ACL). Takes effect when MAC filtering is enabled (getMacFilteringGeneralSetting); a deny entry blocks the listed devices. | wireless-auth:rw |
updateMacFilter |
Replace an existing MAC filtering entry. | wireless-auth:rw |
deleteMacFilter |
Delete a MAC filtering entry by ID. | wireless-auth:rw |
setAttackDefenseSetting |
Update gateway attack and DoS defense (flood limits, scan/ping-of-death protection, WAN ping blocking). | firewall-traffic:rw |
setIpsConfig |
Enable or disable gateway IDS/IPS (threat management). Inspection adds gateway load and can reduce throughput. | firewall-ids:rw |
VPN
| Tool | Description | Category |
|---|---|---|
updateSiteToSiteVpn |
Modify a site-to-site VPN, e.g. status:false to disable the tunnel. Tunnel traffic stops while it is down. | vpn:rw |
deleteSiteToSiteVpn |
Delete a site-to-site VPN. Traffic between the sites stops. | vpn:rw |
updateClientToSiteVpnServer |
Modify a client-to-site (remote access) VPN server, e.g. disable it. Connected remote users are dropped. | vpn:rw |
deleteClientToSiteVpnServer |
Delete a client-to-site VPN server. Remote users can no longer connect. | vpn:rw |
updateClientToSiteVpnClient |
Modify a gateway VPN client connection (the gateway dialing out to a VPN provider), e.g. disable it. | vpn:rw |
deleteClientToSiteVpnClient |
Delete a gateway VPN client connection. Policy routes using it stop working. | vpn:rw |
updateWireguard |
Replace a WireGuard interface, e.g. to enable/disable it or change its listen port. Peers reconnect. | vpn:rw |
deleteWireguard |
Delete a WireGuard interface. Its peers can no longer connect. | vpn:rw |
deleteWireguardPeer |
Delete a WireGuard peer. That remote device can no longer connect. | vpn:rw |
Devices and clients
| Tool | Description | Category |
|---|---|---|
locateDevice |
Blink (or stop blinking) the locate LED of an adopted gateway, switch or AP so it can be found physically. Does not affect traffic. | devices-general:rw |
forceProvisionDevice |
Force the controller to re-push the full configuration to an adopted device. The device can restart services or radios and briefly drop connected clients. | devices-general:rw |
adoptDevice |
Adopt a pending (discovered, not yet managed) device into this site using its default login; devices with changed credentials must be adopted in the controller UI. The controller then provisions it with site configuration, which can reboot it. | devices-general:rw |
startDeviceOnlineUpgrade |
Upgrade one adopted device to the latest firmware the controller offers online. Refused when getFirmwareInfo reports no newer version. The device reboots and its clients lose connectivity for several minutes. | devices-general:rw |
recoverSwitchPortPoe |
Power-cycle PoE on switch ports (PoE recovery) to reboot powered devices such as cameras or APs. Connected devices lose power and connectivity until they boot. | devices-switch:rw |
setClientName |
Rename a client (its display name in the controller). Does not affect connectivity. | clients:rw |
setClientLockToAp |
Pin a wireless client to specific APs (lock to AP) or remove the pin, e.g. to keep a static IoT device on its nearest AP. Locking to APs out of its range disconnects the client. | clients:rw |
authorizeHotspotClient |
Authorize a client on a hotspot (captive portal) network without it completing the portal, granting it internet access. The API reports acceptance only. | clients:rw |
unauthorizeHotspotClient |
Revoke hotspot (captive portal) authorization for a client; it must pass the portal again. The API reports acceptance only. | clients:rw |
Hotspot vouchers
| Tool | Description | Category |
|---|---|---|
createVoucherGroup |
Create a batch of hotspot guest vouchers. | hotspot-vouchers:rw |
deleteVoucherGroup |
Delete a voucher group and revoke its unused vouchers. | hotspot-vouchers:rw |
listVoucherGroups |
List hotspot voucher groups with their code counts, limits and validity. Returns every page. | hotspot-vouchers:r |
Site & Client
Site listing, client monitoring, and client-level operational controls (rate limits, block/unblock, reconnect).
Device
Device inventory, per-device detail (switches, gateways, APs), firmware, cable tests, and device configuration.
Network
WAN/LAN configuration, SSIDs, WLAN groups, routing, NAT, DHCP, DNS, firewall settings, bandwidth control, and related network services.
Firewall & ACL
802.1X authentication and RADIUS proxy settings.
Firewall Traffic & QoS
Traffic shaping, QoS policies, application control, URL filtering, and MAC filtering.
Firewall IDS / IPS
Intrusion detection and prevention system configuration.
Security & Threat Management
Global threat intelligence, IPS alerts, and top-threat summaries.
Composite Troubleshooting Tools
Single-call tools that internally aggregate multiple Omada API calls in parallel. Use these instead of chaining individual tools when you need a quick overview or are starting a troubleshooting session.
Dashboard / Monitor
Site dashboard widgets: WiFi and switch summaries, PoE usage, CPU/memory top-N, traffic activities, VPN tunnel stats, and RF analytics.
Insight
Site-level security insights: threat events, WIDS, rogue AP detection, and VPN tunnel stats.
VPN
Site-to-site and client-to-site VPN configuration, tunnel details, and user management.
Profiles
RADIUS, PPSK, service, QoS, schedule, group policy, VLAN, user role, and portal profiles.
Logs
Site-level and global event, alert, and audit logs.
Controller
Controller-level settings: certificates, ports, data retention, telemetry, and global dashboard.
Maintenance
Controller and site backups, restores, and rogue AP exports.
Account Users
User and role management for the controller.
Account Cloud
Cloud access, MFA, and remote binding status.
Schedules
PoE, port, reboot, and firmware upgrade schedules.
Devcontainer support
The repository includes a ready-to-use devcontainer configuration with a dedicated Omada controller sidecar for local development and testing. See .devcontainer/README.md for details.
License
This project is licensed under the MIT License.
Install
docker run -i --rm -e OMADA_BASE_URL=https://your-omada-controller.local -e OMADA_CLIENT_ID=your-client-id -e OMADA_CLIENT_SECRET=your-client-secret -e OMADA_OMADAC_ID=your-omadac-id -e OMADA_SITE_ID=your-site-id -e OMADA_STRICT_SSL=true ghcr.io/gaspareduard/omada-mcp:latestConfiguration
{
"mcpServers": {
"safe-omada": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "OMADA_BASE_URL=https://your-omada-controller.local",
"-e", "OMADA_CLIENT_ID=your-client-id",
"-e", "OMADA_CLIENT_SECRET=your-client-secret",
"-e", "OMADA_OMADAC_ID=your-omadac-id",
"-e", "OMADA_SITE_ID=your-site-id",
"-e", "OMADA_STRICT_SSL=true",
"ghcr.io/gaspareduard/omada-mcp:latest"
]
}
}
}