zte-f680-mcp
MCP server to manage and inspect a ZTE ZXHN F680 GPON router conversationally.
List, add, modify, and delete NAT/port forwarding rules.
Quick-open a port with smart defaults, auto-detecting local IP and using the same internal port.
Detect the host IP in the router's subnet for port-forwarding targets.
Read device info: model, serial, firmware, hardware, bootloader, and WiFi chipsets.
Read WAN status: public IP, gateway, DNS, WAN MAC, connection type, and uptime.
Read WiFi info for both bands: SSID, channel, PSK, BSSID, and traffic stats.
List DHCP leases: connected devices with IP, MAC, hostname, connection type, and lease expiry.
View DMZ state and configured internal host.
List associated WiFi clients with RSSI signal strength.
Fetch and parse any router page generically.
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., "@zte-f680-mcp open port 8080"
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.
zte-f680-mcp
MCP Server (Model Context Protocol) to manage and inspect a ZTE ZXHN F680 GPON router from any MCP-compatible client (Claude Desktop, Claude Code, Cursor, Windsurf, OpenAI Agents SDK, Cline, Continue, etc.).
Control NAT / port forwarding and read WiFi, DHCP, DMZ, WAN and device status from your router conversationally, without opening the web UI.
Features
NAT / port forwarding
Tool | Description |
| List all NAT rules |
| Quick-open a port with smart defaults (auto-detect local IP, same port both sides) |
| Return the host IP in the router's subnet (cross-platform) |
| Add a rule with full control (ranges, custom internal IP/port) |
| Modify an existing rule by index |
| Delete a rule by index |
Read-only status (v0.3.0+)
Tool | Description |
| Model, serial, firmware, hardware, bootloader, WiFi chipsets |
| Public IP, gateway, DNS, WAN MAC, connection type, uptime |
| Both bands (SSID, channel, real PSK key, BSSID, traffic stats) |
| Connected devices (IP, MAC, hostname, connection type, lease expiry) |
| DMZ state + configured internal host |
| Associated WiFi clients with RSSI signal strength |
Generic
Tool | Description |
| Fetch and parse any page from the router |
Quick-open flow
Ask your assistant plainly and it will confirm before touching the router:
You: open port 8080 Assistant: Your local IP is
192.168.1.128. Should I forward8080 → 192.168.1.128:8080? You: yes Assistant: ✓ Rule added.
Under the hood the assistant calls zte_get_local_ip (to pick the correct interface even on multi-homed hosts) and then zte_open_port(port=8080). If you want a different internal port or IP, just say so and the assistant switches to zte_add_port_forward with your values.
What's new in v0.3.0
v0.3.0 adds six read-only tools that translate the router's cryptic internal fields into human-friendly tables. For example:
WiFi 2.4 GHz
SSID: HomeNetwork Canal: 1 (manual)
Estado: ON Estandar: g,n Ancho: 20MHz
Seguridad: WPA/WPA2 AES Clave: YourRealPassword
BSSID: 24:d3:f2:c6:97:b6 Oculta: NO
TxPower: 100% Max clientes: 16
Trafico: TX 1.29 GB / RX 97.9 MB Asociaciones: 1Under the hood, the codebase was split into focused modules (http_client, parsers, pages, formatters, server) and a new parser handles the router's third HTML layout (plain <td class="tdright"> tables used for WAN status). The project now ships with 32 unit tests running against real HTML fixtures captured from the router — no hardware needed to develop.
Related MCP server: router-mcp
Requirements
Python 3.10+
A ZTE ZXHN F680 router reachable on the local network
The admin credentials of the router's web panel
Install & configure
The easiest way is with uv (or pipx). No cloning, no venv.
Claude Desktop
Edit claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"zte": {
"command": "uvx",
"args": ["zte-f680-mcp"],
"env": {
"ZTE_HOST": "192.168.1.1",
"ZTE_USER": "1234",
"ZTE_PASSWORD": "your_password_here"
}
}
}
}Tip: avoid
zte-f680-mcp@latest. It makesuvxre-resolve against PyPI on every launch, which can exceed the client's startup timeout (30 s in Claude Code) and creates a new cached environment each time. Use the plain package name and upgrade on demand (see Upgrading existing installs).
Claude Code (CLI)
claude mcp add zte \
--env ZTE_HOST=192.168.1.1 \
--env ZTE_USER=1234 \
--env ZTE_PASSWORD=your_password_here \
-- uvx zte-f680-mcpCursor / Windsurf / Cline / Continue
Add the same block as Claude Desktop in the corresponding MCP settings file of each client.
OpenAI Agents SDK (Python)
from agents.mcp import MCPServerStdio
zte = MCPServerStdio(
params={
"command": "uvx",
"args": ["zte-f680-mcp"],
"env": {
"ZTE_HOST": "192.168.1.1",
"ZTE_USER": "1234",
"ZTE_PASSWORD": "your_password_here",
},
}
)Upgrading existing installs
If you registered the server before and want to jump to the newest release:
# Option 1: force-refresh the cache
uvx --refresh zte-f680-mcp
# Option 2: wipe the cache for this package only
uv cache clean zte-f680-mcpAfter this, the next time your MCP client launches the server, uvx will fetch the latest version.
v0.3.0 users: that release did not cap the
mcpdependency, so a fresh install pullsmcp2.x and the server fails to start (No module named 'mcp.server.fastmcp'). Upgrade to 0.3.1+ withuvx --refresh zte-f680-mcp.
Alternative: classic pip install
pip install --upgrade zte-f680-mcpThen point your MCP client at the installed script:
{
"mcpServers": {
"zte": {
"command": "zte-f680-mcp",
"env": {
"ZTE_HOST": "192.168.1.1",
"ZTE_USER": "1234",
"ZTE_PASSWORD": "your_password_here"
}
}
}
}Configuration
The server reads three environment variables (or a local .env file):
Variable | Default | Description |
|
| Router IP |
|
| Admin username |
| (none) | Admin password (required) |
Example prompts
Once the MCP is registered you can ask your assistant things like:
List the NAT rules on my ZTE router
Open TCP port 8080 forwarded to 192.168.1.100
Delete port forwarding rule number 2
Show the WiFi status (both bands)
Which devices are connected to the router?
What's my public IP and how long has the WAN been up?
Show me the WiFi clients with their signal strength
Is the DMZ enabled?
What firmware version is running?How it works
Auth:
SHA256(password + random)with dynamic tokens (Frm_Logintoken,Frm_Loginchecktoken) extracted from the login page.Session: Expires ~60 s idle. The server re-authenticates automatically every 45 s.
Anti-CSRF: Each write operation requires a fresh
_SESSION_TOKENfetched from the page.HTML parsing: Three formats coexist on the router —
Transfer_meaning('field','value')JS calls (most config pages),<td id="Frm_*">tables with HTML entity values (device info), and plain<td class="tdright">tables (WAN status). Each has its own dedicated parser.Protocol codes:
0= TCP+UDP,1= UDP,2= TCP.Transport: MCP over
stdio.
Stack
Development
git clone https://github.com/Picaresco/MCP-ZTE-F680.git
cd MCP-ZTE-F680
python -m venv venv && . venv/Scripts/activate # Windows
# source venv/bin/activate # Linux / macOS
pip install -e ".[test]"
cp .env.example .env # fill in your credentials
python -m zte_f680_mcp.serverRun the test suite (no router required — tests use captured HTML fixtures):
pytest tests/ -vTo regenerate fixtures from your own router (if firmware differs):
python scripts/capture_fixtures.pyLicense
MIT © Alberto Diaz
Available Tools
13 toolszte_add_port_forwardA
Anade una regla de port forwarding con control total.
Para el caso comun (un solo puerto -> IP local en el mismo puerto),
considera usar zte_open_port, que tiene defaults inteligentes.
Args: name: Nombre descriptivo de la regla (max 32 chars). protocol: "TCP", "UDP" o "TCP+UDP". external_port_start: Puerto externo inicial. external_port_end: Puerto externo final (igual que start para 1 puerto). internal_host: IP interna destino (ej: 192.168.1.100). internal_port_start: Puerto interno inicial. internal_port_end: Puerto interno final.
Inputs: name (required), protocol (required), internal_host (required), external_port_end (required), +3 more. Returns: result
zte_delete_port_forwardADestructive
Borra una regla de port forwarding por su indice.
Args: index: Indice de la regla (obtenido con zte_get_port_forwards).
Inputs: index (required). Returns: result
zte_get_device_infoARead-only
Devuelve modelo, serie, firmware, hardware, bootloader y chipsets WiFi.
Lee status_dev_info_t.gch. Esta pagina no incluye uptime, CPU ni RAM en el firmware Jazztel; esos datos viven en otras paginas.
Inputs: no named parameters. Returns: result
zte_get_dhcp_leasesARead-only
Lista los dispositivos conectados al router: IP, MAC, hostname, tipo de conexion (LAN/WiFi) y tiempo de expiracion del lease DHCP.
Inputs: no named parameters. Returns: result
zte_get_dmzARead-only
Devuelve el estado de la zona desmilitarizada (DMZ) y el host interno configurado como destino.
Inputs: no named parameters. Returns: result
zte_get_local_ipARead-only
Detecta la IP local del host en la subred del router.
En hosts multi-homed devuelve la IP del interfaz que enrutaria hacia ZTE_HOST, que es la que hay que usar como destino en port forwarding. Funciona en Linux, Windows y macOS sin dependencias externas.
Usa este tool ANTES de abrir un puerto para sugerir al usuario la IP por defecto. Ejemplo de flujo:
Usuario: "abre el puerto 8080"
zte_get_local_ip() -> "192.168.1.133"
Preguntar: "Redirijo 8080 -> 192.168.1.133:8080?"
Si confirma: zte_open_port(port=8080)
Inputs: no named parameters. Returns: result
zte_get_port_forwardsARead-only
Lista todas las reglas NAT/port forwarding configuradas.
Inputs: no named parameters. Returns: result
zte_get_wan_statusARead-only
Devuelve IP publica, gateway, DNS, MAC WAN, tipo de conexion y uptime del enlace WAN del router.
Inputs: no named parameters. Returns: result
zte_get_wifi_clientsARead-only
Lista los dispositivos conectados por WiFi con su RSSI (senal), banda, modo (11ac/11n) y tasa TX/RX.
Inputs: no named parameters. Returns: result
zte_get_wifi_infoARead-only
Devuelve SSIDs, canal, estandar, seguridad, clave PSK, BSSID y estadisticas de ambas bandas WiFi (2.4 y 5 GHz).
Inputs: no named parameters. Returns: result
zte_modify_port_forwardA
Modifica una regla de port forwarding existente.
Args: index: Indice de la regla (obtenido con zte_get_port_forwards). name: Nuevo nombre de la regla. protocol: "TCP", "UDP" o "TCP+UDP". external_port_start: Puerto externo inicial. external_port_end: Puerto externo final. internal_host: IP interna destino. internal_port_start: Puerto interno inicial. internal_port_end: Puerto interno final.
Inputs: name (required), index (required), protocol (required), internal_host (required), +4 more. Returns: result
zte_open_portA
Abre un puerto con defaults sensatos. Flujo conversacional recomendado.
Args:
port: Puerto externo a abrir.
protocol: "TCP", "UDP" o "TCP+UDP" (default).
internal_host: IP interna destino. Si None o "auto",
se detecta automaticamente la IP local del host en la subred
del router (llamando al helper equivalente a zte_get_local_ip).
internal_port: Puerto interno. Si None, se usa el mismo que port.
name: Nombre descriptivo. Si None, se genera como "port_".
Para rangos de puertos o control total, usa zte_add_port_forward.
Flujo recomendado: 1. Pide al usuario el puerto a abrir. 2. Llama a zte_get_local_ip y propon la IP detectada. 3. Confirma con el usuario antes de abrir (destino IP y puerto interno). 4. Llama a zte_open_port con los valores acordados.
Inputs: port (required), name, protocol, internal_host, +1 more. Returns: result
zte_run_pageARead-only
Obtiene y parsea cualquier pagina del router ZTE.
Args: page_name: Nombre de la pagina (ej: 'app_virtual_conf_t.gch'). raw: Si True, devuelve HTML crudo. Si False, parsea Transfer_meaning.
Paginas conocidas: - app_virtual_conf_t.gch (port forwarding) - app_dmz_conf_t.gch (DMZ) - app_upnp_conf_t.gch (UPnP) - net_dhcp_dynamic_t.gch (DHCP leases) - status_dev_info_t.gch (device info) - IPv46_status_wan_if_t.gch (WAN status) - net_wlanm_conf1_t.gch (WiFi 2.4GHz) - net_wlanm_conf2_t.gch (WiFi 5GHz) - sec_firewall_conf_t.gch (firewall)
Inputs: page_name (required), raw. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool targets a distinct router function (port forwarding CRUD, device info, DHCP, DMZ, WiFi, WAN), with clear descriptions. The overlap between zte_add_port_forward and zte_open_port is explicitly differentiated by purpose and defaults.
All tools follow a consistent 'zte_verb_noun' pattern (e.g., zte_get_device_info, zte_add_port_forward), using imperative verbs and snake_case throughout.
13 tools cover the essential router management operations without bloat. The count is well-scoped for a single-device admin server.
Core port forwarding operations (add, delete, modify) are covered, plus device info, DHCP, DMZ, WiFi, and WAN status. Missing some configuration like setting DMZ or WiFi settings, but a generic page runner (zte_run_page) allows extending functionality.
Maintenance
Related MCP Connectors
MCP server for network documentation, generated by doc2mcp.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Find MCP servers for ESP32, Arduino, 3D printers, Home Assistant, cameras and other hardware.
MCP server for OnceAsk, the AI-native current-address layer for people and agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for interfacing with AVM FRITZ!Box routers. Control smart home devices, monitor network status, and administer your router through any MCP-compatible client.10MIT
- AlicenseAqualityDmaintenanceMCP server for monitoring and controlling WiFi routers (OpenWrt) via SSH, enabling device listing, status checks, WiFi configuration, rebooting, and more.717 npmMIT
- AlicenseBqualityBmaintenanceMCP server for managing MikroTik RouterOS devices, enabling reading device state and performing guarded write operations such as setting identity via natural language.1142GPL 3.0
- AlicenseAqualityCmaintenanceRead-only MCP server for TP-Link Omada SDN controllers, enabling querying controller, site, device, and WiFi state.8Apache 2.0