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 分