ESP32 NAT Router

v1.0.0Cloud Servicesstable

An AI-enabled NAT Router/Firewall for the ESP32

dhcp-serveresp-idfesp32firewallhome-assistant-integration
Share:
1,965
Stars
0
Downloads
0
Weekly
0/5

What is ESP32 NAT Router?

ESP32 NAT Router is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ai-enabled nat router/firewall for the esp32

An AI-enabled NAT Router/Firewall for the ESP32

This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An AI-enabled NAT Router/Firewall for the ESP32

Use Cases

Configure NAT routing and firewall rules on ESP32 devices.
Monitor network traffic and DHCP server activity.
Integrate with Home Assistant for smart home automation.
martin-ger

Maintainer

LicenseMIT
Languagec
Versionv1.0.0
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx esp32-nat-router

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use ESP32 NAT Router

The ESP32 NAT Router is firmware for ESP32 microcontrollers that turns the device into a WiFi NAT router and firewall, routing traffic between a station interface (upstream WiFi) and a software access point (downstream clients). It supports advanced features including WireGuard VPN tunneling, DHCP reservations, port forwarding, firewall ACL rules, live PCAP capture streamed to Wireshark, and MQTT-based Home Assistant integration. A BETA MCP Bridge is built into the firmware, enabling AI assistants to configure and monitor the router through the Model Context Protocol without touching the web UI.

Prerequisites

  • An ESP32, ESP32-S2, ESP32-S3, or ESP32-C3/C5 development board
  • Python and esptool.py installed for CLI flashing (or Chrome/Edge/Opera for the web installer)
  • Access to a WiFi network to use as the upstream (STA) connection
  • An MCP-compatible client such as Claude Desktop (for the MCP Bridge feature)
  • Optional: Home Assistant instance for MQTT smart-home integration
1

Flash the firmware via the web installer

The easiest method is to open the browser-based installer at https://martin-ger.github.io/esp32_nat_router/ using Chrome, Edge, or Opera. Connect your ESP32 via USB, select your hardware variant, and click Connect & Install.

2

Flash via esptool (alternative)

Download the firmware binaries from the GitHub releases page and use esptool.py to flash all four images to the ESP32. Adjust chip type and firmware paths for your specific variant.

esptool.py --chip esp32 --before default_reset --after hard_reset \
  write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect \
  0x1000 firmware_esp32/bootloader.bin \
  0x8000 firmware_esp32/partition-table.bin \
  0xf000 firmware_esp32/ota_data_initial.bin \
  0x20000 firmware_esp32/esp32_nat_router.bin
3

Connect to the device's AP and configure upstream WiFi

After flashing, the device broadcasts an open network named 'ESP32_NAT_Router'. Connect to it, then open http://192.168.4.1 (or http://esp32-nat-router.local) to enter your upstream SSID and password.

4

Enable the MCP Bridge

Navigate to the advanced settings in the web UI or use the serial console to enable the BETA MCP Bridge. This starts the local MCP server endpoint that AI clients can connect to.

5

Configure your MCP client to connect to the bridge

Point your MCP client (e.g. Claude Desktop) to the ESP32's local IP address where the MCP Bridge is listening. The exact port depends on your firmware build — check the web UI for the MCP endpoint URL.

ESP32 NAT Router Examples

Client configuration

Connect Claude Desktop to the ESP32 NAT Router MCP Bridge endpoint running on the device's local IP. Replace 192.168.4.1 with the actual IP the ESP32 received on your network.

{
  "mcpServers": {
    "esp32-nat-router": {
      "command": "npx",
      "args": ["-y", "esp32-nat-router"],
      "env": {
        "ESP32_HOST": "http://192.168.4.1"
      }
    }
  }
}

Prompts to try

Once the MCP Bridge is connected, use these prompts in your AI client to manage the router.

- "Show me all current DHCP leases on the router"
- "Add a firewall rule to block outbound traffic on port 23"
- "Configure a port forwarding rule to forward port 8080 to 192.168.5.10:80"
- "Set up a WireGuard VPN tunnel to my home server"
- "Start a PCAP capture on the WAN interface and show me the traffic summary"

Troubleshooting ESP32 NAT Router

Web installer cannot find the ESP32 device over USB

Install the correct USB-to-serial driver for your board's chip (CP2102, CH340, or FTDI). On Linux, add your user to the 'dialout' group. Use only Chrome, Edge, or Opera — Firefox does not support WebSerial.

Throughput is much lower than expected (below 5 Mbps)

Throughput varies by ESP32 variant and enabled features. Disable features you are not using (VPN, PCAP, ACL statistics). Single-core ESP32 chips will be slower than dual-core variants. Consider upgrading to an ESP32-S3 for higher throughput.

MCP Bridge is not reachable from the AI client

Ensure the ESP32 has received a stable IP on your network (not just 192.168.4.1 AP address). Check that the MCP Bridge is enabled in the web UI, and that no firewall on the host machine is blocking the connection port.

Frequently Asked Questions about ESP32 NAT Router

What is ESP32 NAT Router?

ESP32 NAT Router is a Model Context Protocol (MCP) server that ai-enabled nat router/firewall for the esp32 It connects AI assistants to external tools and data sources through a standardized interface.

How do I install ESP32 NAT Router?

Follow the installation instructions on the ESP32 NAT Router GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with ESP32 NAT Router?

ESP32 NAT Router works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is ESP32 NAT Router free to use?

Yes, ESP32 NAT Router is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "esp32-nat-router": { "command": "npx", "args": ["-y", "esp32-nat-router"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use ESP32 NAT Router?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides