From 650dc7186ec47f198bf9774846963e6c65831576 Mon Sep 17 00:00:00 2001 From: kory Date: Fri, 2 Oct 2026 14:34:30 +0800 Subject: [PATCH] docs: document constrained diagnostic mode --- README.md | 2 +- deploy/README.md | 2 +- docs/ARCHITECTURE.md | 5 ++++- docs/DEV_SPEC.md | 2 +- docs/DOCUMENTATION_BASELINE_20261002.md | 2 +- docs/MCP_INTEGRATION.md | 9 ++++++++- docs/PROGRESS_TRACKING.md | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 91b2f1e..b18c8e0 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ Tool Registry 首先确定操作风险: ## 🤖 当前 MCP 能力 -目前共 **11 个 MCP Tools**: +目前共 **12 个 MCP Tools**: | Tool | Risk | 功能 | | :--- | :--- | :--- | diff --git a/deploy/README.md b/deploy/README.md index 1ec7b44..b4db4f5 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -195,7 +195,7 @@ Agent 启动后主动连接 Hub,并在设备列表中显示为 `online`。 本地 stdio 使用 `vps-commander-mcp-stdio`。 -当前共 11 个 MCP tools,详见 `docs/MCP_INTEGRATION.md`。 +当前共 12 个 MCP tools,详见 `docs/MCP_INTEGRATION.md`。 --- diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 83f10ba..425525e 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -88,6 +88,7 @@ Agent 返回结果后,Hub 完成审计并将结果返回 HTTP/MCP 调用方。 | :--- | :--- | | Low | read_file、read_multiple_files、list_directory、file_info、search、list_processes | | Medium | edit_block、write_file、create_directory、move_file、mcp_call | +| Low | diagnostic_command:严格白名单只读诊断(Docker、systemd、journal、网络监听、磁盘、内存、uptime) | | High | exec_command、start_process、interact_with_process、kill_process、force_terminate | ### 4.3 Policy Snapshot @@ -121,7 +122,7 @@ kill / terminate 使用 Session 内部进程句柄,不接受客户端任意 PI ## 六、MCP 架构 -当前 MCP 共 11 个工具: +当前 MCP 共 12 个工具: 1. `list_devices` 2. `exec_command` 3. `read_file` @@ -129,6 +130,8 @@ kill / terminate 使用 Session 内部进程句柄,不接受客户端任意 PI 5. `create_directory` 6. `move_file` 7. `list_processes` +8. `diagnostic_command`:严格白名单的只读系统诊断; + 8. `edit_block` 9. `write_file` 10. `list_agent_mcp` diff --git a/docs/DEV_SPEC.md b/docs/DEV_SPEC.md index cdffbfc..3c89ef8 100644 --- a/docs/DEV_SPEC.md +++ b/docs/DEV_SPEC.md @@ -86,7 +86,7 @@ Hub 根据 Credential 建立 Canonical Device Identity。 Server version:`1.2.0`。 Protocol Version:`2024-11-05`。 -当前工具共 11 个: +当前工具共 12 个: `list_devices`、`exec_command`、`read_file`、`read_multiple_files`、`create_directory`、`move_file`、`list_processes`、`edit_block`、`write_file`、`list_agent_mcp`、`call_agent_mcp`。 远程 transport:legacy HTTP + SSE。 diff --git a/docs/DOCUMENTATION_BASELINE_20261002.md b/docs/DOCUMENTATION_BASELINE_20261002.md index 3f6aceb..0b96245 100644 --- a/docs/DOCUMENTATION_BASELINE_20261002.md +++ b/docs/DOCUMENTATION_BASELINE_20261002.md @@ -40,7 +40,7 @@ VPS-Commander 是自托管、多节点、AI Agent 友好的 Linux 运维控制 ## 三、当前 MCP 基线 -11 个工具: +12 个工具: `list_devices`、`exec_command`、`read_file`、`read_multiple_files`、`create_directory`、`move_file`、`list_processes`、`edit_block`、`write_file`、`list_agent_mcp`、`call_agent_mcp`。 远程:legacy SSE。 diff --git a/docs/MCP_INTEGRATION.md b/docs/MCP_INTEGRATION.md index e32335d..2733d21 100644 --- a/docs/MCP_INTEGRATION.md +++ b/docs/MCP_INTEGRATION.md @@ -20,7 +20,7 @@ VPS-Commander 当前提供两种 MCP 接入模式: --- -## 二、当前支持的 11 大 MCP Tools +## 二、当前支持的 12 大 MCP Tools | Tool 名称 | 风险等级 | 参数/功能说明 | | :--- | :--- | :--- | @@ -31,6 +31,7 @@ VPS-Commander 当前提供两种 MCP 接入模式: | `create_directory` | Medium | 创建目录 | | `move_file` | Medium | 移动/重命名文件 | | `list_processes` | Low | 查看进程 | +| `diagnostic_command` | Low | 严格白名单只读诊断,不接受任意 Shell | | `edit_block` | Medium | 唯一匹配 + 原子写回 | | `write_file` | Medium | 创建或覆写文件 | | `list_agent_mcp` | Low | 查询 Agent MCP 服务 | @@ -145,6 +146,12 @@ API Key 不应提交到 Git 仓库。 ### 6.6 list_processes - `device` 可选。 +### 6.7 diagnostic_command +- `device`、`action` 必填。 +- `action` 仅允许:`docker_ps`、`docker_logs`、`docker_inspect`、`systemctl_status`、`journalctl`、`ss_listen`、`df`、`free`、`uptime`。 +- 这是 Low 风险只读诊断通道,不接受任意 Shell;Medium 模式可使用,但 `exec_command` 仍保持 High。 + + ### 6.7 edit_block - `device`、`path`、`old_text`、`new_text`。 - `old_text` 必须唯一匹配。 diff --git a/docs/PROGRESS_TRACKING.md b/docs/PROGRESS_TRACKING.md index 1be184c..7184b04 100644 --- a/docs/PROGRESS_TRACKING.md +++ b/docs/PROGRESS_TRACKING.md @@ -28,7 +28,7 @@ ## 二、MCP 当前能力 -当前共 11 个 Tools: +当前共 12 个 Tools: 1. `list_devices` 2. `exec_command` 3. `read_file`