{"id":50718511,"url":"https://github.com/daniel-k/tplink-sg1016-mcp","last_synced_at":"2026-06-09T21:03:54.693Z","repository":{"id":347161745,"uuid":"1193028818","full_name":"daniel-k/tplink-sg1016-mcp","owner":"daniel-k","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-26T22:32:48.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-27T09:34:05.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel-k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T19:57:34.000Z","updated_at":"2026-03-26T22:32:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/daniel-k/tplink-sg1016-mcp","commit_stats":null,"previous_names":["daniel-k/tplink-sg1016-mcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/daniel-k/tplink-sg1016-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-k%2Ftplink-sg1016-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-k%2Ftplink-sg1016-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-k%2Ftplink-sg1016-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-k%2Ftplink-sg1016-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-k","download_url":"https://codeload.github.com/daniel-k/tplink-sg1016-mcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-k%2Ftplink-sg1016-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34125332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T21:03:53.640Z","updated_at":"2026-06-09T21:03:54.686Z","avatar_url":"https://github.com/daniel-k.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tplink-sg1016-mcp\n\n\u003e **WARNING:** This project is in early development. Many tools are based\n\u003e on reverse-engineered API endpoints, **not official documentation**. Not\n\u003e all tools have been thoroughly tested against real hardware. Write\n\u003e operations (port config, PoE, VLANs, QoS, rebooting, IP changes, etc.)\n\u003e can disrupt your network or make the switch unreachable if used\n\u003e incorrectly. **Use at your own risk.** Always verify critical changes\n\u003e through the switch's web UI.\n\nMCP server for TP-Link SG1016PE Easy Smart switches. Exposes switch management\nover the [Model Context Protocol](https://modelcontextprotocol.io/) (stdio\ntransport), so you can query and configure the switch from Claude Code or any\nother MCP client.\n\n## Prerequisites\n\n- Python 3.13+\n- [uv](https://docs.astral.sh/uv/)\n- A TP-Link SG1016PE (or compatible Easy Smart) switch reachable over HTTP\n\n## Configuration\n\nThe server is configured via environment variables:\n\n| Variable | Default | Description |\n|---|---|---|\n| `TPLINK_HOST` | `192.168.0.1` | Switch IP address |\n| `TPLINK_PORT` | `80` | Web interface port |\n| `TPLINK_USERNAME` | `admin` | Login username |\n| `TPLINK_PASSWORD` | *(empty)* | Login password |\n| `TPLINK_USE_SSL` | `false` | Use HTTPS |\n| `TPLINK_VERIFY_SSL` | `false` | Verify SSL certificate |\n\n## Running\n\n### With uv (development)\n\n```sh\nuv run tplink-sg1016-mcp\n```\n\n### With the PEX executable\n\nBuild a self-contained executable:\n\n```sh\nuv run tox -e pex\n```\n\nThis produces `dist/tplink-sg1016-mcp.pex`. Run it directly:\n\n```sh\nTPLINK_PASSWORD=secret ./dist/tplink-sg1016-mcp.pex\n```\n\n## Claude Code integration\n\nAdd to your MCP config (e.g. `~/.claude/settings.json` or `.claude/settings.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"tplink\": {\n      \"command\": \"uv\",\n      \"args\": [\"run\", \"--directory\", \"/path/to/tplink-sg1016-mcp\", \"tplink-sg1016-mcp\"],\n      \"env\": {\n        \"TPLINK_HOST\": \"192.168.0.1\",\n        \"TPLINK_PASSWORD\": \"your-password\"\n      }\n    }\n  }\n}\n```\n\nOr using the PEX:\n\n```json\n{\n  \"mcpServers\": {\n    \"tplink\": {\n      \"command\": \"/path/to/dist/tplink-sg1016-mcp.pex\",\n      \"env\": {\n        \"TPLINK_HOST\": \"192.168.0.1\",\n        \"TPLINK_PASSWORD\": \"your-password\"\n      }\n    }\n  }\n}\n```\n\n## Available tools\n\n### System\n\n| Tool | Description |\n|---|---|\n| `get_device_info` | Model name, MAC, IP, firmware, hardware version |\n| `get_ip_settings` | Switch management IP config (DHCP/static) |\n| `get_led_status` | Front-panel LED on/off state |\n| `set_device_name` | Change the switch's system name |\n| `set_ip_settings` | Change management IP (DHCP or static) |\n| `set_led` | Turn front-panel LEDs on/off |\n| `reboot_switch` | Reboot the switch (saves config first) |\n\n### Port management\n\n| Tool | Description |\n|---|---|\n| `get_port_states` | All 16 ports: admin state, speed, flow control |\n| `get_port_statistics` | Per-port TX/RX good/bad packet counters |\n| `set_port_state` | Enable/disable a port, set speed and flow control |\n\n### PoE (Power over Ethernet)\n\n| Tool | Description |\n|---|---|\n| `get_poe_port_states` | Per-port power, voltage, current, PD class, status |\n| `get_poe_global_state` | Switch-wide power budget, consumption, remaining |\n| `get_poe_recovery` | PoE auto-recovery (ping watchdog) config |\n| `set_poe_global_limit` | Set the global PoE power budget (watts) |\n| `set_poe_port` | Configure per-port PoE: enable, priority, power limit |\n| `repower_poe_port` | Power-cycle a PoE port to reboot connected device |\n\n### 802.1Q VLANs\n\n| Tool | Description |\n|---|---|\n| `get_vlan_config` | All VLANs with tagged/untagged port membership |\n| `get_pvid_config` | Per-port PVID (native VLAN) assignments |\n| `set_vlan_enabled` | Enable/disable 802.1Q VLAN mode |\n| `create_vlan` | Create a new VLAN with optional initial port memberships |\n| `add_vlan_members` | Add ports to an existing VLAN (reads current state first) |\n| `remove_vlan_members` | Remove ports from an existing VLAN (reads current state first) |\n| `delete_vlan` | Delete a VLAN |\n| `set_port_pvid` | Set a port's native VLAN for untagged traffic |\n\n### QoS (Quality of Service)\n\n| Tool | Description |\n|---|---|\n| `get_qos_config` | QoS mode and per-port priority queues |\n| `get_bandwidth_limits` | Per-port ingress/egress rate limits |\n| `get_storm_control` | Per-port storm control settings |\n| `set_qos_mode` | Set QoS mode (port-based, 802.1p, DSCP) |\n| `set_port_qos_priority` | Set a port's priority queue |\n| `set_bandwidth_limit` | Set per-port ingress/egress rate limits |\n| `set_storm_control` | Configure per-port storm control |\n\n### Security\n\n| Tool | Description |\n|---|---|\n| `get_igmp_snooping` | IGMP snooping config and multicast groups |\n| `get_loop_prevention` | Loop prevention enabled/disabled |\n| `set_igmp_snooping` | Enable/disable IGMP snooping |\n| `set_loop_prevention` | Enable/disable loop prevention |\n\n### Diagnostics\n\n| Tool | Description |\n|---|---|\n| `run_cable_test` | Run TDR cable test on selected ports and return results |\n\n### LAG / Mirroring\n\n| Tool | Description |\n|---|---|\n| `get_lag_config` | Link aggregation groups and member ports |\n| `get_port_mirror_config` | Port mirroring setup (source/destination) |\n| `create_lag` | Create/modify a link aggregation group |\n| `delete_lag` | Delete a link aggregation group |\n| `set_port_mirror` | Configure port mirroring for traffic analysis |\n\n## Development\n\nInstall dev dependencies:\n\n```sh\nuv sync\n```\n\nRun all checks:\n\n```sh\nuv run tox\n```\n\nIndividual tox environments:\n\n```sh\nuv run tox -e lint      # ruff linter\nuv run tox -e format    # ruff format check\nuv run tox -e pex       # build PEX executable\n```\n\nFormat code:\n\n```sh\nuv run ruff format src/\n```\n\nFormat `tox.ini`:\n\n```sh\nuv run tox-ini-fmt tox.ini\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-k%2Ftplink-sg1016-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-k%2Ftplink-sg1016-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-k%2Ftplink-sg1016-mcp/lists"}