Asuswrt Mcp

io.github.teefloo由 GitHub 帳號 teefloo 發布v0.1.1更新於 Oct 24, 2026

Secure AsusWRT router administration via SSH — 42+ tools, guarded mutations

概覽

AI 產生的概覽

讓助理透過 SSH 監控 AsusWRT 或 AsusWRT-Merlin 路由器,並在明確啟用後修改其設定。

可以做什麼
提供 42 個唯讀工具,涵蓋路由器型號與運作狀態、LAN/WAN 與 DNS 設定、已連線用戶端與 DHCP 租約、無線射頻與訪客網路、執行中的程序與開放連接埠、儲存、安全功能、VPN 狀態以及 SSH 診斷。選用的變更工具可重新啟動白名單服務,開關 DHCP、UPnP、Wi-Fi 射頻與訪客網路,管理連接埠轉送、OpenVPN 伺服器、家長監護和 DHCP 靜態保留。變更操作需要明確的 confirm 參數,並支援 dry-run 預覽。
適用情境
適合讓助理在不登入路由器網頁介面的情況下查看家用或小型辦公室 Asus 路由器的狀態、用戶端、無線、VPN 或安全設定。若還希望進行受保護的變更,例如重新啟動服務或調整訪客 Wi-Fi、連接埠轉送、家長監護,也可加入。
執行需求
以 Python 套件形式在本機透過 stdio 執行,需要 Python 3.11+。需要本機可連線至路由器網路,且路由器已啟用 SSH。必要的環境變數:ASUSWRT_HOST、ASUSWRT_SSH_USERNAME,以及 ASUSWRT_SSH_PASSWORD 或 ASUSWRT_SSH_KEY_FILE 其中之一。執行變更還需將 ASUSWRT_ALLOW_MUTATIONS 設為 true。
安裝前請注意
此伺服器持有路由器 SSH 認證資訊(ASUSWRT_SSH_PASSWORD 或 ASUSWRT_SSH_KEY_FILE),需妥善保管。變更工具會改變實際網路行為,包括關閉 Wi-Fi 射頻、DHCP 或 UPnP,修改連接埠轉送,以及透過家長監護封鎖用戶端;除非啟用 ASUSWRT_ALLOW_MUTATIONS,否則這些工具維持停用,且每次呼叫都需 confirm=true,建議先用 dry_run 預覽。README 表示回應中會隱藏密碼,且不執行任意命令或韌體操作。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Asuswrt Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

AsusWRT MCP Server

[Python 3.11+] [MIT License] [Project Status: Active]

mcp-name: io.github.teefloo/asuswrt-mcp

Model Context Protocol (MCP) server for secure, controlled administration of AsusWRT and AsusWRT-Merlin routers via SSH.

Overview

This MCP server provides AI assistants (like Claude, Cursor, etc.) with a safe interface to monitor and manage AsusWRT routers. It operates exclusively over SSH using allowlisted operations—no arbitrary command execution, no firmware modifications, and no factory resets.

Features

Read-Only Monitoring (42 tools)

CategoryTools
Identity & HealthRouter model, firmware version, uptime, load, memory
NetworkLAN/WAN details, DNS config, IPv6 status, routing table
ClientsConnected clients, DHCP leases, ARP neighbors
WirelessRadio status, SSIDs, guest networks, client counts per band
ServicesRunning processes, open ports, cron jobs
StorageUSB devices, mounts, partitions, filesystem usage
SecurityUPnP, DDNS, Samba status, conntrack usage
VPNOpenVPN server, WireGuard, VPN client profiles
AdministrationWeb admin ports, SSH/telnet access settings
DiagnosticsSSH TCP/banner/auth diagnostics, config snapshot

Mutation Tools (with safety guards)

All mutation tools require:

  • confirm: true parameter
  • ASUSWRT_ALLOW_MUTATIONS=true environment variable
  • Support for dry_run: true to preview changes
