Skip to main content
Glama
vandreus

UniFi MCP Server

by vandreus

unifi_health

Check and monitor the health status of your UniFi network infrastructure to identify issues and ensure optimal performance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'unifi_health'. It invokes unifi.healthCheck() from the client library and formats the result as MCP content.
    handler: async () => {
      const health = await unifi.healthCheck();
      return {
        content: [{ type: 'text', text: JSON.stringify(health, null, 2) }]
      };
    }
  • The Zod input schema for 'unifi_health', which accepts no parameters.
    schema: z.object({}),
  • src/server.js:28-28 (registration)
    Registers the networkTools module, which includes the 'unifi_health' tool, with the MCP server.
    registerToolsFromModule(networkTools);
  • Helper function that checks UniFi Cloud API connectivity by listing hosts and returns health status.
    export async function healthCheck() {
      try {
        const hosts = await listHosts();
        return {
          ok: true,
          timestamp: new Date().toISOString(),
          hostsCount: hosts.data?.length || 0,
          apiBase: CLOUD_API_BASE
        };
      } catch (error) {
        return {
          ok: false,
          timestamp: new Date().toISOString(),
          error: error.message,
          apiBase: CLOUD_API_BASE
        };
      }
    }

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