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 "Install 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 Servercheck 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.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The bash script to execute | |
| options | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explains that 'Executing each command creates a new bash process' and describes the asynchronous nature, but lacks details about error handling, security implications, resource consumption, or what the tool returns. It mentions 'Synchronous execution requires to wait the scripts completed' which helps contrast behaviors, but more operational transparency would be beneficial for a tool executing arbitrary shell scripts.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized at 6 sentences. It's front-loaded with the core purpose, then explains the asynchronous nature and benefits, and ends with usage guidance. Some sentences could be more concise (e.g., 'Synchronous execution requires to wait the scripts completed' could be simplified), but overall it's well-structured with minimal redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of executing arbitrary shell scripts with no annotations and no output schema, the description is incomplete. It explains the asynchronous nature and provides usage guidance, but lacks critical information about security considerations, error handling, return values, or execution environment. For a tool that could have significant side effects, more comprehensive context is needed despite the good usage guidelines.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50% (only 'command' has a description in the schema, while 'options' and its nested properties lack schema descriptions). The tool description provides no parameter information beyond what's implied by the tool's purpose. The description doesn't mention any parameters, their meanings, or how they affect execution, so it doesn't compensate for the schema coverage gap. With 2 parameters and low schema coverage, this represents a significant documentation gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'executes shell scripts asynchronously in bash', providing a specific verb ('executes') and resource ('shell scripts'). It distinguishes from the sibling tool 'execute-bash-script-sync' by mentioning it in the last sentence, though the differentiation is more about usage preference than functional distinction. The purpose is clear but could be more specific about what 'asynchronously' means operationally.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool versus alternatives. It states 'Avoid using execute-bash-script-sync tool unless you really need to, and use this execute-bash-script-async tool whenever possible.' It also explains the benefit of asynchronous execution for parallel processing and reducing waiting time, giving clear context for when this approach is advantageous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The bash script to execute | |
| options | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses key behavioral traits: 'Executing each command creates a new bash process' and 'Synchronous execution requires to wait the scripts completed.' However, it lacks details about error handling, output format, security implications, or system resource usage. For a potentially dangerous tool like bash script execution with no annotations, this is a moderate disclosure level.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is 6 sentences with some redundancy ('synchronous execution' mentioned twice) and could be more front-loaded. The first sentence states the purpose clearly, but subsequent sentences mix behavioral details with usage guidelines in a somewhat disorganized way. It's not excessively verbose but could be more efficiently structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a potentially dangerous tool (bash script execution) with no annotations and no output schema, the description provides moderate context. It covers the synchronous nature and sibling comparison well, but lacks critical details like what happens on script failure, what output is returned, security warnings, or performance implications. For a tool with this complexity and risk profile, the description should do more.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50% (2 parameters total, with 'command' well-described but 'options' object lacking overall description). The description adds no parameter semantics beyond what's in the schema - it doesn't explain what 'command' should contain or how 'options' affect execution. With moderate schema coverage, the description doesn't compensate enough, resulting in a baseline 3 score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool 'executes shell scripts synchronously in bash' with specific verb+resource. It distinguishes from the sibling tool by mentioning 'synchronous execution requires to wait the scripts completed' and contrasting with 'asynchronous execution makes it possible to execute multiple scripts in parallel.' However, it doesn't explicitly name the sibling tool in the purpose statement, keeping it at 4 rather than 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool vs alternatives: 'Avoid using this execute-bash-script-sync tool unless you really need to, and use the execute-bash-script-async tool whenever possible.' It also explains the trade-off: synchronous execution requires waiting, while asynchronous allows parallel execution to reduce waiting time. This is comprehensive guidance with clear alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
- First observed
execute-bash-script-async - First observed
execute-bash-script-sync
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Paid remote MCP for LLM security scans, jailbreak checks, analytics, checkout, and readiness.
Claude Code / MCP skills for the dev pipeline: discover, spec, design, build, ship, operate.
Deploy full-stack apps (Postgres, Redis, S3, workers, backups) from Claude or curl. 59 MCP tools.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceFacilitates 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 gradedqualityDmaintenanceEnables Claude to run Kubernetes CLI tools (kubectl, istioctl, helm, argocd) in a secure, containerized environment via the Model Context Protocol.213MIT
- 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 gradedqualityCmaintenanceEnables executing shell commands on the host system via an MCP tool, with JWT/OAuth authentication and audit logging for secure remote access.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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