Skip to main content
Glama

Shell MCP Server

by odysseus0

Shell MCP 服务器

提供 Shell 命令执行功能的模型上下文协议 (MLM) 服务器。该服务器使 LLM 能够执行 Shell 命令并以受控方式接收其输出。

可用工具

  • execute_command shell 命令并返回其输出
    • 必需参数:
      • command (字符串):要执行的 Shell 命令
    • 返回:
      • 命令结果包含:
        • command :执行的命令
        • output :组合 stdout 和 stderr 输出
        • return_code :命令执行返回代码

安装

使用 uv(推荐)

使用uv时无需特殊安装。我们将使用uvx直接运行mcp-server-shell

使用 PIP

或者,您可以通过 pip 安装mcp-server-shell

pip install mcp-server-shell

安装后,您可以使用以下命令将其作为脚本运行:

python -m mcp_server_shell

配置

为 Claude.app 配置

添加到您的 Claude 设置:

"mcpServers": { "shell": { "command": "uvx", "args": ["mcp-server-shell"] } }
"mcpServers": { "shell": { "command": "python", "args": ["-m", "mcp_server_shell"] } }

为 Zed 配置

添加到您的 Zed settings.json:

"context_servers": { "mcp-server-shell": { "command": "uvx", "args": ["mcp-server-shell"] } },
"context_servers": { "mcp-server-shell": { "command": "python", "args": ["-m", "mcp_server_shell"] } },

交互示例

执行shell命令:

{ "name": "execute_command", "arguments": { "command": "ls -la" } }

回复:

{ "command": "ls -la", "output": "total 24\ndrwxr-xr-x 5 user group 160 Jan 1 12:00 .\ndrwxr-xr-x 3 user group 96 Jan 1 12:00 ..", "return_code": 0 }

调试

您可以使用 MCP 检查器来调试服务器。对于 uvx 安装:

npx @modelcontextprotocol/inspector uvx mcp-server-shell

或者,如果您已将软件包安装在特定目录中或正在其上进行开发:

cd path/to/servers/src/shell npx @modelcontextprotocol/inspector uv run mcp-server-shell

克劳德的问题示例

  1. “当前目录中有哪些文件?”
  2. “显示 README.md 文件的内容”
  3. “当前系统日期是多少?”
  4. “检查 Python 是否已安装并显示其版本”

安全注意事项

⚠️警告:此服务器直接在您的系统上执行 Shell 命令。请谨慎使用并采取适当的安全措施,以防止未经授权或危险的命令执行。

贡献

我们鼓励您为扩展和改进 mcp-server-shell 做出贡献。无论您是想添加新功能、增强安全性还是改进文档,您的贡献都弥足珍贵。

有关其他 MCP 服务器和实现模式的示例,请参阅: https://github.com/modelcontextprotocol/servers

欢迎提交 Pull 请求!欢迎贡献新想法、错误修复或改进,让 mcp-server-shell 更加强大实用。

执照

mcp-server-shell 采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但需遵守 MIT 许可证的条款和条件。更多详细信息,请参阅项目仓库中的 LICENSE 文件。

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议服务器允许 LLM 执行 shell 命令并以受控方式接收其输出。

  1. 可用工具
    1. 安装
      1. 使用 uv(推荐)
      2. 使用 PIP
    2. 配置
      1. 为 Claude.app 配置
      2. 为 Zed 配置
    3. 交互示例
      1. 调试
        1. 克劳德的问题示例
          1. 安全注意事项
            1. 贡献
              1. 执照

                Related MCP Servers

                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.
                  Last updated -
                  31
                  323
                  2
                  TypeScript
                  MIT License
                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server that allows LLMs to interact with Python environments, execute code, and manage files within a specified working directory.
                  Last updated -
                  9
                  42
                  Python
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.
                  Last updated -
                  29
                  10
                  1
                  TypeScript
                  MIT License
                • -
                  security
                  -
                  license
                  -
                  quality
                  A Model Context Protocol server that allows LLMs to execute shell commands with explicit user permission through desktop notifications.
                  Last updated -
                  1
                  TypeScript
                  MIT License

                View all related MCP servers

                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/odysseus0/mcp-server-shell'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server