Skip to main content
The UniFi MCP Server exposes the full firewall and security layer of your UniFi network to your AI assistant. You can create traditional firewall rules, organize networks into security zones with Zone-Based Firewall (ZBF), define Layer 3/4 access control lists, and build traffic matching lists—all through natural language prompts with built-in safety guardrails.
All firewall and security operations that create, modify, or delete rules require confirm=True. Mistakes in firewall rules can disrupt network connectivity. Always use dry_run=True to preview changes before applying them.

What you can do

Traditional firewall rules

Create, update, and delete WAN/LAN firewall rules with full traffic matching.

Zone-Based Firewall

Group networks into security zones and manage zone membership (Local API only).

ACL management

Define Layer 3/4 access control lists with rule ordering and priority.

Traffic matching lists

Build reusable IP, MAC, domain, and port lists for firewall rules.

Traditional firewall rules

Traditional firewall rules apply to traffic on specific rulesets: WAN_IN, WAN_OUT, LAN_IN, LAN_OUT, and others. You can create rules to accept, drop, or reject traffic based on source/destination IP, protocol, and port. Example prompts:
  • “Block all inbound traffic on port 22 from the internet”
  • “Show all firewall rules on the main site”
  • “Create a rule to drop traffic from 10.0.0.0/8 to the IoT VLAN”

List firewall rules

Create a firewall rule

1

Preview with dry run

Response:
2

Create the rule

Firewall rule parameters

Update and delete rules

Zone-Based Firewall (ZBF)

Zone-Based Firewall is a modern approach to network security that groups networks into logical security zones (such as LAN, Guest, IoT, DMZ) and controls traffic based on zone membership rather than individual IP rules. ZBF is available on UniFi Network Application 9.0 and later.
Zone-Based Firewall endpoints are only available when using the Local Gateway API (UNIFI_API_TYPE=local). These tools return an error if you are using a Cloud API mode. Zone-to-zone traffic policies must be configured in the UniFi Console UI—the API supports zone and network membership management only.
Example prompts:
  • “Create an IoT security zone and assign VLAN 20 to it”
  • “Show all configured firewall zones”
  • “Add the guest network to the Guest zone”

List zones

Response:

Create a zone

Assign a network to a zone

Remove a network from a zone

List networks in a zone

Update or delete a zone

Use dry run before creating or deleting zones to confirm the correct network IDs are being used. Zone names are case-sensitive.

ACL management

Layer 3/4 access control lists give you fine-grained control over traffic between network segments. ACLs support rule ordering and priority, making them suitable for complex inter-VLAN policies. Example prompts:
  • “Block the IoT VLAN from accessing the corporate LAN”
  • “Allow the management VLAN to reach all other VLANs”
ACL tools follow the same pattern as firewall rules: list, create, update, and delete, all requiring confirm=True for mutating operations.

Traffic matching lists

Traffic matching lists let you define reusable collections of IP addresses, MAC addresses, domain names, or port numbers. You can reference these lists in firewall rules instead of hard-coding individual values. Supported list types: Example prompts:
  • “Create an IP list called ‘trusted-admins’ with these addresses: 192.168.1.10, 192.168.1.11”
  • “Block all traffic to domains in the ‘social-media’ list”

Example: blocking IoT devices from reaching the corporate LAN

This walkthrough shows how to isolate IoT devices from the rest of your network.
1

Identify the networks

2

Preview the rule

3

Apply the rule

Safety summary