Cover image
Try Now
2025-04-02

Il s'agit d'un serveur MCP (Model Context Protocol) qui permet d'exécuter des commandes de shell dans un conteneur Docker. Il fournit un environnement sécurisé et isolé pour les commandes en cours d'exécution sans donner accès au démon Docker hôte.

3 years

Works with Finder

1

Github Watches

0

Github Forks

3

Github Stars

Shell Command MCP Server

This is an MCP (Model Context Protocol) server that allows executing shell commands within a Docker container. It provides a secure and isolated workspace for running commands without giving access to the host Docker daemon.

Features

  • Run shell scripts through a simple MCP interface
    • synchronous execution
    • asynchronous execution with 4 different modes
      • complete: notify when the command is completed
      • line: notify on each line of output
      • chunk: notify on each chunk of output
      • character: notify on each character of output
  • Kubernetes tools included: kubectl, helm, kustomize, hemfile
  • Isolated Docker container environment with non-root user
    • host-container userid/groupid mapping implemented. this allows the container to run as the same user as the host, ensuring that files created by the container have the same ownership and permissions as those created by the host.
    • mount a host directory to the container /home/mcp directory for persistence. it become the home directory the AI works in.
    • if the host directory is empty, the initial files will be copied form the backup in the container.

Design Philosophy

This MCP server provides AI with a workspace similar to that of a human. Authorization is limited not by MCP functions, but by container isolation and external authorization restrictions.

It provides more general tools such as shell script execution, so that they can be used without specialized knowledge of tool use.

The server implementation is kept as simple as possible to facilitate code auditing.

Getting Started

Prerequisites

  • Docker

Usage with Claude for Desktop

Add the following configuration to your Claude for Desktop configuration file.

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"
  ]
}

Replace /Users/user-name/ClaudeWorks with the directory you want to make available to the container.

Windows:

"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"
   ]
}

Feed some prompts

To Operate the files in the mounted directory.

Available MCP Tools

Security Considerations

  • The MCP server runs as a non-root user within the container
  • The container does not have access to the host Docker daemon
  • User workspace is mounted from the host for persistence

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • HiveNexus
  • Un bot de chat IA pour les petites et moyennes équipes, soutenant des modèles tels que Deepseek, Open AI, Claude et Gemini. 专为中小团队设计的 Ai 聊天应用 , 支持 Deepseek 、 Open Ai 、 Claude 、 Gemini 等模型。

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Sysc4lls
  • Lecteur de documentation IDA (Sort-of) MCP Server

    Reviews

    1 (1)
    Avatar
    user_vGUAEACr
    2025-04-16

    I've been using shell-command-mcp by kaznak for a while now, and it has significantly streamlined my workflow. The ability to execute shell commands efficiently within a controlled environment is a game-changer. The documentation is thorough and easy to follow, making setup a breeze. Highly recommended for anyone looking to optimize their command executions! Check it out at https://github.com/kaznak/shell-command-mcp.