home / mcp / asus merlin mcp server
Model Context Protocol (MCP) server for managing ASUS routers running Asuswrt-Merlin firmware via SSH/SCP.
Configuration
View docs{
"mcpServers": {
"kcsoukup-asus-merlin-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/home/yourusername/.ssh:/home/mcpuser/.ssh:ro",
"-e",
"ROUTER_HOST=192.168.1.1",
"-e",
"ROUTER_USER=admin",
"-e",
"ROUTER_KEY_FILE=/home/mcpuser/.ssh/id_rsa",
"kcsoukup/asus-merlin-mcp:latest"
],
"env": {
"ROUTER_HOST": "192.168.1.1",
"ROUTER_USER": "admin",
"ROUTER_KEY_FILE": "/home/mcpuser/.ssh/id_rsa"
}
}
}
}This MCP Server lets you manage ASUS routers running Asuswrt-Merlin via SSH/SCP from a centralized control point. It exposes a set of tools to monitor, configure, and automate router tasks, so you can administer firewall rules, VPN routing, DHCP reservations, NVRAM values, and more from your preferred MCP client.
You connect your MCP client to the ASUS Merlin MCP Server using the stdio (local) configuration. The server runs as a Docker container and accepts commands that map to router actions. Use the MCP client to run tool prompts such as checking system status, listing connected devices, managing DHCP reservations, filtering URLs, and controlling VPN routing.
Key usage patterns include: activating or inspecting router services, reading or writing NVRAM variables, uploading or downloading router files with integrity checks, and applying parental controls or firewall rules. Each tool is designed to be invoked by your MCP client with a clear, human-friendly prompt. When you issue a task, the MCP server connects to your router and returns structured results you can use in scripts or dashboards.
Prerequisites: you need a workstation with Docker and SSH access to your router. The router must have SSH enabled and be reachable on the network.
Step 1. Prepare SSH access to your router. Ensure SSH login is allowed and that you have a key-based authentication setup for secure access.
Step 2. Install Docker on your workstation if it is not already installed.
Step 3. Use the provided MCP configuration to run the server in Docker. The following example shows how to configure the router connection and run the container with SSH key access. Copy this configuration exactly as shown.
{
"mcpServers": {
"asus-router": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/home/yourusername/.ssh:/home/mcpuser/.ssh:ro",
"-e", "ROUTER_HOST=192.168.1.1",
"-e", "ROUTER_USER=admin",
"-e", "ROUTER_KEY_FILE=/home/mcpuser/.ssh/id_rsa",
"kcsoukup/asus-merlin-mcp:latest"
]
}
}
}Security-conscious users migrate to rootless containers. If you upgrade from an older version, update the container user to mcpuser and adjust the SSH key path and volume mount accordingly. Use the absolute SSH key path inside the container and ensure the SSH key is readable by the container user.
Complete MCP configuration example for v3.x safety changes. This shows the updated volume mount, environment variable, and image usage.
{
"mcpServers": {
"asus-router": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-v", "/home/yourusername/.ssh:/home/mcpuser/.ssh:ro",
"-e", "ROUTER_HOST=192.168.1.1",
"-e", "ROUTER_USER=admin",
"-e", "ROUTER_KEY_FILE=/home/mcpuser/.ssh/id_rsa",
"kcsoukup/asus-merlin-mcp:latest"
]
}
}
}Use SSH keys in place of passwords for better security. Keep SSH access limited to LAN unless WAN access is required. Be careful with NVRAM operations; incorrect values can corrupt the router. Always test commands manually before automating, and maintain backups of your router configuration.
If you encounter connection or permission issues, verify SSH accessibility, key permissions, and that the container user has access to the SSH key. For Docker-related problems, ensure the volume mount paths are absolute and accessible by the host running Docker.
Retrieve system information such as uptime, memory, and firmware versions.
List DHCP clients currently connected to the network.
Provide a comprehensive device list including DHCP/static/ARP entries.
Show the status of all WiFi radios and SSIDs.
Restart a specified router service.
Reboot the router (requires confirmation).
Check VPN client/server status.
List running processes on the router.
Read a specific NVRAM variable.
Write to an NVRAM variable.
Run a custom command on the router.
Read a file from the router.
Upload a file to the router with MD5 verification.
Download a file from the router with MD5 verification.
Add a MAC address to the WiFi MAC filter.
Remove a MAC filter entry.
List current MAC filter entries.
Add a static DHCP reservation for a MAC address.
Remove a DHCP reservation.
List all DHCP reservations.
Block or unblock a device's Internet access.
Show devices currently blocked from Internet access.
Route a device through a VPN client.
Remove a device from VPN routing.
Show all VPN routing policies.
Check VPN server status and connected clients.
List authorized VPN server users.