dynamic-shell-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dynamic-shell-serverrun 'npm install' in my project directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Dynamic Shell Command MCP Server
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.
Features
🔐 Dynamic command approval system
📝 Persistent storage of approved commands
📊 Comprehensive audit logging
⏱️ Command timeout protection
🔄 Command revocation capability
Related MCP server: Command Executor MCP Server
Installation
Clone this repository:
git clone <repository-url>
cd dynamic-shell-serverCreate a virtual environment and activate it:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtUsage
Standalone Mode
Run the server directly:
python dynamic_shell_server.pyClaude Desktop Integration
Open your Claude Desktop configuration:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%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
Command Approval Process
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):Available Tools
execute_command: Execute a shell commandParameters:
command: The command to executeargs: Optional list of command arguments
revoke_command_approval: Revoke approval for a previously approved commandParameters:
command: The command to revoke approval for
Available Resources
commands://approved: Lists all approved commands with their approval dates
Data Storage
The 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 commands
Security Features
User approval required for first-time command execution
Persistent storage of approved commands
Comprehensive audit logging
5-minute command timeout
No shell execution (prevents injection attacks)
Command revocation capability
Example Usage
Through 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]This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityAmaintenanceA 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.1192MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that allows secure execution of pre-approved commands, enabling AI assistants to safely interact with the user's system.13 npm22ISC
- AlicenseAqualityFmaintenanceAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.936 npm21MIT
- AlicenseCqualityDmaintenanceA secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.1MIT