Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

unblock_client

Unblock a client from the UniFi network to restore internet access after being blocked by network policies or security measures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'unblock_client' MCP tool. It invokes the UniFi API via unifi.unblockClient, handles the response, and returns formatted text output.
    handler: async ({ hostId, siteId, mac }) => {
      const result = await unifi.unblockClient(hostId, siteId, mac);
      return {
        content: [{ type: 'text', text: `Client ${mac} has been unblocked. ${JSON.stringify(result, null, 2)}` }]
      };
    }
  • Zod schema defining input parameters for the unblock_client tool: hostId, siteId, and mac address.
    schema: z.object({
      hostId: z.string().describe('The host ID'),
      siteId: z.string().describe('The site ID'),
      mac: z.string().describe('The client MAC address')
    }),
  • src/server.js:30-30 (registration)
    Registration of the clientTools module (containing unblock_client) to the MCP server via registerToolsFromModule, which calls server.tool() for each tool.
    registerToolsFromModule(clientTools);
  • Underlying helper function that makes the actual POST request to the UniFi Cloud API to unblock the client.
    export async function unblockClient(hostId, siteId, mac) {
      const response = await cloudApi.post(`/v1/hosts/${hostId}/sites/${siteId}/clients/${mac}/unblock`);
      return response.data;
    }
  • src/server.js:4-4 (registration)
    Import of the clientTools module, which includes the unblock_client tool definition.
    import { clientTools } from './tools/clients.js';

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/vandreus/Unifi-MCP'

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