dynamic-shell-server
by codelion·★ 41·Score 36
A Python MCP server for secure shell command execution with dynamic approval and audit logging.
Overview
The dynamic-shell-server is a Model Context Protocol implementation that provides secure execution of shell commands. Its core feature is a dynamic approval system requiring user confirmation before running commands, with options to allow once or permanently remember approvals. The server maintains comprehensive audit logs and stores approved commands persistently. It includes security features like command timeout protection and revocation capabilities, making it suitable for environments where shell access is needed but security is paramount.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this when you need to safely execute shell commands through an AI assistant but want granular control over what commands can run and maintain an audit trail.
When NOT to choose this
Not for production environments requiring high-performance command execution or complex permission models, as it's designed for interactive approval in AI assistant contexts.
Tools this server exposes
2 tools extracted from the READMEexecute_commandExecute a shell command with optional arguments
revoke_command_approvalRevoke approval for a previously approved command
Comparable tools
Installation
Installation
- Clone this repository:
git clone <repository-url>
cd dynamic-shell-server- Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtClaude Desktop Integration
- Open your Claude Desktop configuration:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Windows: %APPDATA%\Claude\claude_desktop_config.json
- Add the server configuration:
{
"mcpServers": {
"shell": {
"command": "/absolute/path/to/.venv/bin/python",
"args": ["/absolute/path/to/dynamic_shell_server.py"]
}
}
}- Restart Claude Desktop
FAQ
- How does the approval system work?
- When running a command for the first time, users are prompted with options to allow once, allow and remember for future use, or deny execution. Approved commands are stored in ~/.config/mcp-shell-server/approved_commands.json.
- What happens if a command times out?
- The server implements a 5-minute timeout for all commands. If a command doesn't complete within this timeframe, it's automatically terminated and recorded in the audit log.
Compare dynamic-shell-server with
Last updated · Auto-generated from public README + GitHub signals.