
Dynamic Shell
STDIOSecure shell command execution with dynamic approval system and audit logging.
Secure shell command execution with dynamic approval system and audit logging.
A Model Context Protocol (MCP) server that enables secure execution of shell commands with a dynamic approval system. This server allows running arbitrary commands while maintaining security through user approval and audit logging.
git clone <repository-url> cd dynamic-shell-server
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
Run the server directly:
python dynamic_shell_server.py
Open your Claude Desktop configuration:
~/Library/Application Support/Claude/claude_desktop_config.json
%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"] } } }
When running a command for the first time, you'll be prompted with:
Command Approval Required
Command: <command>
Arguments: <args>
This command has not been previously approved. Do you want to:
1. Allow this command once
2. Allow this command and remember for future use
3. Deny execution
Please choose an option (1-3):
execute_command
: Execute a shell command
command
: The command to executeargs
: Optional list of command argumentsrevoke_command_approval
: Revoke approval for a previously approved command
command
: The command to revoke approval forcommands://approved
: Lists all approved commands with their approval datesThe server stores its data in ~/.config/mcp-shell-server/
:
approved_commands.json
: List of approved commands and their approval datesaudit.log
: Detailed execution history of all commandsThrough Claude Desktop:
Human: Run 'npm install' in my project directory
Assistant: I'll help you run that command. Since this is the first time running 'npm install', you'll need to approve it.
[Command approval prompt appears]