Shell Command MCP Server
The Shell Command MCP Server allows executing shell commands within a secure and isolated Docker container environment.
Run shell scripts synchronously or asynchronously with multiple notification modes (complete, line, chunk, character)
Includes Kubernetes tools like kubectl, helm, kustomize, and hemfile
Provides security through non-root user execution and host-container userid/groupid mapping
Persists data by mounting a host directory to
/home/mcpin the containerCustomize execution with options for working directory, environment variables, and timeout settings
Initial files are copied to the mounted directory if it's empty
Runs commands within an isolated Docker container environment without giving access to the host Docker daemon.
Provides the Helm package manager for Kubernetes, enabling installation and management of Kubernetes applications.
Includes Kubernetes tools (kubectl, k9s) for managing Kubernetes clusters and resources.
Allows executing shell commands within a Docker container, providing a secure and isolated environment for running commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shell Command MCP Server check the status of my Kubernetes pods in the production namespace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OBSOLETE
I recommend using Claude Code by running claude mcp serve instead of this MCP server.
I have created ai-agent-workspace as a container to run Claude Code.
Please use it as needed.
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.
Related MCP server: K8s MCP Server
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
Available Tools
2 toolsexecute-bash-script-asyncA
This tool executes shell scripts asynchronously in bash. Executing each command creates a new bash process. Synchronous execution requires to wait the scripts completed. Asynchronous execution makes it possible to execute multiple scripts in parallel. You can reduce waiting time by planning in advance which shell scripts need to be executed and executing them in parallel. Avoid using execute-bash-script-sync tool unless you really need to, and use this execute-bash-script-async tool whenever possible.
Inputs: command (required), options (required).
execute-bash-script-syncA
This tool executes shell scripts synchronously in bash. Executing each command creates a new bash process. Synchronous execution requires to wait the scripts completed. Asynchronous execution makes it possible to execute multiple scripts in parallel. You can reduce waiting time by planning in advance which shell scripts need to be executed and executing them in parallel. Avoid using this execute-bash-script-sync tool unless you really need to, and use the execute-bash-script-async tool whenever possible.
Inputs: command (required), options (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools are perfectly distinct: one for asynchronous execution and one for synchronous execution. Their names and descriptions clearly differentiate their purposes, with no overlap or ambiguity in functionality.
Both tools follow a consistent verb_noun pattern with kebab-case (execute-bash-script-async and execute-bash-script-sync). The naming is predictable and uniform across the set.
With only 2 tools, the server feels thin for a shell command domain. While it covers basic execution modes, it lacks tools for other common operations like file manipulation, process monitoring, or environment inspection, making the scope incomplete.
The toolset is severely incomplete for a shell command server. It only provides script execution in two modes, missing essential operations like listing files, checking system status, managing processes, or handling input/output redirection, which are core to shell interactions.
Maintenance
Related MCP Connectors
I run shell commands on your private cloud environment (bash, sh, zsh)
Give your agent its own cloud: Postgres, Redis, a sandbox or any Docker image, in one MCP call.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceFacilitates isolated code execution within Docker containers, enabling secure multi-language script execution and integration with language models like Claude via the Model Context Protocol.5MIT
- AlicenseNot gradedqualityFmaintenanceEnables Claude to run Kubernetes CLI tools (kubectl, istioctl, helm, argocd) in a secure, containerized environment via the Model Context Protocol.211MIT
- AlicenseNot gradedqualityDmaintenanceA Docker-based MCP server that enables Claude to run Kubernetes CLI tools (kubectl, istioctl, helm, argocd) in a secure containerized environment for managing and troubleshooting clusters.MIT
- AlicenseNot gradedqualityDmaintenanceEnables executing shell commands on the host system via an MCP tool, with JWT/OAuth authentication and audit logging for secure remote access.1MIT