tplink-modem-mcp
This MCP server lets you monitor and administer a TP-Link router or ISP modem on your local network — inspecting status, clients, Wi-Fi, logs and DHCP, and making changes only after explicit confirmation.
Monitor the router: model, firmware, internet status, external IP, uptime, LAN address, and online device count (
router_status), plus WAN/LAN IPv6 (ipv6_status).See who is connected: hostnames, IPs, MACs, wired/Wi-Fi band, SSID, signal strength and link rate (
list_clients,find_client), optionally including inactive devices.Track device presence: join/leave/IP-change history sampled by the server, since routers keep no such log (
client_history).Inspect Wi-Fi: every SSID with band, channel, standard and on/off state (
wifi_networks).Read logs: system log filtered by module, text/MAC or severity (
router_logs).Manage DHCP: view active leases and fixed-IP reservations (
dhcp_leases,dhcp_reservations); add/update or remove a reservation (set_static_ip,remove_static_ip).Explore all settings: list every web-UI settings object and operation (
router_objects) and read any object or row (router_read).Change anything the web panel can: set/add/delete settings objects (
router_change) or run router operations like DHCP renew or PPPoE reconnect (router_run), and change Wi-Fi name/password/on-off/hidden (set_wifi).Reboot the router (
reboot_router).Safety by design: all change tools only preview unless called again with
confirm=true; read tools are read-only; secrets are masked; supports multiple devices via an optionaldeviceparameter.
Lets an AI assistant manage a TP-Link router or ISP-supplied TP-Link modem on the local network through the router's web panel. Provides tools to read router status, firmware and WAN/LAN info, list connected clients with band, SSID, signal (dBm) and link rate, search for a device, view system logs and DHCP leases/reservations, inspect IPv6 status, and browse/read any settings object exposed by the web UI. Also supports changes such as assigning or removing a device's fixed IP, renaming/securing/toggling Wi-Fi networks, editing other settings objects (port forwarding, firewall, parental control, DNS, QoS, time), running router operations like DHCP renew or PPPoE reconnect, and rebooting — all previewed first and applied only after confirmation. It keeps its own presence history of device join/leave/IP-change events since routers do not log them.
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., "@tplink-modem-mcp which devices are on the Wi-Fi right now, and which has the weakest signal?"
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.
tplink-modem
A command line and an MCP server for a TP-Link router or an ISP-supplied TP-Link modem on your local network, for you, your scripts or your AI agent, so you never have to open its web panel: see who is connected and how strong their Wi-Fi signal is, give a device a fixed IP, change the Wi-Fi, read the logs, and change anything else the web panel can. Every change is shown to you first and only applied once you approve it.

