unblock_client
Remove network access restrictions for a specific device by its MAC address to restore connectivity on UniFi networks.
Instructions
Unblock a previously blocked client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mac | Yes | MAC address of the client to unblock |
Implementation Reference
- src/unifi_mcp/server.py:74-87 (schema)Defines the input schema for the unblock_client MCP tool, specifying a required 'mac' string parameter.Tool( name="unblock_client", description="Unblock a previously blocked client", inputSchema={ "type": "object", "properties": { "mac": { "type": "string", "description": "MAC address of the client to unblock", } }, "required": ["mac"], }, ),
- src/unifi_mcp/server.py:196-204 (handler)The handler logic within the call_tool function that executes the unblock_client tool by calling the UniFiClient's unblock_client method and returning a success message.case "unblock_client": mac = arguments.get("mac", "") await client.unblock_client(mac) return [ TextContent( type="text", text=f"Client {mac} has been unblocked.", ) ]
- Low-level helper method in UniFiClient that sends the UniFi API request to unblock the client using the 'unblock-sta' command.async def unblock_client(self, mac: str) -> bool: """Unblock a client from the network. Args: mac: Client MAC address. Returns: True if unblock command was sent successfully. """ await self._request( "POST", "/api/s/{site}/cmd/stamgr", json={"cmd": "unblock-sta", "mac": mac.lower()}, ) return True