Shell MCP Server is an MCP server that enables AI clients to execute command-line operations securely across local file systems. It connects large language model interfaces, such as Claude Desktop, directly to system shells including Bash, Zsh, Sh, Command Prompt, and PowerShell. Software engineers, system administrators, and automated development agents use this server to run commands, inspect local repositories, check system resources, and manage software packages within isolated environments. To enforce safety during autonomous agent runs, the server restricts execution strictly to explicitly configured directories, blocks directory traversal attempts, and limits executions to verified shell binaries. It also incorporates timeout enforcement to stop runaway scripts and operations, while maintaining the process permissions of the executing server. By exposing controlled command-line access via the Model Context Protocol, the server allows AI models to run developer tools, manage Git workflows, parse log files, and monitor processes without exposing uncontrolled access to the host operating system.
Category: Cloud & Infrastructure
Tags: automation, bash, command-execution, shell, terminal
Follow these steps to install and register Shell MCP Server with Claude Desktop: 1. Install the server package using pip or uv: bash pip install shell-mcp-server # or uv pip install shell-mcp-server 2. Open your Claude Desktop configuration file (claude_desktop_config.json). 3. Add the server entry under the mcpServers object, configuring your allowed directories and shell binaries: json { "mcpServers": { "shell-mcp-server": { "command": "uv", "args": [ "--directory", "/path/to/shell-mcp-server", "run", "shell-mcp-server", "/path/to/allowed/dir1", "/path/to/allowed/dir2", "--shell", "bash", "/bin/bash", "--shell", "zsh", "/bin/zsh" ] } } } 4. Save the configuration and restart Claude Desktop.
Part of MCP Servers
You can install Shell MCP Server using Python package managers. Run either pip install shell-mcp-server or uv pip install shell-mcp-server. After installation, configure the server in your MCP client settings with your target directories and shells.
Shell MCP Server executes command-line operations securely inside configured directories. It allows AI clients to run shell scripts, check Git repository statuses, monitor system resource usage, search files, and process text data across Unix and Windows environments.
The server supports cross-platform shells including bash, sh, zsh, cmd, and powershell. You specify the allowed shell names and their absolute executable paths when starting the server configuration in your MCP client.
The server features built-in execution timeout control to automatically terminate long-running processes. You can configure execution duration limits using the COMMAND_TIMEOUT environment variable, which defaults to 30 seconds if unspecified.
Yes, Shell MCP Server is open source software published under the MIT License. The complete source code and testing setup are available on GitHub.