ssh_exec
Runs shell commands in a persistent SSH session and returns JSON output, exit code, and current directory, enabling multi-step Linux administration across calls.
Instructions
在已打开的会话里执行一条 shell 命令并返回输出、退出码和当前目录。持久会话:cd/export 会保留到下一次调用。返回 JSON。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "ssh_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | 模式3 下强制执行高危命令 | |
| command | Yes | 要执行的命令,可包含管道、重定向、heredoc | |
| session | No | 会话名;只有一个会话时可省略 | |
| timeout | No | 超时秒数,默认 30 | |
| max_output | No | 最大输出字节数,默认 262144 |