NetWarden
Integrates with Cisco Catalyst and CBS managed switches to configure ports, VLANs, and monitor switch health.
Integrates with MikroTik RouterOS v7 devices to manage router configuration, VLANs, firewall rules, and network segmentation.
Generates and applies OpenTofu configurations as an alternative to Terraform for declarative network infrastructure orchestration.
Integrates with OpenWrt devices via ubus/LuCI to configure and troubleshoot OpenWrt-based routers and access points.
Integrates with OPNsense firewalls to manage firewall rules, VLAN segmentation, and security hardening.
Integrates with pfSense firewalls to manage firewall rules, VLAN segmentation, and security hardening.
Integrates with Pi-hole DNS sinkhole to manage DNS filtering, client allowlisting, and network-wide ad blocking.
Generates and applies Terraform HCL configurations and tfvars for declarative network infrastructure, with plan, apply, and drift detection.
Integrates with Ubiquiti UniFi Controllers to discover, configure, and troubleshoot UniFi network devices such as routers, switches, and access points.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NetWardenharden my home network and fix any critical security issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NetWarden: Multi-Brand Home Network MCP Agent & Terraform Orchestrator
NetWarden is an intelligent Model Context Protocol (MCP) server and AI agent that seamlessly integrates into heterogeneous home and homelab networks. It allows AI models (such as Claude Desktop, Cursor, Antigravity, and Open-WebUI) to discover, configure, harden, and troubleshoot routers, managed switches, access points, and client devices across multiple brandsβall backed by declarative Terraform / OpenTofu Infrastructure-as-Code.
π Key Capabilities
Multi-Brand Hardware Support: Uniform driver abstraction across Ubiquiti UniFi, MikroTik RouterOS, OPNsense / pfSense, OpenWrt, Cisco Catalyst / CBS, and Pi-hole.
Zero-Hardware Simulation Mode: Built-in mock driver for immediate sandbox testing, CI/CD verification, and offline development without needing physical hardware attached.
Declarative Infrastructure as Code (Terraform):
Generates structured HCL and
network.tfvars.jsonfrom high-level network topology.Native execution via
terraformortofuCLI, with built-in high-fidelity fallback simulation.Real-time Drift Detection between live hardware state and declarative code.
Safety Guardrails & Lockout Prevention:
Prevents accidental disconnection by safeguarding administrative MACs, gateway IPs, and the primary management plane.
Pre-execution risk assessment scoring (
LOW,MEDIUM,HIGH,CRITICAL).Automatic versioned state snapshots before applies with instant One-Click Rollback.
Dedicated Scenario Engines:
Setup & Segmentation: Automated subnet allocation and zero-trust VLAN boundary rules (Management, Trusted LAN, IoT, Guest, Quarantine).
Zero-Trust Device Allowlisting: MAC-based admission control, static DHCP reservations, and automated containment for rogue devices.
Security Hardening: CIS and Homelab security audit engine with automated one-click remediation.
Diagnostics & Troubleshooting: Automated Layer 1 through Layer 7 triage (physical cable CRC error detection, link speed bottleneck diagnosis, latency, and firewall path evaluations).
Related MCP server: network-mcp-server
ποΈ Architecture Overview
graph TD
User([User / AI Assistant]) -->|MCP Protocol / stdio / SSE| Server[NetWarden MCP Server]
Server --> Safety[Safety Guardrails & Lockout Prevention]
Safety --> Scenarios[Scenario Engines: Setup | Hardening | Allowlist | Diagnostics]
Scenarios --> IaC[Terraform / OpenTofu Orchestrator]
Scenarios --> Drivers[Multi-Brand Drivers Engine]
Drivers --> UniFi[Ubiquiti UniFi Controller]
Drivers --> MikroTik[MikroTik RouterOS v7]
Drivers --> OPNsense[OPNsense / pfSense]
Drivers --> OpenWrt[OpenWrt ubus / LuCI]
Drivers --> Cisco[Cisco Managed Switches]
Drivers --> Pihole[Pi-hole DNS Sinkhole]
Drivers --> Mock[Simulated Network Lab]
IaC --> StateManager[State Snapshots & Instant Rollback]π Quickstart & Installation
Prerequisites
Python 3.10+
Git
(Optional) Terraform or OpenTofu CLI installed (
brew install opentofuorbrew install hashicorp/tap/terraform). If neither is installed, NetWarden operates in high-fidelity declarative simulation mode automatically.
1. Clone & Set Up Virtual Environment
git clone https://github.com/danielshaji1/home-network-mcp.git
cd home-network-mcp
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies and netwarden package
pip install -e ".[dev]"2. Verify with the Test Suite
pytest -v testsAll 28 unit and integration tests will run and pass in under a second.
π Connecting to MCP Clients
1. Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"netwarden": {
"command": "/Users/danielshaji/home-network-mcp/.venv/bin/python",
"args": ["/Users/danielshaji/home-network-mcp/mcp_server.py"]
}
}
}2. Cursor IDE
In Cursor Settings > Features > MCP, click Add New MCP Server:
Name:
netwardenType:
commandCommand:
/Users/danielshaji/home-network-mcp/.venv/bin/python /Users/danielshaji/home-network-mcp/mcp_server.py
3. Remote / Web Agents (SSE Transport)
To run NetWarden as a network service over Server-Sent Events (SSE):
python mcp_server.py --transport sse --host 0.0.0.0 --port 8000π οΈ MCP Tools Reference
NetWarden registers 16 specialized tools with full Pydantic type inference and docstrings:
Tool Category | Tool Name | Description |
Topology & Discovery |
| Returns all switches, routers, VLAN segments, and client breakdown. |
| Deep inspection of port link speeds, PoE consumption, and active VLANs. | |
Device Access Control |
| Lists clients ( |
| Authorizes device on a VLAN with optional static DHCP reservation. | |
| Isolates rogue or suspicious device into Quarantine Sandbox. | |
| Disables switch port or drops client traffic at firewall level. | |
Network Setup |
| Generates hardened VLANs and boundary firewall policies. |
Security Hardening |
| Performs CIS/Homelab security audit and calculates health score (0-100). |
| Automatically applies fixes for unapproved devices, TLS, and isolation. | |
Diagnostics |
| Multi-stage Layer 1-7 triage (ping, latency, loss, DNS, port errors). |
| Scans switch ports for bad patch cables (CRC errors) and 100M bottlenecks. | |
| Analyzes rules to explain why inter-VLAN traffic is permitted or dropped. | |
Terraform IaC |
| Compiles declarative manifests and computes plan with risk analysis. |
| Applies declarative configuration with pre-apply rollback snapshots. | |
| Catches out-of-band changes between live devices and Terraform state. | |
| Instantly restores network state to previous snapshot. |
π» Terminal CLI Utility
NetWarden includes a rich terminal CLI for direct command-line operations:
# View network topology and VLAN segments
netwarden topology
# List connected clients
netwarden clients
# Authorize a new device on IoT VLAN 30 with static DHCP IP
netwarden allow aa:bb:cc:dd:ee:ff 30 --name "Smart-Sensor" --ip 10.0.30.70 --category IoT
# Quarantine a rogue device into Quarantine Sandbox VLAN 99
netwarden quarantine aa:bb:cc:dd:ee:ff
# Run security hardening audit
netwarden audit
# Troubleshoot a degraded camera or host
netwarden diagnose Hikvision-Camera
# Preview declarative Terraform plan
netwarden plan
# Apply Terraform configuration with safety snapshot
netwarden applyπ Safety Guardrails & Lockout Protection
Configuring routers and switches via AI automation requires fail-safe guardrails. NetWarden protects you by:
Never blocking admin devices: MAC addresses and IPs specified in
protected_macsorprotected_ipscan never be dropped or quarantined.Management Plane Invariant: Rules that would sever connectivity to the management interface are rejected before execution.
Subnet Conflict Prevention: VLAN subnet allocations are mathematically verified against CIDR overlaps.
Pre-Apply Snapshots: Every apply creates a versioned snapshot in
terraform/backups/, enabling instant rollback withrollback_network_configuration().
π License
Distributed under the MIT License. See LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Verified AI free tiers plus source-backed agent and MCP discovery monitoring.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server and Home Assistant add-on that enables AI assistants to manage smart homes by creating automations, designing dashboards, and interacting with entities. It features native access to Home Assistant APIs, built-in Git versioning for safe rollbacks, and full management of HACS integrations.636MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for network operations that lets AI assistants interact with Cisco/Juniper network devices through safe, well-defined tools like compliance audits and configuration backups.MIT

Network Sketcherofficial
AlicenseAqualityAmaintenanceLocal-first MCP server that lets AI agents design Cisco-style networks and generate L1/L2/L3 topology diagrams, device tables, and AI-ready context files.1012408Apache 2.0- AlicenseNot gradedqualityAmaintenanceManage a fleet of OPNsense firewalls from an AI agent, inside guardrails it can't drive around. MCP server for central management of OPNsense firewall fleets. 129 tools across devices, config sync, tasks, schedules, templates, backups and remote consoles - destructive actions confirmation-gated, MCP-issued tokens lifetime-bounded, backup and storage secrets excluded from the toolset entirely.Apache 2.0