Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TPLINK_LOGNoLog level; DEBUG shows every router call.WARNING
TPLINK_DENYNoComma-separated objects or operations that may never be changed, e.g. 'ACT_FACTORY_RESET,USER_CFG'. Defaults to none.
TPLINK_HOSTNoRouter address.http://192.168.1.1
TPLINK_ALLOWNoComma-separated objects or operations that may be changed; '*' matches a suffix, e.g. 'LAN_DHCP*,LAN_WLAN'. Defaults to all.
TPLINK_WRITENoSet to 'off' to make the server read-only: change tools are not offered at all.on
TPLINK_CLIENTNoClient type: 'legacy', or a tplinkrouterc6u class name such as 'TPLinkMRClient'. Defaults to auto.auto
TPLINK_TIMEOUTNoSeconds per request to the router.20
TPLINK_PASSWORDYesWeb admin password for the router.
TPLINK_USERNAMENoRouter web admin username.admin
TPLINK_STATE_DIRNoDirectory where the presence history is kept.$XDG_STATE_HOME/tplink-modem-mcp
TPLINK_SHOW_SECRETSNoSet to '1' to show Wi-Fi passwords and keys in reads instead of '***'.0
TPLINK_PRESENCE_INTERVALNoSeconds between presence samples while the server runs; 0 turns it off.60

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Reads and manages a TP-Link router or ISP modem on the local network. Read tools are safe. Every tool that changes the router first returns a preview; show it to the user, and only call it again with confirm=true once they approve. For anything without a dedicated tool, find the setting with router_objects and router_read (the same objects the router's web UI uses) and change it with router_change. For 'device X keeps dropping' questions combine list_clients (signal), client_history and router_logs (DHCP DISCOVER lines show a device joining again). Every tool takes an optional device name when several routers are configured; leave it out for the default one.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
router_statusA

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

list_clientsB

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.

find_clientB

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

client_historyA

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.

wifi_networksA

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

router_logsA

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.

dhcp_leasesC

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

dhcp_reservationsC

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

ipv6_statusC

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

router_objectsB

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.

router_readA

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.

router_changeA

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.

router_runA

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.

set_static_ipA

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.

remove_static_ipA

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

set_wifiA

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.

reboot_routerA

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

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.2/5.0

Scored across 17 tools

Disambiguation3/5

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.

Naming Consistency3/5

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.

Tool Count3/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo recent community issues