# Dynamic Shell Server

> Dynamic Shell Command MCP Server

- **Type:** MCP server
- **Install:** `agentstack add mcp-codelion-dynamic-shell-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [codelion](https://agentstack.voostack.com/s/codelion)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [codelion](https://github.com/codelion)
- **Source:** https://github.com/codelion/dynamic-shell-server

## Install

```sh
agentstack add mcp-codelion-dynamic-shell-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

1. Clone this repository:
```bash
git clone 
cd dynamic-shell-server
```

2. Create a virtual environment and activate it:
```bash
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

## Usage

### Standalone Mode

Run the server directly:

```bash
python dynamic_shell_server.py
```

### Claude Desktop Integration

1. Open your Claude Desktop configuration:
   - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
   - Windows: `%APPDATA%\Claude\claude_desktop_config.json`

2. Add the server configuration:
```json
{
    "mcpServers": {
        "shell": {
            "command": "/absolute/path/to/.venv/bin/python",
            "args": ["/absolute/path/to/dynamic_shell_server.py"]
        }
    }
}
```

3. Restart Claude Desktop

### Command Approval Process

When running a command for the first time, you'll be prompted with:
```
Command Approval Required

Command: 
Arguments: 

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

1. `execute_command`: Execute a shell command
   - Parameters:
     - `command`: The command to execute
     - `args`: Optional list of command arguments

2. `revoke_command_approval`: Revoke approval for a previously approved command
   - Parameters:
     - `command`: The command to revoke approval for

### Available Resources

1. `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 dates
- `audit.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]

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [codelion](https://github.com/codelion)
- **Source:** [codelion/dynamic-shell-server](https://github.com/codelion/dynamic-shell-server)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-codelion-dynamic-shell-server
- Seller: https://agentstack.voostack.com/s/codelion
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