ToolDescription
asuswrt_restart_serviceRestart allowlisted services (httpd, firewall, wireless, dnsmasq, etc.)
asuswrt_dhcp_serverEnable/disable DHCP server
asuswrt_upnpEnable/disable UPnP
asuswrt_radioEnable/disable Wi-Fi radio bands
asuswrt_guest_wifiEnable/disable guest Wi-Fi
asuswrt_guest_lan_accessToggle LAN access for guest Wi-Fi
asuswrt_port_forwardingList, add, remove, enable/disable port forwarding rules
asuswrt_vpn_serverEnable/disable OpenVPN server
asuswrt_parental_accessList, block, unblock, remove parental control rules
asuswrt_parental_block_allToggle block-all mode
asuswrt_dhcp_reservationList, add, remove DHCP static reservations

Safety Model

  • No arbitrary SSH: Only allowlisted commands are executed via NVRAM and service calls
  • No firmware operations: No flash, reset, or bootloader access
  • Secret redaction: Passwords and sensitive data are never exposed in tool responses
  • Dry-run support: Every mutation can be previewed before applying
  • Confirmation required: Mutations require explicit confirm=True
  • SSH-only transport: No exposure of the router's web API

Prerequisites

  • Python 3.11+
  • An AsusWRT or AsusWRT-Merlin router with SSH access enabled
  • Network connectivity from the MCP client to the router

Installation

1. Clone and setup

bash
git clone https://github.com/Teeflo/asuswrt-mcp.gitcd asuswrt-mcp
# Create virtual environmentpython -m venv .venv
# Activate (Linux/macOS)source .venv/bin/activate
# Activate (Windows).venv\Scripts\activate
# Install dependenciespip install -e .

2. Configure environment

bash
# Copy example configurationcp .env.example .env
# Edit with your router credentials# Use your favorite editor:notepad .env        # Windowsnano .env           # Linux/macOS

3. Configure .env

env
# Required: Router connectionASUSWRT_HOST=192.168.1.1ASUSWRT_SSH_USERNAME=adminASUSWRT_SSH_PASSWORD=your_password
# Optional: SSH key authentication# ASUSWRT_SSH_KEY_FILE=~/.ssh/id_rsa
# Optional: Enable mutations (disabled by default)# ASUSWRT_ALLOW_MUTATIONS=true
# Optional: Connection settings# ASUSWRT_SSH_PORT=22# ASUSWRT_TIMEOUT_SECONDS=10

Usage

Run the MCP server

bash
# Standard stdio modepython -m asuswrt_mcp.server
# Or use the entry pointasuswrt-mcp

Configure in Claude Desktop / Cursor

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "asuswrt-mcp": {      "command": "C:\\path\\to\\asuswrt-mcp\\.venv\\Scripts\\python.exe",      "args": ["-m", "asuswrt_mcp.server"],      "env": {        "ASUSWRT_HOST": "192.168.1.1",        "ASUSWRT_SSH_USERNAME": "admin",        "ASUSWRT_SSH_PASSWORD": "your_password"      }    }  }}

Using with npx Inspector (development)

bash
npx @modelcontextprotocol/inspector python -m asuswrt_mcp.server

Development

Run tests

bash
pip install -e ".[dev]"pytest

Run with live router integration tests

bash
ASUSWRT_TEST_ROUTER=1 pytest

Project Structure

asuswrt-mcp/├── src/asuswrt_mcp/│   ├── server.py          # FastMCP entrypoint & tool definitions│   ├── service.py         # Business logic & router operations│   ├── config.py          # Settings management│   ├── clients/│   │   └── ssh.py         # SSH client wrapper│   ├── nvram.py           # NVRAM parsing utilities│   ├── ssh_parsers.py     # Output parsers for SSH commands│   ├── security.py        # Mutation guards & redaction│   ├── validators.py      # Input validation│   ├── responses.py       # Tool response formatting│   ├── errors.py          # Custom exceptions│   └── serialization.py   # Safe serialization├── tests/                 # Test suite (69 tests)├── .env.example           # Example configuration├── pyproject.toml         # Project metadata└── README.md              # This file

License

MIT License - see LICENSE for details.

Acknowledgments

來源:README.md,提交 4651689

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分