It builds on tplinkrouterc6u, so every model that library
supports works. On top of it, it adds a client for older ISP firmwares that library does not detect, for example
the Archer C5v that Türk Telekom ships, whose web UI logs in through /cgi/login?UserName=…&Passwd=….
Ask things like:
"Which devices are on the Wi-Fi right now, and which one has the weakest signal?"
"The TV keeps dropping off. When did it leave and come back today?"
"Show me the router's DHCP errors from the last hour."
"Give the printer a fixed IP, 192.168.1.50."
"Turn the guest Wi-Fi off." / "Forward port 25565 to my PC."
Command line
uv tool install tplink-modem # or: pipx install tplink-modem
export TPLINK_PASSWORD='<router password>'
tplink-modem status # model, internet, Wi-Fi, devices online
tplink-modem clients # who is connected, with signal and link rate
tplink-modem find tv
tplink-modem logs --module DHCPD --limit 20
tplink-modem history --hours 6 # who joined and left (see Presence history)Changes show what they would do and stop; add --confirm to apply:
$ tplink-modem static-ip AA:BB:CC:DD:EE:FF 192.168.1.50
would do: reserve 192.168.1.50 for AA:BB:CC:DD:EE:FF
Not applied. Run again with --confirm to apply.
$ tplink-modem static-ip AA:BB:CC:DD:EE:FF 192.168.1.50 --confirmOutput is short plain text; --json prints the raw result for scripts. tplink-modem --help lists every command,
and each one matches an MCP tool below: read, change and run reach any setting the web panel has. Exit codes:
0 done (or previewed), 1 the router or the policy refused, 2 wrong usage.
Agents that can run shell commands can use the command line instead of the MCP server; it costs them far fewer tokens, since no tool list is loaded up front.
Related MCP server: miwifi-mcp
MCP tools
Tool | What it does |
| Model, firmware, internet connection (status, external IP, uptime), LAN address, Wi-Fi networks, devices online |
| Devices with hostname, IP, MAC, wired or Wi-Fi band and SSID, signal (dBm) and link rate |
| Search devices by name, IP or MAC |
| Join / leave / IP-change events recorded by this server (routers keep no such log) |
| Every SSID with band, channel and on/off |
| System log, filtered by module, text or severity |
| DHCP leases and fixed addresses |
| WAN / LAN IPv6 |
| Every settings object the web panel uses (Wi-Fi, DHCP, port forwarding, firewall, parental control, DNS, QoS, time, ...) and the operations it can run |
| Read any of those objects |
| Give a device a fixed IP, or take it away |
| Change a Wi-Fi network's name, password, on/off, hidden |
| Change, add or delete anything else the web panel can ( |
| Run a router operation such as renewing DHCP or reconnecting PPPoE |
| Reboot |
How changes are approved
A tool that changes the router never does it on the first call. It returns what it would do; the assistant shows
that to you, and only calls again with confirm=true once you say yes. If your MCP client can ask you itself
(MCP elicitation), the server also asks you directly before applying. Passwords and keys are masked in everything
the server returns.
router_objects, router_read, router_change and router_run work on TP-Link's CGI firmwares: the older ISP
modems and the MR / VR families. On other models the curated tools that tplinkrouterc6u supports still work.
MCP server
You need uv and the router's web admin password. The server has to run on a machine in the same network as the router.
Claude Code:
claude mcp add tplink-modem -e TPLINK_PASSWORD='<router password>' -- uvx tplink-modem mcpClaude Desktop, Cursor and other clients that take a JSON config:
{
"mcpServers": {
"tplink-modem": {
"command": "uvx",
"args": ["tplink-modem", "mcp"],
"env": { "TPLINK_PASSWORD": "<router password>" }
}
}
}From a clone instead of PyPI: uv --directory /path/to/tplink-modem run tplink-modem mcp.
This project was called tplink-modem-mcp before 0.3.0. If your config runs uvx tplink-modem-mcp, change it to
uvx tplink-modem mcp: the last tplink-modem-mcp release only installs tplink-modem, which keeps the old
tplink-modem-mcp command working. The old presence history folder keeps being used if it exists.
Settings
Variable | Default | |
| (required) | web admin password |
|
| router address |
|
| |
| auto |
|
|
| seconds per request to the router |
|
| seconds between presence samples while the server runs; |
|
| where the presence history is kept |
|
| how long a device stays locked after three refused logins |
|
| log level, |
|
|
|
| (all) | comma-separated objects or operations that may be changed, |
| (none) | objects or operations that may never be changed, e.g. |
|
|
|
Nothing is narrowed by default: the assistant can change whatever the web panel can, always with your approval.
Narrow it when you want to, for example TPLINK_ALLOW=LAN_DHCP_STATIC_ADDR,LAN_WLAN for fixed IPs and Wi-Fi only.
TP-Link routers allow one admin session at a time. Calls go through a single shared session, and the legacy client keeps its login for two minutes, so the web UI may ask you to take over the session while the server is in use.
Several devices
With one router, the environment variables above are all you need. For more, list the routers in
$XDG_CONFIG_HOME/tplink-modem/devices.toml (or the file named by TPLINK_CONFIG):
[[device]]
name = "upstairs"
host = "192.168.1.1"
default = true # used when no device is named
[[device]]
name = "garage-ap"
host = "192.168.0.5"
username = "admin" # optional, default admin
client = "legacy" # optional, as TPLINK_CLIENTPasswords are never kept in the file. Each device reads TPLINK_PASSWORD_<NAME> (name in capitals, - as _, so
TPLINK_PASSWORD_GARAGE_AP); the default device also accepts plain TPLINK_PASSWORD. Without the file nothing
changes.
tplink-modem devices # name, host, default, locked
tplink-modem --device garage-ap status
tplink-modem find iphone --all-devices # which router is a device on?
tplink-modem clients --all-devices
tplink-modem sample --all-devicesEvery MCP tool takes an optional device. Each device has its own presence history. The default device keeps the
existing history files (presence.jsonl, last.json), so mark your original router default = true; changing which
device is the default swaps the histories, and nothing is migrated. The MCP server's background sampler only records
the default device; record the others with tplink-modem sample --all-devices on a timer.
Repeated failed logins lock the device
TP-Link locks the admin login after a few wrong attempts, and a timer that keeps trying would keep it locked. When a
router refuses a login three times in a row, tplink-modem locks that device and stops trying. A single refusal can
be a session conflict (the router allows one admin session at a time), so it only warns how many tries are left; a
login that works resets the count. Leaving the router's web UI open in a browser can cause such refusals. Once locked:
error: login to http://192.168.1.1 failed earlier; not retrying until the password changes or you run 'tplink-modem unlock upstairs'The lock lifts by itself when the device's host, username or password changes, or with tplink-modem unlock <device>.
It also expires after 60 minutes (TPLINK_LOCK_MINUTES); then exactly one login is tried. If it fails the device is
locked for another period, if it works the count resets. At worst that is one attempt per hour.
Only a refused login counts; a timeout or an unreachable router neither counts nor resets. The state file stores a
salted hash, never the password.
Presence history
Routers do not remember when a device came and went, so the server samples the client list once a minute and
writes join, leave and IP-change events to presence.jsonl in the state folder. It only samples while it runs.
For a history around the clock, run tplink-modem sample every minute from a timer on a machine that stays
on, and start the MCP server with TPLINK_PRESENCE_INTERVAL=0 so only the timer writes:
* * * * * TPLINK_PASSWORD=... uvx tplink-modem sampleTested on
Archer C5v v1, firmware v1.8 (Türk Telekom), with the legacy client.
Models tplinkrouterc6u supports should work through it. If you try another model, please open a model report, whether it works or not.
Security
The password stays in an environment variable and is only sent to the router. Read tools never change anything.
Change tools only preview until they are called again with confirm=true, which the server tells the assistant
to do only after you approve; clients with elicitation also ask you directly. TPLINK_WRITE, TPLINK_ALLOW and
TPLINK_DENY limit what can be changed at all. To report a vulnerability, see SECURITY.md.
Contributing
See CONTRIBUTING.md.
Credits
tplinkrouterc6u by Alex Erohin (GPL-3.0), which does most of the talking to the router; the legacy client extends its MR200 client.
MCP Python SDK (MIT).
Fonts in the brand kit: Geist (SIL OFL 1.1).
License
GPL-3.0-or-later, because the server extends tplinkrouterc6u, which is GPL-3.0.
Available Tools
17 toolsclient_historyARead-onlyIdempotent
Join / leave / IP-change events recorded by this server (routers keep no such log). Shows which device keeps dropping off the network and when. Each device has its own history. Sampled every TPLINK_PRESENCE_INTERVAL seconds (default 60) while the server runs.
Inputs: mac, limit, device, since_hours. Returns: result
dhcp_leasesCRead-onlyIdempotent
Active DHCP leases: hostname, IP, MAC, lease time left.
Inputs: device. Returns: result
dhcp_reservationsCRead-onlyIdempotent
Fixed IP reservations (address reservation) configured on the router.
Inputs: device. Returns: result
find_clientBRead-onlyIdempotent
Devices whose hostname, IP or MAC contains the query (case-insensitive; '-' and ':' both work in MACs).
Inputs: query (required), device. Returns: result
ipv6_statusCRead-onlyIdempotent
WAN and LAN IPv6 status, if the model supports it.
Inputs: device.
list_clientsBRead-onlyIdempotent
Devices on the network: hostname, IP, MAC, wired or Wi-Fi band and SSID, signal (dBm, closer to 0 is better; below -75 is weak) and link rate where the router reports them.
Inputs: device, include_inactive. Returns: result
reboot_routerADestructive
Reboot the router. The whole network and the internet drop for a minute or two. Needs confirm=true.
Inputs: device, confirm. Returns: result
remove_static_ipADestructive
Remove a device's fixed IP reservation. Without confirm=true it only shows the plan.
Inputs: mac (required), device, confirm.
router_changeADestructive
Change any setting the web UI can change. action: "set" (stack = the row's _stack; omit for single objects), "add" (parent_stack = the parent row's _stack, e.g. "1" for LAN_DHCP_STATIC_ADDR under LAN 1) or "delete". Read the object first so attribute names match. Without confirm=true it only shows what it would do.
Inputs: action (required), object (required), stack, device, +3 more.
router_logsARead-onlyIdempotent
System log, newest first. module: e.g. DHCPD, PPP, DHCPC, SYSTEM. contains: text or a MAC to look for. max_severity: 0 emerg, 3 err, 4 warn, 6 info, 7 debug (everything). Note: the router clears it on reboot.
Inputs: limit, device, module, contains, +1 more. Returns: result
router_objectsBRead-onlyIdempotent
Names of every settings object the router's web UI uses (LAN_WLAN, LAN_DHCP_STATIC_ADDR, WAN_IP_CONN_PORTMAPPING, FIREWALL, ...) and the operations it can run (ACT_REBOOT, ...). Filter with contains.
Inputs: device, contains.
router_readARead-onlyIdempotent
Read a settings object: every instance, or the one at stack (e.g. "1,2"). Each row carries its _stack, which router_change needs. Passwords and keys are masked unless TPLINK_SHOW_SECRETS=1.
Inputs: object (required), stack, device, attributes. Returns: result
router_runADestructive
Run a router operation from router_objects' list, such as ACT_DHCP_RENEW or ACT_PPP_DISCONN. Without confirm=true it only shows what it would do.
Inputs: operation (required), device, confirm.
router_statusARead-onlyIdempotent
Overview: model and firmware, internet connection (status, external IP, uptime), LAN address, Wi-Fi networks that are on, number of devices online.
Inputs: device.
set_static_ipADestructive
Give a device a fixed IP (address reservation): adds it, or updates the existing reservation for that MAC. The device gets the address the next time it renews its lease. Without confirm=true it only shows the plan.
Inputs: ip (required), mac (required), device, confirm.
set_wifiADestructive
Change a Wi-Fi network (index from wifi_networks): name, password, on/off, hidden. Devices on it drop and must reconnect, with the new password if it changed. Without confirm=true it only shows the plan.
Inputs: network_index (required), ssid, device, hidden, +3 more.
wifi_networksARead-onlyIdempotent
Every SSID the router has, with band, channel, standard and whether it is on.
Inputs: device. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Read tools are mostly distinct (logs, status, leases, reservations, ipv6, networks), but the generic router_read/router_change/router_run escape hatches overlap directly with the purpose-built set_wifi, set_static_ip, remove_static_ip, and reboot_router — an agent must guess whether to use the wrapper or the raw object call. list_clients vs find_client is a listing/filtering pair and is manageable, but the generic-vs-specific write overlap creates real selection ambiguity.
There is a loose convention: reads are bare noun phrases (router_status, dhcp_leases, wifi_networks) and writes are imperative (set_wifi, remove_static_ip, reboot_router), which is readable. However, router_read/router_change/router_run use an inconsistent generic verb_noun pattern that clashes with the specific verbs and with the noun-style read tools, and list_clients/find_client introduce yet another verb convention.
At 17 tools this is on the heavy side for a single router-admin surface, and a chunk of that weight comes from convenience wrappers duplicating what router_change/router_run already do. Each tool is individually justifiable, but the set would be tighter if the generic and specific write paths were consolidated.
Coverage is strong: full read visibility (status, logs, clients, presence history, DHCP, IPv6, Wi-Fi), configuration writes, static IP lifecycle (set/remove), and reboot, plus a generic read/change/run layer that can reach anything the web UI exposes. Gaps are minor — no convenience tools for port forwarding, device blocking/parental controls, or firmware update, though all are reachable via router_change/router_run.
Maintenance
Related MCP Connectors
Lets your AI assistant use websites for you. It asks before it acts and never sees your password.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Logs your AI agent into websites, catches verification codes, and asks you before anything risky.
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to manage TP-Link routers by listing clients, checking status, controlling Wi-Fi, and rebooting via natural language.332MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with Xiaomi/Redmi routers, providing read-only queries and management capabilities such as device listing, port forwarding, DHCP reservations, and reboot control.MIT
- AlicenseNot gradedqualityBmaintenanceEnables 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
- AlicenseNot gradedqualityBmaintenanceEnables AI copilots and autonomous agents to inspect, diagnose, and safely manage TP-Link 4G/LTE gateways and broadband routers through typed MCP tools for status, signal, clients, Wi-Fi, DNS, SMS/USSD, and guarded mutations. It provides session leasing and confirmation safeguards to avoid locking out admins or disconnecting active sessions.MIT