Skip to main content
Glama
LianXia233

router-ssh-mcp

by LianXia233

run_shell

Destructive

Execute shell commands on remote routers via SSH, with high-risk command blocking and mandatory confirmation to prevent damage.

Instructions

在路由器上执行任意 shell 命令(高危能力,默认关闭,需二次确认)。

安全约束(任意一条不满足都会返回错误而非执行): * 必须设置 ROUTER_MCP_ALLOW_SHELL=true 才会启用,否则返回 error.code = SHELL_DISABLED; * 默认拦截高危命令(rm -rf / mkfs / dd if= / 写入 /dev/* / fork 炸弹 / 管道进 shell 等), 命中时返回 error.code = BLOCKED_COMMAND; * 需把 confirm 设为命令本身的完整字符串进行二次确认,否则返回 CONFIRMATION_REQUIRED; * 命令以 root 身份在远端登录 shell 中执行,会绕过服务白名单,请谨慎使用。

参数: command: 要执行的 shell 命令字符串 confirm: 必须等于 command 的完整内容(含空格与引号)才真正执行

返回结构: {"ok": true, "data": {"raw_command", "exit_status", "stdout", "stderr", "duration_ms", "host", "reused_connection", "denied", "confirmed", "warning"}}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
confirmNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes far beyond the annotations, detailing exact error codes (SHELL_DISABLED, BLOCKED_COMMAND, CONFIRMATION_REQUIRED), command-blocking rules, root execution, bypass of the service whitelist, and the required confirm mechanism. This is exemplary behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a high-level warning, bullet-pointed safety constraints, parameter explanations, and return structure. Each sentence carries necessary operational information, and the risk warning is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, destructive, gated tool, this description covers enablement, blocked commands, confirmation requirements, execution identity, error codes, parameters, and return fields. An agent has everything it needs to invoke the tool safely and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema only provides types and nullability, with no description. The tool description fully compensates by explaining the command parameter and, crucially, that confirm must exactly equal the command string including spaces and quotes. This is essential semantic information the schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb and resource: execute arbitrary shell commands on the router. It also immediately flags this as a high-risk capability, distinguishing it from the sibling service-management and read-only tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides strong context: it is for arbitrary shell commands and is high-risk, default-disabled, and requires confirmation. It does not explicitly name sibling tools as alternatives, but the scope is clear enough for an agent to know when this tool is intended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.