Shell MCP 服务器
提供 Shell 命令执行功能的模型上下文协议 (MLM) 服务器。该服务器使 LLM 能够执行 Shell 命令并以受控方式接收其输出。
可用工具
execute_command
shell 命令并返回其输出- 必需参数:
command
(字符串):要执行的 Shell 命令
- 返回:
- 命令结果包含:
command
:执行的命令output
:组合 stdout 和 stderr 输出return_code
:命令执行返回代码
- 命令结果包含:
- 必需参数:
安装
使用 uv(推荐)
使用uv
时无需特殊安装。我们将使用uvx
直接运行mcp-server-shell 。
使用 PIP
或者,您可以通过 pip 安装mcp-server-shell
:
安装后,您可以使用以下命令将其作为脚本运行:
配置
为 Claude.app 配置
添加到您的 Claude 设置:
为 Zed 配置
添加到您的 Zed settings.json:
交互示例
执行shell命令:
回复:
调试
您可以使用 MCP 检查器来调试服务器。对于 uvx 安装:
或者,如果您已将软件包安装在特定目录中或正在其上进行开发:
克劳德的问题示例
- “当前目录中有哪些文件?”
- “显示 README.md 文件的内容”
- “当前系统日期是多少?”
- “检查 Python 是否已安装并显示其版本”
安全注意事项
⚠️警告:此服务器直接在您的系统上执行 Shell 命令。请谨慎使用并采取适当的安全措施,以防止未经授权或危险的命令执行。
贡献
我们鼓励您为扩展和改进 mcp-server-shell 做出贡献。无论您是想添加新功能、增强安全性还是改进文档,您的贡献都弥足珍贵。
有关其他 MCP 服务器和实现模式的示例,请参阅: https://github.com/modelcontextprotocol/servers
欢迎提交 Pull 请求!欢迎贡献新想法、错误修复或改进,让 mcp-server-shell 更加强大实用。
执照
mcp-server-shell 采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。更多详细信息,请参阅项目仓库中的 LICENSE 文件。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器允许 LLM 执行 shell 命令并以受控方式接收其输出。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.Last updated -313232TypeScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.Last updated -942Python
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.Last updated -29101TypeScriptMIT License
- -security-license-qualityA Model Context Protocol server that allows LLMs to execute shell commands with explicit user permission through desktop notifications.Last updated -1TypeScriptMIT License