Skip to main content
Glama
kaznak

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 工作的主目录。

    • 如果主机目录为空,则初始文件将从容器中的备份复制。

Related MCP server: K8s MCP Server

设计理念

该 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 守护进程

  • 用户工作区从主机挂载以实现持久性

执照

麻省理工学院

Available Tools

2 tools
execute-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesThe bash script to execute
optionsYes

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines5/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
commandYesThe bash script to execute
optionsYes

TDQS

A3.7/5.0
Behavior3/5

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.

Conciseness3/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines5/5

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.

  1. 2 tool updates
    • First observedexecute-bash-script-async
    • First observedexecute-bash-script-sync

TDQS

A3.7/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Facilitates isolated code execution within Docker containers, enabling secure multi-language script execution and integration with language models like Claude via the Model Context Protocol.
    5
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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

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