feat(mcp): the UniFi network: WAN, devices, clients, events, alarms and config (#5839)

get_network gives the WAN, clients, Wi-Fi networks, speed tests and devices
by status; list_devices, list_clients (everyone seen, or the newest poll's
top talkers), list_network_events, list_alarms and get_network_config
(networks, port forwards, firewall rules) read what the poller stored.
get_overview names the WAN down while the poll is current, a device offline
or degraded that the controller still reports, and active alarms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 13:28:19 -04:00
co-authored by Claude Opus 5.5
parent 684a47b3eb
commit 2d88315bb1
4 changed files with 336 additions and 0 deletions
+10
View File
@@ -45,3 +45,13 @@ def get_alert_metrics() -> dict[str, list[str]]:
"""What scheduler.py records: the WAN (resource "wan") and the client count
(resource "clients")."""
return {"unifi": ["is_up", "latency_ms", "total_clients"]}
def register_mcp_tools(register) -> None:
from .mcp_tools import register_tools
register_tools(register)
async def mcp_overview(db) -> list[dict]:
from .mcp_tools import mcp_overview as findings
return await findings(db)