Skip to main content
Glama

curfew

A dinner bell for your home Wi-Fi.

curfew turns the internet off for the kids' devices and leaves the rest of the house alone: the servers, the cameras, the thermostat, and whatever else in your home has decided it needs Wi-Fi. The trick is not clever. Put the kids on the router's guest network, then switch that network off with one command, on a schedule, or by asking an AI agent. It talks to the router directly over the local network. No cloud account, no subscription.

How it got here, including the two weeks spent building the wrong thing first: The Case of the YouTube Shorts That Survived Every Parental Control.

Will it work on my router?

It is built and tested on a NETGEAR Nighthawk CAX80, firmware V5.1.1.8. Other NETGEAR routers speak the same kind of local API, so many commands may just work, but I have only tested mine. To see what yours supports, run the discovery script (see Hacking on it); it probes every action read-only and writes a report.

No NETGEAR? The idea still works: most routers' own apps can switch the guest network on and off. You just do it by hand.

You need Python 3.12+ and uv.

Related MCP server: archer-router-mcp

Try it in five minutes

git clone https://github.com/sergenes/curfew.git && cd curfew
uv sync
cp .env.example .env              # set CURFEW_PASSWORD, your router's admin password
uv run curfew status              # model, firmware, uptime: proof it can reach the router
uv run curfew wifi                # both bands, including whether the guest network is on

Then the main event. Warn the household first, because you will be asked questions:

uv run curfew guest off           # guest Wi-Fi off on both bands
uv run curfew guest on

Heads up: the main Wi-Fi blinks too. The router applies any guest network change by restarting its wireless radios, and the guest and main networks share those radios. So every guest on or guest off, whether you run it or a schedule does, knocks everyone off Wi-Fi for 30 to 60 seconds, not just the kids. Devices reconnect on their own, but calls drop and streams stall. This is the router's firmware, not curfew: flipping the guest network in NETGEAR's own web page does the same. Wired devices are not affected.

The setup that works

  1. Turn on the router's guest network and give it a name the kids will recognise.

  2. Move the kids' phones, tablets, and laptops onto it. The TVs too, if screens in the living room count.

  3. Keep everything else, the smart home included, on the main network.

  4. Keep the main Wi-Fi password to yourself. This is the hardest step.

It does not care which device is which, so the private, rotating MAC addresses on iPhones and iPads cannot slip past it, and there is no device list to maintain.

Bedtime on a schedule

uv run curfew guest schedule --from 21:00 --to 07:00 --name kids-wifi-night
uv run curfew guest schedule --from 22:00 --to 06:30 --days weekdays --band 5
uv run curfew schedule list       # shows "guest wifi off both 21:00-07:00", active or idle
uv run curfew schedule remove <id>

Schedules fire from the watcher, so it has to be running: uv run curfew watch in a terminal, uv run curfew watcher install to run it at login on a Mac, or a systemd service on an always-on Linux box (docs/linux-box.md).

A schedule acts only at the edges of its window. If Friday is movie night and you run guest on at nine thirty, it stays on until the next boundary, and the schedule does not argue.

Ask an agent instead

curfew ships an MCP server, so any MCP-capable agent can run it for you. .mcp.json registers it with Claude Code when you start Claude Code in this folder; elsewhere, run uv run curfew-mcp (stdio).

Then just say it: "turn off the kids' Wi-Fi", "no Wi-Fi for the kids after ten on school nights", "what schedules are set?" The tools behind those are set_guest_wifi, add_guest_schedule, list_schedules, and remove_schedule, alongside read-only ones like router_status, wifi_info, and list_devices.

