Shell MCP Server

by blazickjp
Apache 2.0
9
  • Linux
  • Apple

Integrations

  • Allows execution of git commands for repository management, including viewing repository status and differences between commits.

  • Enables secure execution of shell commands in specified directories with support for multiple shell types, timeout control, and built-in security features to safely run system commands for file operations, git commands, package management, and system monitoring.

🖥️ Servidor Shell MCP

🚀 ¡Añade funciones de ejecución de comandos de shell seguro a tus aplicaciones de IA con el Servidor Shell MCP! Diseñado para el Protocolo de Contexto de Modelo.

✨ Características

  • 🔒 Ejecución segura : los comandos se ejecutan solo en directorios específicos
  • 🐚 Múltiples shells : compatibilidad con bash, sh, cmd y powershell
  • ⏱️ Control de tiempo de espera : finalización automática de comandos de larga duración
  • 🌍 Multiplataforma : funciona en sistemas Unix y Windows
  • 🛡️ Seguro por defecto : validación de directorio y shell integrada

🚀 Inicio rápido

Instalación

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

🔌 Integración de escritorio de Claude

Agregue esto a su configuración de Claude Desktop para habilitar la ejecución de comandos de shell:

{ "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" ] } } }

Ejemplos de uso

Operaciones básicas con archivos

# 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" )

Gestión de proyectos

# 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" )

Información del sistema

# 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" )

Procesamiento de archivos

# 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" )

Ejemplos específicos de 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" )

⚙️ Configuración

Configurar el comportamiento con argumentos de la línea de comandos:

ArgumentoDescripción
directories📁 Lista de directorios permitidos
--shell name path🐚 Especificaciones del shell (nombre y ruta)

Variables de entorno:

  • COMMAND_TIMEOUT : ⏱️ Tiempo máximo de ejecución en segundos (predeterminado: 30)

🛡️ Funciones de seguridad

  • 🔐 Aislamiento de directorio : los comandos solo se pueden ejecutar en directorios específicos
  • 🔒 Control de shell : solo se permiten shells configurados
  • Protección de tiempo de espera : todos los comandos tienen un tiempo de espera configurable
  • 🛑 Validación de ruta : La validación del directorio de trabajo evita ataques transversales
  • 👤 Aislamiento de permisos : los comandos se ejecutan con los mismos permisos que el proceso del servidor

🛠️ Desarrollo

Configure su entorno de desarrollo:

# 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

🤝 Contribuyendo

¡Agradecemos sus contribuciones! Siéntase libre de:

  • 🐛 Informar errores
  • 💡 Sugerir características
  • 🔧 Enviar solicitudes de extracción
  • 📚 Mejorar la documentación

📜 Licencia

Licencia MIT: consulte LICENCIA para obtener más detalles.


🌟 ¡Mejora tu IA con acceso seguro a Shell! 🌟

Creado para el Protocolo de Contexto del Modelo | Hecho con ❤️ por la Comunidad MCP

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Un servidor seguro que permite que las aplicaciones de IA ejecuten comandos de shell en directorios específicos, admitiendo múltiples tipos de shell (bash, sh, cmd, powershell) con funciones de seguridad integradas como aislamiento de directorio y control de tiempo de espera.

  1. ✨ Características
    1. 🚀 Inicio rápido
      1. Instalación
      2. 🔌 Integración de escritorio de Claude
    2. Ejemplos de uso
      1. Operaciones básicas con archivos
      2. Gestión de proyectos
      3. Información del sistema
      4. Procesamiento de archivos
      5. Ejemplos específicos de Windows
    3. ⚙️ Configuración
      1. 🛡️ Funciones de seguridad
        1. 🛠️ Desarrollo
          1. 🤝 Contribuyendo
            1. 📜 Licencia
              1. 🌟 ¡Mejora tu IA con acceso seguro a Shell! 🌟

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.
              Last updated -
              1
              74
              Python
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A secure server for executing terminal commands within predefined paths, allowing safe interaction by Large Language Models with operating system environments.
              Last updated -
              1
              11
              3
              JavaScript
              MIT License
              • Apple
              • Linux
            • A
              security
              A
              license
              A
              quality
              A Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.
              Last updated -
              1
              110
              25
              JavaScript
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.
              Last updated -
              1
              76
              2
              TypeScript
              MIT License
              • Linux
              • Apple

            View all related MCP servers

            ID: oqel9j0pea