Skip to main content
Glama
jsebgiraldo

OpenWRT SSH MCP Server

by jsebgiraldo

openwrt_get_system_info

Retrieve system status details like board information, uptime, memory usage, and CPU load from an OpenWRT router via SSH for monitoring and troubleshooting.

Instructions

Get comprehensive system information including board details, uptime, memory usage, and CPU load

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main implementation of get_system_info() in the OpenWRTTools class. Executes multiple commands (ubus call system board, ubus call system info, cat /proc/uptime, cat /proc/loadavg) to gather comprehensive system information, parses JSON output from ubus commands, and returns a structured response with board details, system info, uptime, and load average.
    @staticmethod async def get_system_info() -> dict[str, Any]: """ Get OpenWRT system information (uptime, memory, load). Returns: dict: System information """ try: await ssh_client.ensure_connected() # Execute multiple commands to gather system info commands = { "board": "ubus call system board", "info": "ubus call system info", "uptime": "cat /proc/uptime", "loadavg": "cat /proc/loadavg", } results = {} for key, cmd in commands.items(): result = await ssh_client.execute(cmd) if result["success"]: if key in ["board", "info"]: # Parse JSON output from ubus try: results[key] = json.loads(result["stdout"]) except json.JSONDecodeError: results[key] = result["stdout"] else: results[key] = result["stdout"] else: results[key] = {"error": result["stderr"]} return { "success": True, "system_info": results, } except Exception as e: logger.error(f"Failed to get system info: {e}") return { "success": False, "error": str(e), }
  • Tool registration schema defining openwrt_get_system_info with name, description, and inputSchema. The tool accepts no input parameters (empty properties and required arrays) and returns comprehensive system information including board details, uptime, memory usage, and CPU load.
    Tool( name="openwrt_get_system_info", description=( "Get comprehensive system information including board details, " "uptime, memory usage, and CPU load" ), inputSchema={ "type": "object", "properties": {}, "required": [], }, ),
  • Routing logic in the call_tool handler that maps 'openwrt_get_system_info' requests to the OpenWRTTools.get_system_info() method implementation.
    elif name == "openwrt_get_system_info": result = await OpenWRTTools.get_system_info()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jsebgiraldo/openwrt_ssh_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server