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
Installation
Clone this repository:
Create a virtual environment and activate it:
Install dependencies:
Usage
Standalone Mode
Run the server directly:
Claude 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:
Restart Claude Desktop
Command Approval Process
When running a command for the first time, you'll be prompted with:
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: