Skip to main content
Glama

Shell Command MCP Server

by kaznak

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:

"shell-command": { "command": "docker", "args": [ "run", "--rm", "-i", "--mount", "type=bind,src=/Users/user-name/MCPHome,dst=/home/mcp", "ghcr.io/kaznak/shell-command-mcp:latest" ] }

/Users/user-name/ClaudeWorks替换为您要提供给容器的目录。

视窗:

"shell-command": { "command": "docker", "args": [ "run", "--rm", "-i", "--mount", "type=bind,src=\\\\wsl.localhost\\Ubuntu\\home\\user-name\\MCPHome,dst=/home/mcp", "ghcr.io/kaznak/shell-command-mcp:latest" ] }

提供一些提示

对挂载目录下的文件进行操作。

可用的 MCP 工具

安全注意事项

  • MCP 服务器在容器内以非 root 用户身份运行
  • 容器无权访问主机 Docker 守护进程
  • 用户工作区从主机挂载以实现持久性

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

允许通过 Claude 的 MCP 接口在安全的 Docker 容器内执行 shell 命令,提供 Kubernetes 工具和隔离环境,而无需主机 Docker 守护进程访问。

  1. 特征
    1. 设计理念
      1. 入门
        1. 先决条件
        2. 与 Claude 桌面版一起使用
        3. 提供一些提示
      2. 可用的 MCP 工具
        1. 安全注意事项
          1. 执照

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              A MCP server that can run Kubernetes commands with a given kubeconfig path and provide interpretation of the commands.
              Last updated -
              1
              2
              JavaScript
              • Apple
            • -
              security
              F
              license
              -
              quality
              Provides isolated Docker environments for code execution, enabling users to create and manage containers, execute multi-language code, save and reproduce development environments, ensuring security and isolation.
              Last updated -
              6
              Python
              • Apple
            • A
              security
              A
              license
              A
              quality
              A 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 -
              1
              74
              Python
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              Allows 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 -
              2
              JavaScript
              • Apple

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/kaznak/shell-command-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server