The Shell MCP Server enables AI applications to securely execute shell commands across Unix and Windows systems. It provides secure command execution restricted to pre-approved directories with built-in validation to prevent directory traversal attacks. The server supports multiple shells (bash, sh, cmd, powershell) and includes timeout control to automatically terminate long-running commands. Key capabilities include basic file operations (listing directories, finding files, content manipulation), project management (Git operations, package management), system monitoring (resource usage, process details), and general command execution with the same permissions as the server process for security isolation.
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.
🖥️ Shell MCP Server
🚀 Add secure shell command execution capabilities to your AI applications with the Shell MCP Server! Built for the Model Context Protocol.
✨ Features
🔒 Secure Execution - Commands run only in specified directories
🐚 Multiple Shells - Support for bash, sh, cmd, powershell
⏱️ Timeout Control - Automatic termination of long-running commands
🌍 Cross-Platform - Works on both Unix and Windows systems
🛡️ Safe by Default - Built-in directory and shell validation
🚀 Quick Start
Installation
🔌 Claude Desktop Integration
Add this to your Claude Desktop config to enable shell command execution:
🎮 Usage Examples
Basic File Operations
Project Management
System Information
File Processing
Windows-Specific Examples
⚙️ Configuration
Configure behavior with command-line arguments:
Argument | Description |
| 📁 List of allowed directories |
| 🐚 Shell specifications (name and path) |
Environment variables:
COMMAND_TIMEOUT
: ⏱️ Max execution time in seconds (default: 30)
🛡️ Security Features
🔐 Directory Isolation: Commands can only execute in specified directories
🔒 Shell Control: Only configured shells are allowed
⏰ Timeout Protection: All commands have a configurable timeout
🛑 Path Validation: Working directory validation prevents traversal attacks
👤 Permission Isolation: Commands run with the same permissions as the server process
🛠️ Development
Set up your development environment:
🤝 Contributing
Contributions are welcome! Feel free to:
🐛 Report bugs
💡 Suggest features
🔧 Submit pull requests
📚 Improve documentation
📜 License
MIT License - see LICENSE for details.
🌟 Enhance Your AI with Secure Shell Access! 🌟
Built for the Model Context Protocol | Made with ❤️ by the MCP Community
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A secure server that enables AI applications to execute shell commands in specified directories, supporting multiple shell types (bash, sh, cmd, powershell) with built-in security features like directory isolation and timeout control.
- ✨ Features
- 🚀 Quick Start
- 🎮 Usage Examples
- ⚙️ Configuration
- 🛡️ Security Features
- 🛠️ Development
- 🤝 Contributing
- 📜 License
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA secure server for executing terminal commands within predefined paths, allowing safe interaction by Large Language Models with operating system environments.Last updated -17510MIT License
- -securityFlicense-qualityA robust SSH server facilitating secure remote command execution with TMUX session management, multi-window support, and smart session recovery for improved AI-human interaction.Last updated -4
- -securityAlicense-qualityA lightweight FastAPI server that allows remote execution of shell commands on Windows, with real-time output streaming and security features like API key authentication and rate limiting.Last updated -1MIT License
- -securityFlicense-qualityEnables AI assistants to securely execute shell commands on local machines through an SSH interface with session management, command execution, and sudo support.Last updated -