UniFi MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with UniFi MCP or direct API to monitor site inventory, check internet health, review SD-WAN configurations, and summarize network status through natural language.

UniFi logoUniFi
Api Key

UniFi is Ubiquiti's network management platform for sites, devices, and connectivity. It helps teams track inventory, internet health, and SD-WAN status in one place.

9 Tools

Try UniFi now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
UniFi
Try asking
TOOLS

Supported Tools

Every UniFi action and event your agent gets out of the box.

Get Host

Get detailed information for one UniFi host by the Site Manager host ID returned by List Hosts.

Get ISP Metrics

Get ISP performance metrics for all accessible sites, optionally limited by a relative duration or explicit timestamp bounds.

Get SD-WAN Config

Get the topology and settings of one SD-WAN configuration by ID.

Get SD-WAN Config Status

Get deployment, generation, WAN, tunnel, warning, and error status for one SD-WAN configuration.

List Devices

List UniFi devices managed by hosts where the connected UI account is an owner or super admin.

List Hosts

List UniFi hosts associated with the connected UI account.

List SD-WAN Configs

List the SD-WAN configurations associated with the connected UI account.

List Sites

List sites from UniFi Network applications associated with the connected UI account.

Query ISP Metrics

Get ISP performance metrics for selected host/site pairs.

SETUP GUIDE

Connect UniFi MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for UniFi
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'Show my UniFi Site Manager inventory and flag sites with poor internet health'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect UniFi API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute UniFi Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'List all UniFi sites and summarize internet health metrics for each site'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute UniFi actions with your Agent

Why Use Composio?

AI Native UniFi Integration

  • Supports both UniFi MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable UniFi Site Manager queries
  • Rich coverage for site inventory, internet health metrics, and SD-WAN configuration insights

Managed API Key Auth

  • Securely store UniFi API keys without hard-coding them in your agent code
  • Central place to manage, scope, and revoke UniFi access
  • Per user and per environment credentials, so production stays clean and safe

Agent Optimized Design

  • Tools are tuned for clear network operations like checking site health and device inventory
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf
  • Clean tool responses that help agents explain UniFi status without guesswork

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access UniFi
  • Scoped, least privilege access to UniFi Site Manager resources
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

Yes, UniFi requires you to configure your own API key. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with UniFi.It takes 30 seconds.

Managed auth, hosted MCP servers, and every UniFi tool your agent needs.Free to start.

Start building