Enables remote management of OpenWrt routers via SSH, providing tools for system monitoring, network configuration, WiFi management, firewall rules, DHCP leases, package management with opkg, and OpenThread Border Router configuration for Thread/Matter networks.
Click on "Install 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 SSH MCP Servershow me the current WiFi status and connected clients"
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 SSH MCP Server π³
A containerized MCP (Model Context Protocol) server for managing OpenWRT routers via SSH. This server allows AI agents (like Claude) to execute commands and manage OpenWRT routers remotely and securely.
π STATUS: β Fully functional and tested with physical router
β¨ Features
π³ Docker Ready - Optimized image with multi-stage build (271MB)
π Robust Security - Command whitelist, read-only filesystem, audit logging
π οΈ 19 OpenWRT Tools - Complete router management (network, system, Thread, packages)
π Easy Integration - Compatible with Claude Desktop and VS Code
π Monitoring - Detailed logs of all operations
π MCP Toolkit - Fully compatible with Docker Desktop MCP
π¦ Package Management - Install/remove IPK packages with opkg
π OpenThread OTBR - Support for Thread Border Router
Architecture
Features
π Secure SSH authentication (password or key-based)
π οΈ OpenWRT-specific tools (ubus, uci)
β Command validation with whitelist
π Audit logging
π³ Docker support (optional)
π Integration with Claude Desktop and VS Code
Requirements
Python 3.10+
OpenWRT router with SSH enabled
SSH access to router (root user recommended)
Installation
1. Clone or create the project
2. Create virtual environment and install dependencies
3. Configure SSH credentials
4. Generate and copy SSH key (recommended)
π§ Configuration
Claude Desktop (Docker)
Includes optimized configuration in claude_desktop_config.json:
VS Code with GitHub Copilot
The project includes complete VS Code configuration:
Option 1: Direct Python (Recommended)
Option 2: With Tasks
Option 3: Startup Script
Script Helper
Use docker-mcp.ps1 for all operations:
π οΈ Available Tools
System & Network (8 tools)
openwrt_test_connection- Test SSH connectionopenwrt_execute_command- Execute raw command (validated)openwrt_get_system_info- System info (uptime, memory, CPU)openwrt_restart_interface- Restart network interfaceopenwrt_get_wifi_status- WiFi status and clientsopenwrt_list_dhcp_leases- List DHCP clientsopenwrt_get_firewall_rules- View firewall rulesopenwrt_read_config- Read UCI config file
OpenThread Border Router (5 tools)
openwrt_thread_get_state- Current Thread stateopenwrt_thread_create_network- Create new Thread networkopenwrt_thread_get_dataset- Get network credentialsopenwrt_thread_get_info- Complete Thread network infoopenwrt_thread_enable_commissioner- Allow new devices
Package Management (6 tools)
openwrt_opkg_update- Update package listsopenwrt_opkg_install- Install IPK packagesopenwrt_opkg_remove- Remove packagesopenwrt_opkg_list_installed- List installed packagesopenwrt_opkg_info- Detailed package infoopenwrt_opkg_list_available- List available packages
π¬ Usage Examples
Once configured, you can ask Claude:
System & Network
"Show me the WiFi status on my router"
"List connected devices"
"Restart the wan interface"
"What's the router's memory usage?"
Package Management
"Update the package repositories"
"Install the luci-app-openthread package"
"Show me installed packages"
"Give me information about the ot-br-posix package"
OpenThread
"Create a Thread network called 'MyHome' on channel 15"
"Show me the Thread network status"
"Enable the commissioner to add new devices"
"Give me the Thread network credentials"
Security
β οΈ IMPORTANT: This server has root access to your router. Make sure to:
Use SSH key authentication (not password)
Keep
.envout of version controlReview commands before production execution
Enable audit logging
Limit SSH access from router to your PC
π Documentation
π Quick Start
QUICKSTART_DOCKER.md - Quick start with Docker
TEST_OPKG.md - Test IPK package management
π Detailed Guides
DOCKER_GUIDE.md - Complete Docker guide
π§ͺ Testing
π Implemented Security
β Read-only filesystem - Immutable container
β No capabilities - No special permissions
β SSH keys read-only - Protected keys
β Command whitelist - Only safe commands
β Audit logging - Complete logging
β Volatile tmpfs - /tmp cleaned on restart
β No privilege escalation - No sudo
π― Use Cases
Advanced Workflows
π Automated backup of UCI configurations
π Network monitoring - Connected devices, resource usage
π§ AI-guided troubleshooting
π Automatic documentation of changes
π¨ Network anomaly alerts
π¦ Package management - Install/update software
π Thread configuration - Create and manage Thread/Matter networks
π‘οΈ Security auditing - Review firewall rules
π³ Docker Hub (Optional)
π οΈ Development
π€ Contributing
Contributions are welcome! Please:
Fork the project
Create a branch for your feature
Commit your changes
Push to the branch
Open a Pull Request
π Resources
π License
MIT
Made with β€οΈ for the OpenWRT and MCP community