Shell Command

by kaznak

3 stars
Not rated
GitHub

About

Provides a secure Docker container environment for executing shell commands with Kubernetes tools, enabling isolated DevOps workflows and infrastructure management tasks.

Details

Author
kaznak
Repository
kaznak/shell-command-mcp
GitHub stars
3
License
MIT License
Categories
Productivity, Developer Tools, AI, Project Management, Infrastructure

- 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.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Shell Command
    Command (node, npx, python, etc.) docker
    Arguments
    • Argument 1 run
    • Argument 2 --rm
    • Argument 3 -i
    • Argument 4 --mount
    • Argument 5 type=bind,src=/Users/user-name/MCPHome,dst=/home/mcp
    • Argument 6 ghcr.io/kaznak/shell-command-mcp:latest

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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

execute-bash-script-sync

Execute a bash script synchronously within the Docker container.

execute-bash-script-async

Execute a bash script asynchronously within the Docker container.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

Linux

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

Macos

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

Windows

{
    "env": [],
    "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"
    ],
    "shell": false,
    "command": "docker"
}

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.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.