ASUSWRT MCP
mcp-name: io.github.x1pher/asuswrt-mcp
A community-maintained independent downstream of teefloo/asuswrt-mcp for secure, controlled administration of AsusWRT and AsusWRT-Merlin routers over SSH. It is maintained as its own product and release line, while retaining clear upstream provenance. It is not affiliated with or endorsed by ASUS or the upstream project.
Why this downstream exists
The upstream baseline already provides a strong allowlisted SSH-based MCP surface. This independent downstream exists because broader day-to-day router observability and several ASUS-specific correctness fixes were needed without adding arbitrary SSH/NVRAM access or exposing sensitive router data. It follows its own roadmap, release verification, package identity, and safety boundary rather than using upstream as the active release line.
Compared with the pinned upstream baseline, the current candidate expands the surface from 47 to 67 tools while keeping mutations guarded:
- 19 additional read tools for firewall posture, per-radio Wi-Fi configuration and scheduling, DNS Filter/Privacy, QoS, AiProtection, AiMesh, VLAN/guest segmentation, Dual-WAN, WPS, Smart Connect/roaming, firmware-update status, VPN-client health, WAN watchdog, logging, traffic-monitoring posture and auxiliary-service posture.
- Bounded WireGuard client management for connect, disconnect and restart of already-configured client slots only; profile creation/import/edit and credential exposure remain excluded.
- Correctness fixes for ASUS SSH enable-state semantics, WireGuard-client detection and bulk NVRAM reads where empty values could otherwise corrupt the following key/value record.
- Data minimization for sensitive families: status/count metadata is preferred over resolver values, VPN peer/endpoint data, client policy bodies, credentials or raw rule payloads.
Generic correctness fixes can be proposed upstream independently. This maintained downstream owns the broader opinionated capability and safety boundary described above. See UPSTREAM.md for the pinned provenance.
Overview
The server gives MCP clients a typed 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-reset capability.
Features
See the complete tool reference for every tool, access classification, inputs and mutation semantics.
Read-Only Monitoring (55 tools)
| Category | Tools |
|---|---|
| Identity & Health | Router model, firmware version, firmware update status, uptime, load, memory |
| Network | LAN/WAN details, Dual-WAN status, VLAN/guest segmentation, DNS config, DNS Privacy/DNSSEC status, IPv6 status, routing table, QoS status, sanitized traffic-monitoring posture |
| Clients | Connected clients, DHCP leases, ARP neighbors |
| Wireless | Radio status, SSIDs, guest networks, WPS state, Smart Connect/roaming, advanced radio features, sanitized per-radio scheduling state, client counts per band, AiMesh status |
| Services | Running processes, open ports, cron jobs, sanitized local/remote syslog posture, auxiliary FTP/media/WebDAV/cloud/modem/printer/legacy-VPN posture |
| Storage | USB devices, mounts, partitions, filesystem usage |
| Security | Firewall posture, port-trigger/DMZ/NAT-passthrough state, UPnP, DDNS, Samba status, conntrack usage, AiProtection status |
| VPN | OpenVPN server, WireGuard, sanitized VPN client slot/profile counts and VPN Fusion policy counts |
| Administration | Web admin ports, SSH/telnet access settings |
| Diagnostics | SSH TCP/banner/auth diagnostics, config snapshot |
Mutation Tools (with safety guards)
All mutation tools require:
confirm: trueparameterASUSWRT_ALLOW_MUTATIONS=trueenvironment variable- Support for
dry_run: trueto preview changes
| Tool | Description |
|---|---|
asuswrt_restart_service |
Restart allowlisted services (httpd, firewall, wireless, dnsmasq, etc.) |
asuswrt_dhcp_server |
Enable/disable DHCP server |
asuswrt_upnp |
Enable/disable UPnP |
asuswrt_radio |
Enable/disable Wi-Fi radio bands |
asuswrt_guest_wifi |
Enable/disable guest Wi-Fi |
asuswrt_guest_lan_access |
Toggle LAN access for guest Wi-Fi |
asuswrt_port_forwarding |
List, add, remove, enable/disable port forwarding rules |
asuswrt_vpn_server |
Enable/disable OpenVPN server |
asuswrt_wireguard_client |
Connect/disconnect/restart an already-configured WireGuard client slot |
asuswrt_parental_access |
List, block, unblock, remove parental control rules |
asuswrt_parental_block_all |
Toggle block-all mode |
asuswrt_dhcp_reservation |
List, 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
Feedback and contributions
Use GitHub Issues for bug reports and feature requests after publication, and pull requests for proposed changes. See CONTRIBUTING.md. Security issues must follow SECURITY.md, and release changes are summarized in CHANGELOG.md.
Prerequisites
- Python 3.11+
- An AsusWRT or AsusWRT-Merlin router with SSH access enabled
- The router SSH host key pre-verified in the local SSH
known_hostsstore; unknown host keys are rejected - Network connectivity from the MCP client to the router
Compatibility
The maintained repository verifier tests the complete source contract on Python 3.11 and Python 3.13. The accepted local runtime uses Python 3.12, so the current 3.11-3.13 interpreter range is exercised across verification and deployment.
The v0.2.0 pre-publication candidate was live-accepted against a stock ASUSWRT runtime that identifies itself as XT8PRO with firmware 388_24854-g9c246e8. The v0.2.1 candidate adds mandatory SSH host-key verification and must pass the same live acceptance before publication. The implementation also preserves upstream AsusWRT-Merlin compatibility assumptions where they remain valid, but this project does not claim that all ASUS router models or all AsusWRT/AsusWRT-Merlin firmware versions have been tested. Use the documented safety guards and validate behavior on other firmware families before relying on mutation tools.
Installation
1. Clone and setup
git clone https://github.com/X1pheR/asuswrt-mcp.git
cd asuswrt-mcp
# Create virtual environment
python -m venv .venv
# Activate (Linux/macOS)
source .venv/bin/activate
# Activate (Windows)
.venv\Scripts\activate
# Install dependencies
pip install -e .
2. Configure environment
# Copy example configuration
cp .env.example .env
# Edit with your router credentials
# Use your favorite editor:
notepad .env # Windows
nano .env # Linux/macOS
3. Configure .env
# Required: Router connection
ASUSWRT_HOST=192.168.1.1
ASUSWRT_SSH_USERNAME=admin
# Choose one SSH authentication method; key authentication is recommended.
ASUSWRT_SSH_KEY_FILE=~/.ssh/id_ed25519
# ASUSWRT_SSH_PASSWORD=your_password
# Optional: Enable mutations (disabled by default)
# ASUSWRT_ALLOW_MUTATIONS=true
# Optional: Connection settings
# ASUSWRT_SSH_PORT=22
# ASUSWRT_TIMEOUT_SECONDS=10
Before starting the MCP server, verify the router's SSH host-key fingerprint through a trusted channel and add it to the account's normal SSH known_hosts store (for example by making one verified OpenSSH connection). The server never auto-accepts an unknown or changed host key.
Usage
Run the MCP server
# Standard stdio mode
python -m asuswrt_mcp.server
# Or use the entry point
asuswrt-mcp
Configure in Claude Desktop / Cursor
Add to your claude_desktop_config.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)
npx @modelcontextprotocol/inspector python -m asuswrt_mcp.server
Development
Run the canonical local verification gate:
./scripts/verify.sh
This runs the maintained compatibility tests, builds wheel/sdist artifacts and performs the HIGH/CRITICAL dependency, secret and misconfiguration scan. See CONTRIBUTING.md for development and safety requirements.
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/ # Unit and release-contract tests
├── .env.example # Example configuration
├── docs/tools.md # Complete MCP tool reference
├── scripts/verify.sh # Canonical local verification gate
├── pyproject.toml # Project metadata
└── README.md # This file
License
MIT License - see LICENSE for details.
Acknowledgments
- asusrouter for the underlying Python library
- MCP for the protocol specification
- AsusWRT-Merlin for the firmware
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hypershell_asuswrt_mcp-0.2.1.tar.gz.
File metadata
- Download URL: hypershell_asuswrt_mcp-0.2.1.tar.gz
- Upload date:
- Size: 169.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420db56ef6582192a0d5c0fcf68a24499118dca5f29b7ffc9491c1bf58571bc0
|
|
| MD5 |
6281e97d027a1859320098cee5015db5
|
|
| BLAKE2b-256 |
d200cf03d0f8175824843defbc75ed08838131eb7172b33544e65b038655ea75
|
Provenance
The following attestation bundles were made for hypershell_asuswrt_mcp-0.2.1.tar.gz:
Publisher:
release.yml on X1pheR/asuswrt-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypershell_asuswrt_mcp-0.2.1.tar.gz -
Subject digest:
420db56ef6582192a0d5c0fcf68a24499118dca5f29b7ffc9491c1bf58571bc0 - Sigstore transparency entry: 2724304438
- Sigstore integration time:
-
Permalink:
X1pheR/asuswrt-mcp@fbae02304093cc2e8dd05decd31550f9c9615da3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/X1pheR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fbae02304093cc2e8dd05decd31550f9c9615da3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file hypershell_asuswrt_mcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hypershell_asuswrt_mcp-0.2.1-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
802e06bfe73f920e82c14f4e2e49107b5a8cc474d92e88cc0353db1c23466b18
|
|
| MD5 |
60f096974d0a174987475057983657b1
|
|
| BLAKE2b-256 |
774ae364b5eab131f23ac6ea627db47c101f070ed74d16bfde8b0cde5cea80e1
|
Provenance
The following attestation bundles were made for hypershell_asuswrt_mcp-0.2.1-py3-none-any.whl:
Publisher:
release.yml on X1pheR/asuswrt-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypershell_asuswrt_mcp-0.2.1-py3-none-any.whl -
Subject digest:
802e06bfe73f920e82c14f4e2e49107b5a8cc474d92e88cc0353db1c23466b18 - Sigstore transparency entry: 2724305058
- Sigstore integration time:
-
Permalink:
X1pheR/asuswrt-mcp@fbae02304093cc2e8dd05decd31550f9c9615da3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/X1pheR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fbae02304093cc2e8dd05decd31550f9c9615da3 -
Trigger Event:
workflow_dispatch
-
Statement type: