tplink-mcp
Provides tools for interacting with TP-Link routers and 4G/LTE gateways, including reading status and cellular signal, managing connected clients and DHCP reservations, inspecting Wi-Fi networks, configuring DNS/IPv6, running diagnostics, reading/sending SMS and USSD, and performing guarded write actions such as cell/band locking, Wi-Fi radio changes, and reboots.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Overview
TP-Link Router MCP Server is a production-ready implementation of the Model Context Protocol (MCP 2.x) that grants autonomous AI agents safe, structured access to TP-Link cellular gateways and broadband routers. Supported agent frameworks include Google Antigravity, Claude Desktop, Cursor, and OpenAI Codex.
Conceived during network tuning experiments on Hutch 4G LTE unlimited connections in Malabe, Sri Lanka (near the SLIIT Campus), the server allows AI models to independently audit link telemetry, optimize radio bands, and resolve cellular bufferbloat while guaranteeing zero disruption to concurrent sessions or unauthorized networks.
To satisfy the strict single-administrator concurrency constraint enforced by TP-Link firmware, the server encapsulates every tool invocation within an atomic SafeSession context manager that authenticates, executes the request, and logs out immediately. Potentially disruptive tool calls enforce explicit confirmation arguments to prevent AI models from severing active connectivity.
Related MCP server: ax11000-mcp
Architecture & Modes
The server provides flexible deployment models across standard process transports, containerized runtimes, and package managers.
Deployment Target | Transport Mechanism | Runtime Requirements | Isolation Level | Recommended Host |
Python stdio | JSON-RPC over stdin/stdout | Python 3.10+ | Process-level | Google Antigravity, Cursor, CLI agents |
Node.js npx | Stdio wrapper | Node.js 18+ | Process-level | Claude Desktop, npx environments |
Docker Container | Host-networked container | Docker Engine | Containerized | Headless servers, Kubernetes, Podman |
Smithery Registry | Stdio automation | Smithery CLI | Managed | Automated agent configurations |
sequenceDiagram
autonumber
participant Agent as AI Copilot (Antigravity / Claude)
participant MCP as TP-Link MCP Server
participant Guard as Network Profile Guard
participant Session as SafeSession Manager
participant Router as TP-Link Gateway (192.168.1.1)
Agent->>MCP: Call Tool (e.g. router_get_rf_signal)
MCP->>Guard: Verify Gateway IP and SSID safety
Guard-->>MCP: Safety Verified
MCP->>Session: Acquire atomic session lock
Session->>Router: Authenticate (RSA-1024 / AES-128)
Router-->>Session: Authenticated Token
Session->>Router: Dispatch TR-064 Query
Router-->>Session: Telemetry Payload
Session->>Router: Immediate Logout (Release Session)
Session-->>MCP: Sanitized Data
MCP-->>Agent: Return Tool Result JSONProject Structure
.
├── tplink_mcp/ # MCP server and tool registry
│ ├── server.py # MCP 2.x protocol entrypoint and JSON-RPC router
│ ├── tools/ # 18 typed MCP tool definitions
│ └── core/ # Session leasing, network safety, and crypto
├── bin/ # Node.js binary wrapper for npx distribution
├── Dockerfile # Container definition for GHCR deployment
├── smithery.yaml # Smithery marketplace manifest
├── tests/ # Automated test suite (63 unit tests)
├── package.json # npm wrapper configuration
├── pyproject.toml # Python build and dependency manifest
└── README.mdInstallation
Claude Desktop Configuration
Add the server entry to your claude_desktop_config.json:
{
"mcpServers": {
"tplink-mcp": {
"command": "npx",
"args": ["-y", "tplink-mcp"],
"env": {
"TPLINK_ROUTER_IP": "http://192.168.1.1",
"TPLINK_PASSWORD": "your_router_password"
}
}
}
}Google Antigravity & Cursor Configuration
Configure directly using Python stdio transport:
{
"mcpServers": {
"tplink-mcp": {
"command": "python3",
"args": ["-m", "tplink_mcp.server"],
"env": {
"TPLINK_ROUTER_IP": "http://192.168.1.1",
"TPLINK_PASSWORD": "your_router_password"
}
}
}
}Docker Container (Zero-Install)
docker run -i --rm --network host \
-e TPLINK_ROUTER_IP="http://192.168.1.1" \
-e TPLINK_PASSWORD="your_router_password" \
ghcr.io/dulithdivisekara/tplink-mcp:latestUsage
Core Tools Catalog
The server exposes 18 typed MCP tools categorized by operational risk:
Tool Name | Operation | Description | Safety Gate |
| Read | Verifies active Wi-Fi SSID and default gateway | Safe |
| Read | Retrieves hardware status, WAN IP, and cellular health | Safe |
| Read | Queries 3GPP RSRP, RSRQ, SNR, and tower parameters | Safe |
| Write | Pins modem to specific EARFCN and PCI base station | Requires |
| Write | Restricts modem to selected frequency band (e.g. Band 3) | Requires |
| Read | Inspects monthly quota, billing day, and live bandwidth | Safe |
| Write | Sets monthly billing cycle and data ceiling | Requires |
| Read | Lists LAN devices with IP, MAC, hostname, and lease | Safe |
| Write | Adds, deletes, or inspects static DHCP bindings | Requires |
| Read | Returns 2.4 GHz and 5 GHz wireless configuration | Safe |
| Write | Enables or disables wireless radio transmitters | Requires |
| Read | Queries front panel LEDs and night mode schedule | Safe |
| Write | Configures automated nighttime LED disablement | Safe |
| Exec | Dispatches router-side WAN, link, and internet tests | Safe |
| Write | Configures custom WAN DNS resolvers | Safe |
| Write | Enables or disables IPv6 stack | Safe |
| Exec | Sends interactive USSD query to SIM | Safe |
| Read | Reads incoming and sent SMS messages from SIM card | Safe |
| Write | Dispatches SMS message via cellular modem | Safe |
| Exec | Gracefully restarts router hardware | Requires |
Session Logging & Inspection
The MCP specification mandates clean stdout for JSON-RPC message frames. All server diagnostic logs are routed strictly to stderr or designated files:
Audit Log Path:
~/.config/tplink-router/mcp.logStream Live Logs:
tail -f ~/.config/tplink-router/mcp.log
Verification Tests
Run the automated test suite verifying tool schemas, validation handlers, and mock gateway responses:
python3 -m unittest discover testsRan 63 tests in 19.603s
OKSecurity & Privacy
SafeSession Isolation: Eliminates lockout errors on the web administrative portal by guaranteeing immediate atomic session teardown.
Disconnection Guardrails: Destructive commands enforce
confirm=Trueto prevent recursive disconnection where an AI agent severs its own connection.Network Profile Validator: Halts execution if the client is connected to university campus Wi-Fi or unauthorized networks.
Credential Segregation: Credentials are supplied via environment variables or protected configuration files with owner-only (
0600) POSIX permissions.
License
This project is licensed under the MIT License. Author: Dulith Divisekara.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
661
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
- AlicenseBqualityBmaintenanceEnables Claude Code and other MCP clients to inspect and manage a TP-Link router over stdio, including device lists, DHCP leases and reservations, Wi-Fi settings, firmware and IP status, mesh nodes, and safe raw endpoint requests with confirmation for writes and secret masking.16MIT
- 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 gradedqualityBmaintenanceLets AI agents control a Keenetic router over the local network through the Model Context Protocol, managing devices, Wi-Fi, port forwarding, KeenDNS, DNS, DHCP, firewall, mesh, storage, logs and diagnostics with a safe, read-back-verified change model. An opt-in SSH mode additionally enables Entware package management and config file editing on the router.MIT