JUHE API Marketplace
gunjanjp avatar
MCP Server

Linux Bash MCP Server

A Model Context Protocol server that enables Claude Desktop to execute bash commands and scripts in WSL2 Linux distributions on Windows.

0
GitHub Stars
11/16/2025
Last Updated
No Configuration
Please check the documentation below.
  1. Home
  2. MCP Servers
  3. linuxshell-mcp

README Documentation

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

# 1. Clone the repository
git clone https://github.com/yourusername/linux-bash-mcp-server.git
cd linux-bash-mcp-server

# 2. Run automated setup
npm run fix

# 3. Restart Claude Desktop
# 4. Start using Linux commands in Claude!

✨ 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

ToolDescriptionExample Use
execute_bash_commandRun single bash commandsps aux | grep nginx
execute_bash_scriptExecute bash scripts with argsRun monitoring scripts
create_bash_scriptCreate new bash scriptsGenerate automation scripts
list_directoryList directory contentsBrowse file systems
get_system_infoComprehensive system infoCheck OS, memory, disk usage
check_wsl_statusWSL and distribution statusVerify 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)

git clone https://github.com/yourusername/linux-bash-mcp-server.git
cd linux-bash-mcp-server
npm run fix

Option 2: Manual Setup

# Install dependencies
npm install

# Run interactive setup
npm run setup

# Test functionality
npm test

Option 3: Quick Diagnostics

# Check for issues
npm run debug

# Verify configuration
npm run check-config

āš™ļø Configuration

The server automatically detects your WSL distributions and configures itself. Manual configuration is available in config.json:

{
  "wslDistribution": "auto-detect",
  "defaultTimeout": 30000,
  "scriptTimeout": 60000,
  "maxBufferSize": 10485760,
  "debugMode": false
}

šŸ”§ Available Scripts

CommandDescription
npm run fixAuto-fix common issues and setup
npm run setupInteractive configuration wizard
npm run debugComprehensive diagnostics
npm run testTest all functionality
npm run check-configVerify configurations
npm startStart 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

npm run fix        # Auto-resolve common issues
npm run debug      # Detailed diagnostics

Common Issues

WSL Not Found

wsl --install
wsl --install -d Ubuntu

Dependencies Missing

npm install

Configuration Issues

npm run check-config
npm run setup

Server Not Starting

npm run debug

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

linux-bash-mcp-server/
ā”œā”€ā”€ src/
│   └── index.js              # Main MCP server
ā”œā”€ā”€ test/
│   └── test.js               # Comprehensive tests
ā”œā”€ā”€ examples/
│   ā”œā”€ā”€ system_info.sh        # Example monitoring script
│   └── file_operations.sh    # Example file operations
ā”œā”€ā”€ config.json               # Server configuration
ā”œā”€ā”€ setup.js                  # Interactive setup
ā”œā”€ā”€ debug.js                  # Diagnostic tool
ā”œā”€ā”€ quick-fix.js             # Auto-fix utility
ā”œā”€ā”€ check-config.js          # Configuration checker
└── README.md                # This file

šŸ”„ 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:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Update documentation
  6. 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!

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.ai
Copyright Ā© 2025 - All rights reserved