tplink-modem-mcp
An MCP server that lets an AI assistant read and manage a TP-Link router or an ISP-supplied TP-Link modem on your local network: who is connected, how strong their Wi-Fi signal is, what the router logged, and when each device joined or dropped off.
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."
Tools
| Tool | What it does |
|---|---|
router_status |
Model, firmware, internet connection (status, external IP, uptime), LAN address, Wi-Fi networks, devices online |
list_clients |
Devices with hostname, IP, MAC, wired or Wi-Fi band and SSID, signal (dBm) and link rate |
find_client |
Search devices by name, IP or MAC |
client_history |
Join / leave / IP-change events recorded by this server (routers keep no such log) |
wifi_networks |
Every SSID with band, channel and on/off |
router_logs |
System log, filtered by module, text or severity |
dhcp_leases, dhcp_reservations |
DHCP leases and fixed addresses |
ipv6_status |
WAN / LAN IPv6 |
reboot_router |
Reboots, only with confirm=true |
Everything except reboot_router only reads.
Install
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-mcp
Claude 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-mcp run tplink-modem-mcp.
Settings
| Variable | Default | |
|---|---|---|
TPLINK_PASSWORD |
(required) | web admin password |
TPLINK_HOST |
http://192.168.1.1 |
router address |
TPLINK_USERNAME |
admin |
|
TPLINK_CLIENT |
auto | legacy, or a tplinkrouterc6u class name such as TPLinkMRClient |
TPLINK_TIMEOUT |
20 |
seconds per request to the router |
TPLINK_PRESENCE_INTERVAL |
60 |
seconds between presence samples while the server runs; 0 turns it off |
TPLINK_STATE_DIR |
$XDG_STATE_HOME/tplink-modem-mcp |
where the presence history is kept |
TPLINK_LOG |
WARNING |
log level, DEBUG shows every router call |
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.
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-mcp 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-mcp sample
Tested 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;
reboot_router does nothing unless it is called with confirm=true, and the server's instructions tell the
assistant to ask you first. 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.
Metadata
Release files for tplink-modem-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tplink_modem_mcp-0.1.0.tar.gz | 11.5 kB | With provenance | Details for tplink_modem_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tplink_modem_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for tplink_modem_mcp-0.1.0-py3-none-any.whl |
Total release size: 25.0 kB
Release files / tplink_modem_mcp-0.1.0.tar.gz
| Download URL | tplink_modem_mcp-0.1.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7589d237967f0051453bb4a11c79dd630949407812e2cd83e2bb7e3a014a4a1b
|
|
BLAKE2b-256 checksum How to use checksums |
7a2ffffe605ac7c815cd95db13ff3a41017aacfd14c9b1e4dada3d755e73d7bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / tplink_modem_mcp-0.1.0-py3-none-any.whl
| Download URL | tplink_modem_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50fa2fca1d3f4fbab564538dde95ea2ea3630508011f97f0a40d3ab38e9658f6
|
|
BLAKE2b-256 checksum How to use checksums |
5510777826e7a90b2acb81fafb74063069ae153128c3260140f9fed2b167493c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for tplink-modem-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tplink_modem_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.