Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

get_clients_for_site

Retrieve connected client devices from a UniFi network site to monitor network usage and manage access.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_clients_for_site' that invokes the UniFi API helper and returns formatted JSON response.
    handler: async ({ hostId, siteId }) => { const clients = await unifi.getClientsForSite(hostId, siteId); return { content: [{ type: 'text', text: JSON.stringify(clients, null, 2) }] }; }
  • Zod input schema validating hostId and siteId parameters.
    schema: z.object({ hostId: z.string().describe('The host ID'), siteId: z.string().describe('The site ID') }),
  • src/server.js:30-30 (registration)
    Registers the clientTools object (containing get_clients_for_site) with the MCP server via registerToolsFromModule.
    registerToolsFromModule(clientTools);
  • Helper function in unifi-client that performs the actual UniFi Cloud API GET request for site clients.
    export async function getClientsForSite(hostId, siteId) { const response = await cloudApi.get(`/v1/hosts/${hostId}/sites/${siteId}/clients`); return response.data; }

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