[Docs] API Documentation: Curated UniFi API reference resource #7

Closed
opened 2026-01-01 20:07:05 -06:00 by b3nw · 0 comments
Owner

Overview

Create api_docs.py with curated UniFi API documentation exposed as an MCP Resource.

Tasks

  • Research and document UniFi API endpoints
  • Create curated reference covering common operations
  • Implement MCP Resource at unifi://api-reference
  • Include authentication patterns
  • Include request/response examples

Endpoint Categories to Document

Authentication

  • POST /api/login - Session authentication
  • Cookie/CSRF token handling

Clients (sta = station)

  • GET /api/s/{site}/stat/sta - Active clients
  • GET /api/s/{site}/stat/alluser - All known clients (historical)
  • GET /api/s/{site}/stat/user/{mac} - Specific client
  • POST /api/s/{site}/cmd/stamgr - Client commands (block, unblock, reconnect)

Devices

  • GET /api/s/{site}/stat/device - All devices
  • GET /api/s/{site}/stat/device/{mac} - Specific device
  • POST /api/s/{site}/cmd/devmgr - Device commands (restart, adopt, upgrade)

Networks & VLANs

  • GET /api/s/{site}/rest/networkconf - Network configurations
  • GET /api/s/{site}/rest/wlanconf - WLAN configurations

Firewall

  • GET /api/s/{site}/rest/firewallrule - Firewall rules
  • GET /api/s/{site}/rest/firewallgroup - Firewall groups

Port Forwarding

  • GET /api/s/{site}/rest/portforward - Port forward rules

Routing

  • GET /api/s/{site}/rest/routing - Static routes

Statistics

  • GET /api/s/{site}/stat/health - Network health
  • GET /api/s/{site}/stat/sysinfo - System information
  • GET /api/s/{site}/stat/event - Recent events
  • GET /api/s/{site}/stat/alarm - Alarms

VPN

  • GET /api/s/{site}/rest/vpnclient - VPN clients
  • GET /api/s/{site}/rest/vpnserver - VPN servers

Hotspot/Vouchers

  • GET /api/s/{site}/stat/voucher - Vouchers
  • POST /api/s/{site}/cmd/hotspot - Hotspot commands

Acceptance Criteria

  • Resource accessible via unifi://api-reference
  • Covers 15+ commonly used endpoints
  • Includes example requests/responses
  • Agent can use docs to construct valid unifi_api_call requests
## Overview Create `api_docs.py` with curated UniFi API documentation exposed as an MCP Resource. ## Tasks - [ ] Research and document UniFi API endpoints - [ ] Create curated reference covering common operations - [ ] Implement MCP Resource at `unifi://api-reference` - [ ] Include authentication patterns - [ ] Include request/response examples ## Endpoint Categories to Document ### Authentication - `POST /api/login` - Session authentication - Cookie/CSRF token handling ### Clients (sta = station) - `GET /api/s/{site}/stat/sta` - Active clients - `GET /api/s/{site}/stat/alluser` - All known clients (historical) - `GET /api/s/{site}/stat/user/{mac}` - Specific client - `POST /api/s/{site}/cmd/stamgr` - Client commands (block, unblock, reconnect) ### Devices - `GET /api/s/{site}/stat/device` - All devices - `GET /api/s/{site}/stat/device/{mac}` - Specific device - `POST /api/s/{site}/cmd/devmgr` - Device commands (restart, adopt, upgrade) ### Networks & VLANs - `GET /api/s/{site}/rest/networkconf` - Network configurations - `GET /api/s/{site}/rest/wlanconf` - WLAN configurations ### Firewall - `GET /api/s/{site}/rest/firewallrule` - Firewall rules - `GET /api/s/{site}/rest/firewallgroup` - Firewall groups ### Port Forwarding - `GET /api/s/{site}/rest/portforward` - Port forward rules ### Routing - `GET /api/s/{site}/rest/routing` - Static routes ### Statistics - `GET /api/s/{site}/stat/health` - Network health - `GET /api/s/{site}/stat/sysinfo` - System information - `GET /api/s/{site}/stat/event` - Recent events - `GET /api/s/{site}/stat/alarm` - Alarms ### VPN - `GET /api/s/{site}/rest/vpnclient` - VPN clients - `GET /api/s/{site}/rest/vpnserver` - VPN servers ### Hotspot/Vouchers - `GET /api/s/{site}/stat/voucher` - Vouchers - `POST /api/s/{site}/cmd/hotspot` - Hotspot commands ## Acceptance Criteria - Resource accessible via `unifi://api-reference` - Covers 15+ commonly used endpoints - Includes example requests/responses - Agent can use docs to construct valid `unifi_api_call` requests
b3nw closed this issue 2026-01-01 20:21:24 -06:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: b3nw/unifi-mcp-light#7