Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

get_clients_for_host

Retrieve client device information connected to a specific host on your UniFi network for monitoring and management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler that invokes the unifi.getClientsForHost helper and returns a formatted JSON response.
    handler: async ({ hostId }) => { const clients = await unifi.getClientsForHost(hostId); return { content: [{ type: 'text', text: JSON.stringify(clients, null, 2) }] }; }
  • Zod schema validating the input parameter 'hostId' as a string.
    schema: z.object({ hostId: z.string().describe('The host ID') }),
  • src/server.js:30-30 (registration)
    Registers the clientTools module, which includes the get_clients_for_host tool, with the MCP server.
    registerToolsFromModule(clientTools);
  • Helper function that performs the actual API call to retrieve clients for a specific host from the UniFi Cloud API.
    export async function getClientsForHost(hostId) { const response = await cloudApi.get(`/v1/hosts/${hostId}/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