Skip to content

v0.2.0 — Quick-open ports with auto-detected local IP

Choose a tag to compare

@Picaresco Picaresco released this 14 Apr 22:21
· 2 commits to main since this release

Two new tools make opening ports almost conversational.

What's new

Tools added

  • zte_get_local_ip — returns the IP of the host in the router's subnet (cross-platform, multi-homed aware).
  • zte_open_port(port, protocol=\"TCP+UDP\", internal_host=None, internal_port=None, name=None) — opens one port with smart defaults: auto local IP, same port on both sides, auto-generated name.

Conversational flow

The server now ships MCP instructions that guide the LLM to:

  1. Detect your local IP.
  2. Ask "Redirijo 8080 → 192.168.1.X:8080?".
  3. Open the port only after you confirm.

Under the hood

  • Extracted _create_port_forward() helper, shared by zte_add_port_forward (unchanged) and the new zte_open_port.
  • _get_local_ip_for(target) uses the UDP+connect+getsockname trick — no packets sent, picks the correct interface automatically on Linux, Windows and macOS.
  • No new dependencies.

Backwards compatibility

✅ Fully backwards compatible. Existing zte_add_port_forward, zte_modify_port_forward, zte_delete_port_forward, zte_get_port_forwards, zte_run_page are unchanged.

Install / upgrade

New users: same command as before, just uvx picks the latest:

```bash
uvx zte-f680-mcp
```

Existing users: uvx caches, so force a refresh the first time:

```bash
uv cache clean zte-f680-mcp # or just wait for next cache purge
```

Example

User: abre el puerto 8080
Assistant: He detectado tu IP local como 192.168.1.128. ¿Redirijo 8080 → 192.168.1.128:8080?
User:
Assistant: ✓ Regla añadida. (+ shows new rule list)

Links