What it cannot do

  • Mobile data. A phone on a data plan switches to cellular when the Wi-Fi goes. The router has no say; your carrier might (on Google Fi, the plan owner can pause a member's data from the Fi app).

  • Downloaded video. Shorts already on the device keep playing until they run out. The internet is gone; the buffer is not. Give it a minute.

  • A leaked password. If the kids know the main Wi-Fi password, they know the way around. See step 4.

Poke around

uv run curfew status              # model, firmware, uptime, WAN, LAN, Access Control
uv run curfew wifi                # both bands, channels, security, guest state
uv run curfew devices             # who is attached right now
uv run curfew log                 # DHCP leases, Access Control decisions, attack warnings
uv run curfew traffic             # traffic meter totals
uv run curfew firmware            # ask the router for updates (about 10 s)

Every command takes --json, and every change curfew makes is appended to ~/.curfew/changes.log. Local state lives in ~/.curfew/; set CURFEW_DATA_DIR to move it.

The detours

Before the guest network turned out to be the answer, curfew grew a device registry, per-device blocking at the router, an instant per-device pause, and a DNS website filter. They still work, and they are useful when you need to single out one device on the main network. Everything about them is in docs/detours.md.

Hacking on it

uv run ruff check . && uv run ruff format --check .
uv run mypy
uv run pytest                        # recorded router responses, no router needed
uv run pytest -m live                # smoke test against the real router
uv run python scripts/discover.py    # probe every router action read-only, write discovery/SUMMARY.md
uv run python scripts/make_fixtures.py   # refresh sanitized fixtures from discovery dumps

The tests run against real responses recorded from firmware V5.1.1.8, with MACs, SSIDs, serial and public addresses replaced by synthetic values, so you can change the code without touching a router. The router updates its own firmware, and NETGEAR can change response layouts between versions. When a command breaks after an update: re-run discover.py and diff discovery/SUMMARY.md, fix the parser in curfew/actions.py (errors include the raw XML), regenerate fixtures with make_fixtures.py, and run pytest until green.

The code, briefly:

curfew/soap.py          async SOAP client: login, session refresh, config mode
curfew/actions.py       one function per router action, typed results
curfew/registry.py      SQLite device registry, groups, schedules, overrides
curfew/scheduler.py     rule evaluation in local time, manual override precedence
curfew/services/        compositions: status, wifi, devices, control, and the detours
curfew/mcp_server.py    MCP server (stdio)
curfew/cli.py           typer CLI
scripts/                discovery and fixture tooling
tests/                  fake router, recorded fixtures, temp registries

Design notes and the roadmap are in PLAN.md; what the firmware supports is in discovery/SUMMARY.md.

Companion writing

License and author

MIT, see LICENSE. Sergey Neskoromny. Reach me on LinkedIn.

Available Tools

24 tools
access_statusB
Read-only

Whether Access Control is on, which devices are blocked and why, and which schedules are active.

Inputs: no named parameters. Returns: object

add_scheduleA
Idempotent

Block a group, owner or device every day between start and end (local time, e.g. 21:00 to 07:00).

days: daily, weekdays, weekends, or a list like mon-fri or sat,sun.
Enforced by the background watcher or by apply_schedules.

Inputs: end (required), start (required), target (required), days, +1 more. Returns: object

apply_schedulesB
Idempotent

Evaluate schedules and manual overrides now and push any needed allow/block changes to the router.

Inputs: no named parameters. Returns: object

check_firmwareA
Read-only

Ask the router whether a firmware update is available. Slow: about 10 seconds.

Inputs: no named parameters. Returns: object

device_historyC
Read-only

Presence sessions for one device (MAC, nickname, router name or IP): when it joined and left.

Inputs: device (required), limit. Returns: object

known_devicesB
Read-only

Everything the registry remembers, online or not. Filter by owner, tag, or online state.

Inputs: tag, owner, online_only. Returns: object

list_devicesB
Read-only

Every device attached to the router right now, merged with nicknames, owners, tags and vendor.

Also records the sighting in the local registry. Takes a few seconds; the router is slow here.

Inputs: no named parameters. Returns: object

list_groupsB
Read-only

Device groups (kids, parents, iot, ...) with their members and current access state.

Inputs: no named parameters. Returns: object

list_pausedA
Read-only

Devices currently held in Eclipse Pause, and whether the enforcement daemon is running.

Inputs: no named parameters. Returns: object

list_schedulesA
Read-only

All schedules with whether each is active right now.

Inputs: no named parameters. Returns: object

name_deviceA
Idempotent

Assign a nickname, owner, tags or notes in the local registry (nothing changes on the router).

device: MAC, current nickname, router name or IP. Pass "" to clear a field; omit to leave it alone.

Inputs: device (required), tags, notes, owner, +1 more. Returns: object

pause_deviceA
Idempotent

Instantly cut a group, owner or device off the internet via Eclipse Pause (ARP interception).

This is the immediate cutoff that works on already-connected devices, unlike the MAC block.
The device stays on wifi and reachable on the LAN. Records the pause; the eclipse daemon
(running as root) enforces it within a couple of seconds. Use resume_device to lift it.

Inputs: target (required), reason. Returns: object

reboot_routerA
Destructive

Reboot the router. Everyone loses internet for about two minutes. Requires confirm=true.

Inputs: confirm. Returns: object

remove_scheduleB
Idempotent

Delete a schedule by id. Devices it blocked are released at the next apply.

Inputs: schedule_id (required). Returns: object

resume_deviceA
Idempotent

Lift an Eclipse Pause for a group, owner or device, or all_devices=true for everyone.

Inputs: target, all_devices. Returns: object

router_statusC
Read-only

Router model, firmware, uptime, CPU and memory, WAN state, LAN, Access Control, device count.

Inputs: no named parameters. Returns: object

scan_networkA
Read-only

Refresh the registry from the router and report what changed: new devices, returned, left.

Inputs: no named parameters. Returns: object

set_accessA
Idempotent

Turn internet access on or off for a group (e.g. "kids"), an owner (e.g. "Sam") or one device.

Blocking uses the router's Access Control; it is enabled automatically the first time. A manual change lasts until the target's next scheduled change, or until flipped back if it has none.

Inputs: target (required), enabled (required), reason. Returns: object

set_group_membershipA
Idempotent

Add a device to a group (member=true) or remove it (member=false). Groups are created on first use.

Inputs: group (required), device (required), member. Returns: object

set_guest_wifiA
Idempotent

Turn the guest wifi network on or off. band: 2.4, 5, or both.

Inputs: enabled (required), band. Returns: object

system_logB
Read-only

Recent router log entries, newest first: DHCP leases, Access Control decisions, attack warnings.

category filters by substring, e.g. 'DHCP' or 'Access Control'.

Inputs: limit, category. Returns: object

traffic_statsA
Read-only

Traffic meter totals for today, yesterday, week, month. Zero unless the meter is enabled.

Inputs: no named parameters. Returns: object

who_is_newA
Read-only

Devices first seen after since ('7d', '24h', '30m', or an ISO date). Runs a scan first.

Inputs: since. Returns: object

wifi_infoB
Read-only

SSIDs, channels, security mode and guest network state for the 2.4 GHz and 5 GHz bands.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 24 tools

    Disambiguation3/5

    Several tools cluster around the same concepts: known_devices vs list_devices vs scan_network vs who_is_new all address device inventory, and set_access vs pause_device both cut internet access (distinguished only by a paragraph of prose about MAC vs ARP blocking). The descriptions do help, but an agent must read carefully to pick correctly between the two blocking mechanisms and the four discovery tools.

    Naming Consistency3/5

    Verb prefixes are used consistently within families (list_*, set_*, add_/remove_*), but many tools are bare noun phrases (known_devices, device_history, system_log, wifi_info, traffic_stats, router_status, access_status), giving a mixed convention. It remains readable but there is no single predictable pattern.

    Tool Count4/5

    24 tools is on the heavy side, but the domain is genuinely broad (device discovery, groups, two distinct blocking mechanisms, scheduling, wifi, diagnostics, reboot), so most tools earn their place. Slightly over-scoped rather than padded.

    Completeness4/5

    Coverage is strong: full lifecycle for schedules (add/list/remove/apply) and both pause and access-control paths, plus discovery, naming, status and diagnostics. Minor gaps exist, such as no schedule edit/update and no way to remove devices or groups from the local registry.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to monitor and control Nokia G-2425G-A GPON home routers (e.g., Airtel) via natural language, including listing connected devices, and blocking or unblocking internet access for specific devices.
      5
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables LLM/MCP clients to read and, when explicitly allowed, modify TP-Link Archer AX53 router settings directly over the LAN using the router's own web protocol, without a browser or cloud account. It is read-first, write-gated, and lockout-aware, with tools for clients, DHCP, Wi-Fi, access control, presence history, and other router operations.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to interact with Netgear Genie cable modems to retrieve hardware status, DOCSIS channel data, RF signal health diagnostics, and event logs, and to perform confirmed modem reboots or log clearing.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLM clients to inspect and manage a TP-Link Deco mesh Wi-Fi network, covering mesh nodes, connected devices, SSIDs and radio settings, internet status, blocked clients, and DHCP address reservations. Runs entirely against the router on the local network without any cloud account.
      15
      MIT