Shell 命令 MCP 服务器
这是一个 MCP(模型上下文协议)服务器,允许在 Docker 容器内执行 Shell 命令。它提供了一个安全且隔离的工作空间,用于运行命令,而无需授予对主机 Docker 守护进程的访问权限。
特征
- 通过简单的 MCP 界面运行 shell 脚本
- 同步执行
- 异步执行,有 4 种不同的模式
- 完成:命令完成时通知
- line:在输出的每一行上通知
- 块:在输出的每个块上进行通知
- 字符:在输出的每个字符上通知
- 包含的 Kubernetes 工具:kubectl、helm、kustomize、hemfile
- 具有非 root 用户的隔离 Docker 容器环境
- 实现了主机-容器用户 ID/组 ID 映射。这允许容器以与主机相同的用户身份运行,确保容器创建的文件与主机创建的文件具有相同的所有权和权限。
- 将主机目录挂载到容器的 /home/mcp 目录以实现持久化。它成为 AI 工作的主目录。
- 如果主机目录为空,则初始文件将从容器中的备份复制。
设计理念
该 MCP 服务器为 AI 提供了类似人类的工作空间。授权不再受 MCP 功能的限制,而是受到容器隔离和外部授权限制的限制。
它提供了更多通用工具,例如 shell 脚本执行,以便无需专门的工具使用知识即可使用它们。
服务器实现尽可能简单,以方便代码审计。
入门
先决条件
- Docker
与 Claude 桌面版一起使用
将以下配置添加到您的 Claude for Desktop 配置文件中。
MacOS:
将/Users/user-name/ClaudeWorks
替换为您要提供给容器的目录。
视窗:
提供一些提示
对挂载目录下的文件进行操作。
可用的 MCP 工具
安全注意事项
- MCP 服务器在容器内以非 root 用户身份运行
- 容器无权访问主机 Docker 守护进程
- 用户工作区从主机挂载以实现持久性
执照
麻省理工学院
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
允许通过 Claude 的 MCP 接口在安全的 Docker 容器内执行 shell 命令,提供 Kubernetes 工具和隔离环境,而无需主机 Docker 守护进程访问。
Related Resources
Related MCP Servers
- -securityAlicense-qualityAn MCP server to create secure code sandbox environment for executing code within Docker containers.Last updated -236GoMIT License
- AsecurityAlicenseAqualityA secure MCP server for executing whitelisted shell commands with resource and timeout controls, designed for integration with Claude and other MCP-compatible LLMs.Last updated -202704TypeScriptMIT License
- -securityAlicense-qualityFacilitates isolated code execution within Docker containers, enabling secure multi-language script execution and integration with language models like Claude via the Model Context Protocol.Last updated -2PythonMIT License
- AsecurityFlicenseAqualityAllows Claude and other AI assistants to interact with Docker through the MCP protocol, enabling container and image management including listing, running, stopping, and pulling Docker resources.Last updated -64JavaScript