๐ฅ๏ธ Shell MCP Server
blazickjp/shell-mcp-server ยท 22 stars ยท Python ยท Apache-2.0
MCP server Secure shell command execution MCP server for Claude AI. Enables controlled shell access within specified directories.
Install
The repo has no one-line install. Follow its README.
Files
๐ฅ๏ธ Shell MCP Server
๐ Add secure shell command execution capabilities to your AI applications with the Shell MCP Server! Built for the Model Context Protocol.
โจ Features
- ๐ Secure Execution - Commands run only in specified directories
- ๐ Multiple Shells - Support for bash, sh, cmd, powershell
- โฑ๏ธ Timeout Control - Automatic termination of long-running commands
- ๐ Cross-Platform - Works on both Unix and Windows systems
- ๐ก๏ธ Safe by Default - Built-in directory and shell validation
๐ Quick Start
Installation
# Using pip pip install shell-mcp-server # Using uv (recommended) uv pip install shell-mcp-server
๐ Claude Desktop Integration
Add this to your Claude Desktop config to enable shell command execution:
๐ Click to view configuration
{
"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"
]
}
}
}
๐ฎ Usage Examples
Basic File Operations
# List directory contents
result = execute_command(
command="ls -la",
shell="bash",
cwd="/path/to/project"
)
# Find files by pattern
result = execute_command(
command="find . -name '*.py'",
shell="bash",
cwd="/path/to/project"
)
Project Management
# Git operations
result = execute_command(
command="git status && git diff",
shell="bash",
cwd="/path/to/repo"
)
# Package management
result = execute_command(
command="pip list --outdated",
shell="bash",
cwd="/path/to/python/project"
)
System Information
# Resource usage
result = execute_command(
command="df -h && free -h",
shell="bash",
cwd="/path/to/dir"
)
# Process monitoring
result = execute_command(
command="ps aux | grep python",
shell="bash",
cwd="/path/to/dir"
)
File Processing
# Search file content
result = execute_command(
command="grep -r 'TODO' .",
shell="bash",
cwd="/path/to/project"
)
# File manipulation
result = execute_command(
command="awk '{print $1}' data.csv | sort | uniq -c",
shell="bash",
cwd="/path/to/data"
)
Windows-Specific Examples
# List processes
result = execute_command(
command="Get-Process | Where-Object {$_.CPU -gt 10}",
shell="powershell",
cwd="C:\\path\\to\\dir"
)
# System information
result = execute_command(
command="systeminfo | findstr /B /C:'OS'",
shell="cmd",
cwd="C:\\path\\to\\dir"
)
โ๏ธ Configuration
Configure behavior with command-line arguments:
| Argument | Description |
|---|---|
directories |
๐ List of allowed directories |
--shell name path |
๐ Shell specifications (name and path) |
Environment variables:
COMMAND_TIMEOUT: โฑ๏ธ Max execution time in seconds (default: 30)
๐ก๏ธ Security Features
- ๐ Directory Isolation: Commands can only execute in specified directories
- ๐ Shell Control: Only configured shells are allowed
- โฐ Timeout Protection: All commands have a configurable timeout
- ๐ Path Validation: Working directory validation prevents traversal attacks
- ๐ค Permission Isolation: Commands run with the same permissions as the server process
๐ ๏ธ Development
Set up your development environment:
# Create and activate virtual environment uv venv source .venv/bin/activate # Install development dependencies uv pip install -e ".[test]" # Run tests python -m pytest # Run tests with coverage python -m pytest --cov=shell_mcp_server
๐ค Contributing
Contributions are welcome! Feel free to:
- ๐ Report bugs
- ๐ก Suggest features
- ๐ง Submit pull requests
- ๐ Improve documentation
๐ License
MIT License - see LICENSE for details.
๐ Enhance Your AI with Secure Shell Access! ๐
Built for the Model Context Protocol | Made with โค๏ธ by the MCP Community
๐ Star us on GitHub!
If you find this tool useful, consider giving it a star! It helps others discover the project.
Facts
- Kind
- MCP server
- Group
- Uncategorized
- Stars
- 22
- License
- Apache-2.0
- Language
- Python
- Last push
- 2025-08-19
- Forks
- 9
- 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
- 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
- 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
- 4Scrapling MCP Serverd4vinci/scrapling๐ท๏ธ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
- 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k