mcp-shell-server
90
MCP Shell Server is a secure platform for executing whitelisted shell commands remotely following the Model Context Protocol. It features command execution with stdin support and stringent security measures to ensure safe operations.
MCP Shell Server
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.
Features
- Secure Command Execution: Only whitelisted commands can be executed
- Standard Input Support: Pass input to commands via stdin
- Comprehensive Output: Returns stdout, stderr, exit status, and execution time
- Shell Operator Safety: Validates commands after shell operators (; , &&, ||, |)
- Timeout Control: Set maximum execution time for commands
Usage
Starting the Server
The ALLOW_COMMANDS
environment variable specifies which commands are allowed to be executed. Commands can be separated by commas with optional spaces around them.
Security
The server implements several security measures: command whitelisting, shell operator validation, and prevention of shell injection.
Requirements
- Python 3.11 or higher
- mcp>=1.1.0