Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

list_all_devices

Retrieve all network devices managed by the UniFi Cloud API for monitoring and configuration purposes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler function for 'list_all_devices'. It calls unifi.listAllDevices() and returns the devices as formatted JSON in the MCP content format.
    handler: async () => { const devices = await unifi.listAllDevices(); return { content: [{ type: 'text', text: JSON.stringify(devices, null, 2) }] }; }
  • Zod schema for the tool input, which takes no parameters.
    schema: z.object({}),
  • src/server.js:28-32 (registration)
    Registration of the deviceTools module (containing list_all_devices) into the MCP server via registerToolsFromModule.
    registerToolsFromModule(networkTools); registerToolsFromModule(deviceTools); registerToolsFromModule(clientTools); registerToolsFromModule(protectTools); registerToolsFromModule(accessTools);
  • Helper function that performs the actual API call to list all UniFi devices across all hosts and sites.
    export async function listAllDevices() { const response = await cloudApi.get('/v1/devices'); 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