Allows execution of bash commands and scripts in Debian WSL2 distributions, with automatic detection and configuration.
Enables checking Docker status and potentially executing Docker commands through the bash interface.
Supports running bash commands and scripts in Fedora WSL2 distributions, with automatic detection and configuration.
Allows execution of git commands through bash, with examples for checking repository status in home directories.
Supports running bash commands and scripts in Kali Linux WSL2 distributions, with automatic detection and configuration.
Enables execution of bash commands and scripts in WSL2 Linux environments, with universal compatibility across distributions.
Enables execution of bash commands and scripts in openSUSE WSL2 distributions, with automatic detection and configuration.
Supports listing installed Python packages and likely executing Python scripts through the bash interface.
Supports running bash commands and scripts in Ubuntu WSL2 distributions, with automatic detection and configuration.
Linux Bash MCP Server
A powerful Model Context Protocol (MCP) server that enables Claude Desktop to execute bash commands and scripts in any WSL2 Linux distribution on Windows. Features universal Linux compatibility, intelligent distribution detection, and comprehensive safety measures.
🚀 Quick Start
✨ Features
- 🐧 Universal Linux Support - Works with Ubuntu, Debian, Fedora, openSUSE, Alpine, and more
- 🔍 Smart Distribution Detection - Automatically detects and configures available WSL distributions
- 🛡️ Safe Configuration Merging - Preserves existing MCP servers when setting up
- 🔧 Comprehensive Diagnostics - Built-in troubleshooting and auto-fix tools
- ⚡ High Performance - Optimized command execution with configurable timeouts
- 📊 Detailed Logging - Debug mode for troubleshooting and monitoring
- 🔄 Easy Management - Simple scripts for setup, testing, and maintenance
🛠️ Available Tools
Tool | Description | Example Use |
---|---|---|
execute_bash_command | Run single bash commands | ps aux | grep nginx |
execute_bash_script | Execute bash scripts with args | Run monitoring scripts |
create_bash_script | Create new bash scripts | Generate automation scripts |
list_directory | List directory contents | Browse file systems |
get_system_info | Comprehensive system info | Check OS, memory, disk usage |
check_wsl_status | WSL and distribution status | Verify connectivity |
📋 Prerequisites
- Windows with WSL2 installed
- Any Linux distribution in WSL2 (Ubuntu, Debian, etc.)
- Node.js 18+
- Claude Desktop App
🎯 Installation & Setup
Option 1: Automated Setup (Recommended)
Option 2: Manual Setup
Option 3: Quick Diagnostics
⚙️ Configuration
The server automatically detects your WSL distributions and configures itself. Manual configuration is available in config.json
:
🔧 Available Scripts
Command | Description |
---|---|
npm run fix | Auto-fix common issues and setup |
npm run setup | Interactive configuration wizard |
npm run debug | Comprehensive diagnostics |
npm run test | Test all functionality |
npm run check-config | Verify configurations |
npm start | Start the MCP server |
🐧 Supported Linux Distributions
- Ubuntu (most common)
- Debian
- Fedora
- openSUSE
- Alpine Linux
- Kali Linux
- Oracle Linux
- And many more...
💡 Usage Examples
Once configured, use these commands in Claude Desktop:
System Administration
- "Show comprehensive system information for my Linux environment"
- "Check disk usage and available space"
- "List running processes sorted by CPU usage"
File Operations
- "List all files in /var/log with detailed information"
- "Find files modified in the last 24 hours"
- "Show directory sizes in /home"
Development Tasks
- "Check if Docker is running"
- "Show git status for repositories in my home directory"
- "List installed Python packages"
Automation
- "Create a backup script for my documents"
- "Generate a system monitoring script"
- "Create a log rotation script"
🛡️ Safety Features
- Configuration Preservation - Never overwrites existing MCP servers
- Automatic Backups - Creates backups of corrupted configurations
- Input Validation - Validates all commands and parameters
- Timeout Protection - Prevents hanging commands
- Error Handling - Comprehensive error reporting and recovery
🔍 Troubleshooting
Quick Fixes
Common Issues
WSL Not Found
Dependencies Missing
Configuration Issues
Server Not Starting
See TROUBLESHOOTING.md for detailed solutions.
🤝 Integration with Other MCP Servers
This server works seamlessly alongside:
- PowerShell MCP Server (Windows commands)
- Memory MCP Server (Persistent notes)
- File MCP Server (File operations)
- Git MCP Server (Version control)
- Any other MCP servers
📚 Project Structure
🔄 Version History
v1.0.0 (Current)
- ✅ Universal Linux distribution support
- ✅ Intelligent WSL distribution detection
- ✅ Safe configuration merging
- ✅ Comprehensive diagnostic tools
- ✅ Auto-fix utilities
- ✅ Enhanced error handling
- ✅ Debug mode support
🤝 Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Update documentation
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- Issues: GitHub Issues
- Documentation: Project Wiki
- Discussions: GitHub Discussions
🙏 Acknowledgments
- Anthropic for the Model Context Protocol
- Microsoft for WSL2 technology
- The open-source community for Linux distributions and tools
Made with ❤️ for the Claude Desktop and Linux community
⭐ Star this repository if you find it useful!
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A Model Context Protocol server that enables Claude Desktop to execute bash commands and scripts in WSL2 Linux distributions on Windows.
- 🚀 Quick Start
- ✨ Features
- 🛠️ Available Tools
- 📋 Prerequisites
- 🎯 Installation & Setup
- ⚙️ Configuration
- 🔧 Available Scripts
- 🐧 Supported Linux Distributions
- 💡 Usage Examples
- 🛡️ Safety Features
- 🔍 Troubleshooting
- 🤝 Integration with Other MCP Servers
- 📚 Project Structure
- 🔄 Version History
- 🤝 Contributing
- 📄 License
- 🆘 Support
- 🙏 Acknowledgments
Related MCP Servers
- AsecurityAlicenseAqualityA collection of Model Context Protocol servers that enable Claude Desktop to provide development assistance capabilities with filesystem, Git, shell command, and web search functionality without incurring API usage costs.Last updated -214TypeScriptMIT License
- -securityAlicense-qualityA custom Model Context Protocol server that gives Claude Desktop and other LLMs access to file system operations and command execution capabilities through standardized tool interfaces.Last updated -22PythonApache 2.0
- -securityFlicense-qualityA filesystem Model Context Protocol server that provides Claude Desktop with capabilities to read, write, and manipulate files on your system.Last updated -TypeScript
- -securityAlicense-qualityA Model Context Protocol server that allows Claude Desktop to manage and execute tasks in a queue-based system, supporting planning, execution, and completion phases.Last updated -3222TypeScriptMIT License