关于 Termix
termix-mcp 是面向自托管 Termix 的 MCP 服务,让 Agent 能查看和操作主机、片段、仪表板、指标及审计记录。它采用精选工具集,并提供只读模式、工具集控制和输出机密信息遮蔽。
主要功能
- 01管理主机与命令片段
- 02查看仪表板、指标和审计记录
- 03按工具集和允许列表控制工具
- 04只读模式隐藏并阻止写入操作
- 05在输出中遮蔽机密信息
适用场景
- 01查询已登记主机及其指标
- 02运行 Termix 中保存的命令片段
- 03检查审计活动与系统状态
- 04限制 Agent 仅执行只读操作
MCP 相关
该 MCP 服务将 Termix 主机、片段、仪表板、指标和审计功能作为工具提供给客户端,也可按需启用文件、容器等工具集。可通过 stdio 或 HTTP 连接,并支持只读模式及工具访问控制。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
uvx termix-mcpTERMIX_URLBase URL of the Termix instanceTERMIX_API_KEY密钥Termix API key (tmx_...)TERMIX_MCP_TOOLSETSdefault, all, or a comma-separated list (hosts,snippets,files,...)TERMIX_MCP_READ_ONLYHide and block every write tool本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
termix-mcp
面向 Termix 的 MCP 服务。Termix 是一款可自托管的 SSH/RDP/VNC 管理器。它让 Agent(Claude Desktop、Claude Code、Cursor、VS Code……)能够列出和操作 Termix 中的主机、代码片段、仪表板、指标和审计记录,基于 termix-sdk 构建。
它并非对 Termix API 的一对一封装,而是一组经过筛选的工具,默认安全(不提供机密信息、不保留 SSH 会话,除非显式选择对应工具集,否则不提供破坏性工具)。
安装
uvx termix-mcp
其他方式:pip install termix-mcp 或使用 ghcr.io/sujirodev/termix-mcp 镜像。
需要一个 Termix API 密钥(tmx_...),并为 Agent 将执行的操作授予最低限度的 RBAC 权限——请参阅 SECURITY.md。
在客户端中配置
Claude Desktop / Claude Code(claude_desktop_config.json 或 .mcp.json):
{
"mcpServers": {
"termix": {
"command": "uvx",
"args": ["termix-mcp"],
"env": {
"TERMIX_URL": "https://termix.example.com",
"TERMIX_API_KEY": "tmx_xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
Cursor / VS Code:格式相同,配置在各自的 MCP 配置文件中。
通过 MCP Registry 安装
termix-mcp 已在官方 MCP Registry 中发布,名称为 io.github.sujirodev/termix-mcp,其中列出了 PyPI(uvx)包和 OCI(Docker)镜像——请参阅 server.json。
支持基于注册表发现的客户端可以直接从中查找并安装,而无需手动编写上面的 JSON 配置:
curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.sujirodev/termix-mcp"
然后按照客户端自身的“从注册表添加”流程,搜索 io.github.sujirodev/termix-mcp。你仍需自行设置 TERMIX_URL 和 TERMIX_API_KEY——注册表条目不包含你的凭据。
你说什么 / 会发生什么
| 你说的话 | 工具执行的操作 |
|---|---|
| “我注册了哪些主机?” | termix_list_hosts |
| “显示主机 X 的指标” | termix_get_host_metrics |
| “在主机 X 上运行代码片段 Y” | termix_run_snippet(只读模式下会被阻止) |
| “为这台服务器创建一个新主机” | termix_create_host(只读模式下会被阻止) |
| “本周发生了哪些审计活动?” | termix_list_audit_events |
环境变量
| 变量 | 默认值 | 描述 |
|---|---|---|
TERMIX_URL | 必填 | Termix 基础 URL |
TERMIX_API_KEY | 必填 | tmx_... API 密钥(不支持 JWT/TOTP) |
TERMIX_SERVICE_URLS | 空 | 用于无代理部署的 JSON {"database": "http://..."} |
TERMIX_VERIFY_SSL | true | 验证 TLS 证书 |
TERMIX_TIMEOUT | 30 | 每个请求的超时时间(秒) |
TERMIX_MAX_RETRIES | 2 | 传递给 SDK |
TERMIX_MCP_READ_ONLY | false | 隐藏并禁用写入工具 |
TERMIX_MCP_TOOLSETS | default | default、all 或列表 hosts,snippets,files |
TERMIX_MCP_ENABLED_TOOLS | 空 | 按工具名称设置允许列表 |
TERMIX_MCP_DISABLED_TOOLS | 空 | 按工具名称设置拒绝列表 |
TERMIX_MCP_REDACT_SECRETS | true | 遮盖所有输出中的机密 |
TERMIX_MCP_MAX_ITEMS | 50 | 列表的默认项目数量上限 |
TERMIX_MCP_TRANSPORT | stdio | stdio 或 http |
TERMIX_MCP_HTTP_HOST / _PORT | 127.0.0.1 / 8765 | HTTP 传输绑定地址 |
TERMIX_MCP_HTTP_PATH | 自动生成并记录 | HTTP 端点的机密路径 |
TERMIX_MCP_LOG_LEVEL | INFO | 日志级别(stdio 使用 stderr,http 使用 stdout) |
工具集
默认启用:hosts、snippets、dashboard、metrics、system、audit。
选择启用(TERMIX_MCP_TOOLSETS=hosts,files,docker,...):credentials、files、docker、tunnels、alerts、automations、users。
禁用且需显式指定(永不包含在 all 中):admin、dangerous。
TERMIX_MCP_READ_ONLY=true 会隐藏并禁用任何工具集中的所有非只读工具。
工具
完整工具列表(由 scripts/generate_tool_docs.py 生成)
| Tool | Toolset | Read-only | Destructive | Flags |
|---|---|:---:|:---:|---|
| `termix_get_audit_forwarding` | admin | yes | no | admin |
| `termix_get_branding` | admin | yes | no | admin |
| `termix_get_encryption_status` | admin | yes | no | admin |
| `termix_get_host_defaults` | admin | yes | no | admin |
| `termix_get_termix_id_status` | admin | yes | no | admin |
| `termix_list_sso_providers` | admin | yes | no | admin |
| `termix_update_branding` | admin | no | no | admin |
| `termix_acknowledge_alert_firing` | alerts | no | no | - |
| `termix_create_alert_rule` | alerts | no | no | - |
| `termix_delete_alert_rule` | alerts | no | yes | - |
| `termix_list_alert_rules` | alerts | yes | no | - |
| `termix_get_session_log` | audit | yes | no | - |
| `termix_list_audit_events` | audit | yes | no | - |
| `termix_list_session_logs` | audit | yes | no | - |
| `termix_get_automation` | automations | yes | no | - |
| `termix_list_automations` | automations | yes | no | - |
| `termix_list_fleets` | automations | yes | no | - |
| `termix_run_automation` | automations | no | no | data-access |
| `termix_create_credential` | credentials | no | no | - |
| `termix_delete_credential` | credentials | no | yes | - |
| `termix_get_credential` | credentials | yes | no | - |
| `termix_list_credentials` | credentials | yes | no | - |
| `termix_reveal_credential` | credentials | yes | no | data-access |
| `termix_update_credential` | credentials | no | no | - |
| `termix_get_dashboard_summary` | dashboard | yes | no | - |
| `termix_get_homepage` | dashboard | yes | no | - |
| `termix_list_open_tabs` | dashboard | yes | no | - |
| `termix_list_workspaces` | dashboard | yes | no | - |
| `termix_get_container` | docker | yes | no | data-access |
| `termix_get_container_logs` | docker | yes | no | data-access |
| `termix_get_container_stats` | docker | yes | no | data-access |
| `termix_list_containers` | docker | yes | no | data-access |
| `termix_restart_container` | docker | no | no | data-access |
| `termix_start_container` | docker | no | no | data-access |
| `termix_stop_container` | docker | no | no | data-access |
| `termix_create_folder` | files | no | no | data-access |
| `termix_delete_file` | files | no | yes | data-access |
| `termix_list_files` | files | yes | no | data-access |
| `termix_move_file` | files | no | no | data-access |
| `termix_read_file` | files | yes | no | data-access |
| `termix_rename_file` | files | no | no | data-access |
| `termix_write_file` | files | no | no | data-access |
| `termix_create_host` | hosts | no | no | - |
| `termix_delete_host` | hosts | no | yes | - |
| `termix_disable_host_autostart` | hosts | no | no | - |
| `termix_enable_host_autostart` | hosts | no | no | - |
| `termix_get_host` | hosts | yes | no | - |
| `termix_get_network_topology` | hosts | yes | no | - |
| `termix_list_host_folders` | hosts | yes | no | - |
| `termix_list_host_tags` | hosts | yes | no | - |
| `termix_list_hosts` | hosts | yes | no | - |
| `termix_update_host` | hosts | no | no | - |
| `termix_get_host_metrics` | metrics | yes | no | - |
| `termix_get_host_status` | metrics | yes | no | - |
| `termix_get_metrics_history` | metrics | yes | no | - |
| `termix_get_proxmox_stats` | metrics | yes | no | - |
| `termix_list_active_alerts` | metrics | yes | no | - |
| `termix_list_host_statuses` | metrics | yes | no | - |
| `termix_create_snippet` | snippets | no | no | - |
| `termix_delete_snippet` | snippets | no | yes | - |
| `termix_get_snippet` | snippets | yes | no | - |
| `termix_list_snippets` | snippets | yes | no | - |
| `termix_run_snippet` | snippets | no | no | - |
| `termix_update_snippet` | snippets | no | no | - |
| `termix_get_preferences` | system | yes | no | - |
| `termix_get_system_info` | system | yes | no | - |
| `termix_list_api_keys` | system | yes | no | - |
| `termix_create_tunnel` | tunnels | no | no | data-access |
| `termix_delete_tunnel` | tunnels | no | no | data-access |
| `termix_get_tunnel` | tunnels | yes | no | - |
| `termix_list_tunnel_presets` | tunnels | yes | no | - |
| `termix_list_tunnels` | tunnels | yes | no | - |
| `termix_assign_role` | users | no | no | admin |
| `termix_get_user` | users | yes | no | admin |
| `termix_list_credential_access` | users | yes | no | admin |
| `termix_list_folder_access` | users | yes | no | admin |
| `termix_list_roles` | users | yes | no | admin |
| `termix_list_users` | users | yes | no | admin |
总计:78 个工具。
贡献
请参阅 CONTRIBUTING.md。
安全
有关威胁模型,请参阅 SECURITY.md。
许可证
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。