OpenWrt MCP Controller
Provides tools for managing OpenWrt routers, including reboot, system and network status retrieval, log reading, and LED control.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenWrt MCP Controller check the system status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenWrt MCP Controller
This project provides a Model Context Protocol (MCP) server for managing OpenWrt devices. It allows you to interact with and control an OpenWrt router through a simple API.
The server utilizes fastmcp to expose OpenWrt functionalities as tools that can be called remotely.
1. Prerequisites
For the server to have full functionality, a custom LuCI RPC script must be placed on the target OpenWrt device.
Install sys.lua on OpenWrt
The sys.lua file in this repository extends the capabilities of the LuCI JSON-RPC interface. You must copy this file to your OpenWrt router for tools like system_status, network_status, and set_led_state to work.
Copy the file to your OpenWrt device: Use
scpor any other file transfer method to copysys.luato your router.scp sys.lua root@<your_openwrt_ip>:/usr/lib/lua/luci/sys.luaVerify Permissions: Ensure the file has the correct permissions.
ssh root@<your_openwrt_ip> "chmod 644 /usr/lib/lua/luci/sys.lua"
Related MCP server: openwrt-mcp
2. Installation
You can install this package directly from PyPI.
pip install openwrt-mcp3. Configuration
The server is configured through environment variables. You must set the following before running the server:
OPENWRT_HOST: The full URL of your OpenWrt device (e.g.,http://192.168.1.1).OPENWRT_PASSWORD: The login password for your OpenWrt device.OPENWRT_USERNAME: (Optional) The login username. Defaults toroot.
Example:
export OPENWRT_HOST="http://192.168.1.1"
export OPENWRT_PASSWORD="your_secret_password"4. Usage
Once installed and configured, you can start the MCP server with the following configuration:
{
"mcpServers":{
"openwrt-mcp":{
"command":"uvx",
"args": [
"openwrt-mcp"
],
"env":{
"OPENWRT_HOST":"192.168.0.1",
"OPENWRT_PASSWORD":"root",
"OPENWRT_USERNAME":"12345678"
}
}
}
}The server will start and listen for incoming connections via standard I/O.
Available Tools
The following tools are exposed by the MCP server:
reboot(): Reboots the OpenWrt device.system_status(): Retrieves system and board information.network_status(): Gets the status of all network interfaces.read_log(): Reads the system log (logread).set_led_state(state: str): Sets the state of the "Green" LED.statecan be'on'or'off'.summary_log(): Provides a structured prompt template for an AI to summarize the output ofread_log().
Available Tools
5 toolsnetwork_statusA
取得OpenWRT所有網路介面的狀態。 會自動先登入取得Token再執行。
Inputs: no named parameters. Returns: result
read_logA
讀取OpenWRT的系統日誌 (logread)。 會自動先登入取得Token再執行。
Inputs: no named parameters. Returns: result
rebootA
Reboot OpenWRT. 會自動先登入取得Token再執行重開機。
Inputs: no named parameters. Returns: result
set_led_stateA
控制 Green LED 燈亮起或熄滅。 state: 'on' 或 'off'
Inputs: state (required). Returns: result
system_statusA
取得OpenWRT的系統狀態。 會自動先登入取得Token再執行。
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct function: network interfaces, system logs, reboot, LED control, and system status. No overlapping purposes.
Names use snake_case but mix patterns: two are noun_noun (network_status, system_status), one verb_noun (read_log), one single verb (reboot), and one verb_noun_noun (set_led_state). Inconsistent verb/noun ordering.
Five tools is a well-scoped set for a basic OpenWrt controller covering monitoring and simple control actions. Each tool serves a clear purpose.
The set covers essential monitoring and reboot, but lacks common management operations like package updates, firewall configuration, or network settings modifications. LED control is niche.
Related MCP Connectors
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Control your authorized Windows computers via OAuth: files, shell, apps, and task status.
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Manage monitors, status pages, incidents and maintenances in your openstatus workspace.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to manage OpenWRT routers remotely via SSH, supporting system monitoring, network management, OpenThread Border Router configuration, and package management through natural language commands.1917MIT
- AlicenseNot gradedqualityDmaintenanceAllows you to interact with an OpenWrt router via SSH, enabling command execution, file operations, and system info retrieval.ISC
- AlicenseAqualityDmaintenanceMCP server for monitoring and controlling WiFi routers (OpenWrt) via SSH, enabling device listing, status checks, WiFi configuration, rebooting, and more.717 npmMIT
- AlicenseBqualityCmaintenanceEnables management of OpenWrt routers via SSH, providing tools for network configuration, system administration, file operations, and package management through natural language.572MIT