MCP Shell 服务器
用于执行实现模型上下文协议 (MCP) 的 shell 命令的安全服务器。该服务器允许远程执行授权的 shell 命令,并支持通过 stdin 输入。
特征
安全命令执行:只有授权的命令才能执行
标准输入支持:通过 stdin 将输入传递给命令
综合输出:返回 stdout、stderr、退出代码和执行时间
使用 Shell 运算符的安全性:验证 Shell 运算符(;、&&、||、|)后的命令
超时控制:设置命令的最大执行时间
在 Claude.app 中配置 MCP 客户端
已发布版本
本地版本
设置
安装
使用
启动服务器
ALLOW_COMMANDS
环境变量(或其别名ALLOWED_COMMANDS
)指定可以执行哪些命令。命令可以用逗号分隔,周围可以有空格。
ALLOW_COMMANDS 或 ALLOWED_COMMANDS 的有效格式:
请求格式
响应格式
成功响应:
错误响应:
安全
该服务器实施了多项安全措施:
命令白名单:只有明确允许的命令才能执行
Shell 运算符验证:shell 运算符(;、&&、||、|)后的命令也会根据白名单进行验证
无 Shell 注入:命令直接执行,无需 Shell 解释
发展
设置开发环境
克隆存储库
安装依赖项,包括测试要求
运行测试
API 参考
请求参数
场地 | 类型 | 强制的 | 描述 |
命令 | 细绳[] | 是的 | 命令及其参数作为数组元素 |
标准输入 | 细绳 | 不 | 传递给命令的输入 |
目录 | 细绳 | 不 | 执行命令的工作目录 |
暂停 | 所有的 | 不 | 最大执行时间(秒) |
响应字段
场地 | 类型 | 描述 |
标准输出 | 细绳 | 命令的标准输出 |
标准错误 | 细绳 | 命令错误输出 |
地位 | 所有的 | 退出状态代码 |
执行时间 | 漂浮 | 执行所需的时间(以秒为单位) |
错误 | 细绳 | 错误消息(仅在失败时显示) |
要求
Python 3.11 或更高版本
mcp>=1.1.0
执照
MIT 许可证 - 详情请参阅许可证文件
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
实现模型上下文协议 (MCP) 的安全服务器,可通过 stdin 支持控制授权 shell 命令的执行。
Related MCP Servers
- AsecurityAlicenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -1131MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides secure command-line access to Windows systems, allowing MCP clients like Claude Desktop to safely execute commands in PowerShell, CMD, and Git Bash shells with configurable security controls.Last updated -9256248MIT License
- AsecurityAlicenseAqualityA secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).Last updated -1307MIT License
- AsecurityAlicenseAqualityAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.Last updated -91757MIT License