tplink-modem-mcp

v0.2.0
tplink-modem-mcp Checked 1 day ago Published 17 days ago

MCP server for TP-Link routers and ISP modems: devices, Wi-Fi signal, logs, presence history

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

router_status

Overview: model and firmware, internet connection (status, external IP, uptime), LAN address, Wi-Fi networks that are on, number of devices online.

list_clients

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.

ParameterTypeDescription
include_inactiveboolean

find_client

Devices whose hostname, IP or MAC contains the query (case-insensitive; '-' and ':' both work in MACs).

ParameterTypeDescription
query *string

client_history

Join / leave / IP-change events recorded by this server (routers keep no such log). Shows which device keeps dropping off the network and when. Sampled every TPLINK_PRESENCE_INTERVAL seconds (default 60) while the server runs.

ParameterTypeDescription
limitinteger
macstring
since_hoursnumber

wifi_networks

Every SSID the router has, with band, channel, standard and whether it is on.

router_logs

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.

ParameterTypeDescription
containsstring
limitinteger
max_severityinteger
modulestring

dhcp_leases

Active DHCP leases: hostname, IP, MAC, lease time left.

dhcp_reservations

Fixed IP reservations (address reservation) configured on the router.

ipv6_status

WAN and LAN IPv6 status, if the model supports it.

router_objects

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.

ParameterTypeDescription
containsstring

router_read

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.

ParameterTypeDescription
object *string
attributes
stackstring

router_change

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.

ParameterTypeDescription
action *string
object *string
attributes
confirmboolean
parent_stackstring
stackstring

router_run

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.

ParameterTypeDescription
operation *string
confirmboolean

set_static_ip

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.

ParameterTypeDescription
ip *string
mac *string
confirmboolean

remove_static_ip

Remove a device's fixed IP reservation. Without confirm=true it only shows the plan.

ParameterTypeDescription
mac *string
confirmboolean

set_wifi

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.

ParameterTypeDescription
network_index *integer
confirmboolean
enabled
hidden
passwordstring
ssidstring

reboot_router

Reboot the router. The whole network and the internet drop for a minute or two. Needs confirm=true.

ParameterTypeDescription
confirmboolean