Skip to main content
The UniFi MCP Server lets your AI assistant manage the full lifecycle of your network configuration—from creating a new VLAN for IoT devices to updating DHCP ranges and adding port forwarding rules. Every change that modifies your network requires explicit confirmation, and you can preview any operation before it executes using dry-run mode.
Network configuration tools require the Local Gateway API (UNIFI_API_TYPE=local). Cloud API modes provide read-only access to network information only.

What you can do

List and inspect networks

View all networks, VLANs, and subnets with their DHCP configuration.

Create networks

Create new networks and VLANs with custom DHCP, subnets, and purposes.

Update and delete

Modify existing network settings or remove networks you no longer need.

Port forwarding

Configure external port forwarding rules for internal services.

Listing networks and VLANs

Example prompts:
  • “Show me all VLANs on this site”
  • “What networks are configured?”
  • “What is the DHCP range for the guest network?”
Response:

Network usage statistics

Get per-network bandwidth and client counts in one call. Example prompt: “How much bandwidth is each VLAN using right now?”
Response:

Creating a network

Use create_network to add a new network or VLAN. Always pass confirm=True to execute. Pass dry_run=True first to preview the payload that will be sent. Example prompts:
  • “Create a VLAN 20 for IoT devices with the subnet 192.168.20.0/24”
  • “Add a new guest network on VLAN 100”
Creating, updating, or deleting networks requires confirm=True. Without it, the tool returns an error. All changes are logged to audit.log.
1

Preview the change

Response:
2

Create the network

Network creation parameters

Updating a network

Example prompt: “Change the DHCP lease time on the LAN to 48 hours”

Deleting a network

Example prompt: “Delete the old test VLAN 99”
Deleting a network removes all associated DHCP leases and may disconnect clients on that VLAN. Use dry_run=True to validate before executing.

Port forwarding

Port forwarding rules let external traffic reach internal services. You can list, create, and delete rules through the AI assistant. Example prompts:
  • “Forward port 8080 from the internet to my web server at 192.168.2.100”
  • “Show all port forwarding rules”
  • “Remove the old Minecraft server port forward”

List rules

Response:

Create a port forward

Delete a port forward

Safety mechanisms

When asking your AI assistant to make network changes, it will automatically show you a dry-run preview and ask for confirmation before applying anything. This gives you a chance to review every change before it affects your live network.