Skip to main content
Glama
nntkio

UniFi MCP Server

by nntkio

restart_device

Restart UniFi network devices using their MAC addresses to resolve connectivity issues or apply configuration changes.

Instructions

Restart a UniFi network device by its MAC address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
macYesMAC address of the device to restart (e.g., '00:11:22:33:44:55')

Implementation Reference

  • Registers the 'restart_device' tool including name, description, and input schema within the MCP server's list_tools() function.
    Tool( name="restart_device", description="Restart a UniFi network device by its MAC address", inputSchema={ "type": "object", "properties": { "mac": { "type": "string", "description": "MAC address of the device to restart (e.g., '00:11:22:33:44:55')", } }, "required": ["mac"], }, ), # Client tools
  • MCP tool handler in call_tool() that processes 'restart_device' arguments, invokes UniFiClient.restart_device(mac), and returns success TextContent.
    case "restart_device": mac = arguments.get("mac", "") await client.restart_device(mac) return [ TextContent( type="text", text=f"Restart command sent to device {mac}", ) ]
  • Executes the actual UniFi API call to restart the device by posting to /api/s/{site}/cmd/devmgr with restart command and normalized MAC address.
    async def restart_device(self, mac: str) -> bool: """Restart a network device. Args: mac: Device MAC address. Returns: True if restart command was sent successfully. """ await self._request( "POST", "/api/s/{site}/cmd/devmgr", json={"cmd": "restart", "mac": mac.lower()}, ) return True

Latest Blog Posts

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/nntkio/unifiMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server