Token导航 LogoToken导航TokenDH.com
Shell MCP Server logo
开发工具stdio官方级别未说明来源级核验

Shell MCP Server

MCP Server

Secure shell command execution MCP server for Claude AI. Enables controlled shell access within specified directories.

工具数

0

提示词数

0

GitHub Stars

19

资源数

0
PythonClaude开发工具ClaudeClaude Desktop

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

blazickjp

提供方

blazickjp

最后核验

2026/5/18 02:17

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install shell-mcp-server

详细介绍

🖥️ 壳牌MCP服务器

](https://badge.fury.io/py/shell-mcp-server) ![License: MIT](https://opensource.org/licenses/MIT) ![Python](https://www.python.org/downloads/) ![Code style: black](https://github.com/psf/black)

🚀 使用shell MCP Server为您的AI应用程序添加安全的shell命令执行功能!为模型上下文协议构建。

✨ 特性

  • 🔒 安全执行 -命令仅在指定目录中运行
  • 🐚 多个外壳 -支持bash、sh、cmd、powershell
  • ⏱️ 超时控制 -自动终止长时间运行的命令
  • 🌍 交叉平台的 -适用于Unix和Windows系统
  • 🛡️ 默认安全 -内置目录和shell验证

🚀 快速开始

安装

# Using pip
pip install shell-mcp-server

# Using uv (recommended)
uv pip install shell-mcp-server

🔌 Claude桌面集成

将此添加到您的Claude Desktop配置中,以启用shell命令执行:

📝 Click to view configuration

{
    "mcpServers": {
        "shell-mcp-server": {
            "command": "uv",
            "args": [
                "--directory",
                "/path/to/shell-mcp-server",
                "run",
                "shell-mcp-server",
                "/path/to/allowed/dir1",
                "/path/to/allowed/dir2",
                "--shell", "bash", "/bin/bash",
                "--shell", "zsh", "/bin/zsh"
            ]
        }
    }
}

🎮 使用示例

基本文件操作

# List directory contents
result = execute_command(
    command="ls -la",
    shell="bash",
    cwd="/path/to/project"
)

# Find files by pattern
result = execute_command(
    command="find . -name '*.py'",
    shell="bash",
    cwd="/path/to/project"
)

项目管理

# Git operations
result = execute_command(
    command="git status && git diff",
    shell="bash",
    cwd="/path/to/repo"
)

# Package management
result = execute_command(
    command="pip list --outdated",
    shell="bash",
    cwd="/path/to/python/project"
)

系统信息

# Resource usage
result = execute_command(
    command="df -h && free -h",
    shell="bash",
    cwd="/path/to/dir"
)

# Process monitoring
result = execute_command(
    command="ps aux | grep python",
    shell="bash",
    cwd="/path/to/dir"
)

文件处理

# Search file content
result = execute_command(
    command="grep -r 'TODO' .",
    shell="bash",
    cwd="/path/to/project"
)

# File manipulation
result = execute_command(
    command="awk '{print $1}' data.csv | sort | uniq -c",
    shell="bash",
    cwd="/path/to/data"
)

Windows特定示例

# List processes
result = execute_command(
    command="Get-Process | Where-Object {$_.CPU -gt 10}",
    shell="powershell",
    cwd="C:\\path\\to\\dir"
)

# System information
result = execute_command(
    command="systeminfo | findstr /B /C:'OS'",
    shell="cmd",
    cwd="C:\\path\\to\\dir"
)

⚙️ 配置

使用命令行参数配置行为:

参数描述
directories📁 允许的目录列表
--shell name path🐚 外壳规格(名称和路径)

环境变量:

  • COMMAND_TIMEOUT: ⏱️ 最大执行时间(秒)(默认值:30)

🛡️ 安全功能

  • 🔐 目录隔离:命令只能在指定目录中执行
  • 🔒 壳牌控制:只允许使用已配置的shell
  • 超时保护:所有命令都有可配置的超时
  • 🛑 路径验证:工作目录验证可防止遍历攻击
  • 👤 权限隔离:命令以与服务器进程相同的权限运行

🛠️ 发展

设置您的开发环境:

# Create and activate virtual environment
uv venv
source .venv/bin/activate

# Install development dependencies
uv pip install -e ".[test]"

# Run tests
python -m pytest

# Run tests with coverage
python -m pytest --cov=shell_mcp_server

🤝 贡献

欢迎投稿!请随意:

  • 🐛 报告错误
  • 💡 建议功能
  • 🔧 提交拉取请求
  • 📚 改进文档

📜 许可证

MIT许可证-请参阅 许可证 了解详情。

______________________________________________________________________

🌟 通过安全的Shell访问增强您的AI! 🌟

模型上下文协议 |由以下材料制成❤️ MCP社区

🎉 Star us on GitHub!

If you find this tool useful, consider giving it a star! It helps others discover the project.

目录标签

目录标签

PythonClaude开发工具developer-toolsShell命令执行本地部署AI工具集成跨平台支持安全执行环境

支持客户端

ClaudeClaude Desktop

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP