Linuxshell MCP
L

Linuxshell MCP

An MCP server based on Linux Bash, which supports executing Bash commands and scripts in the Windows WSL2 environment. It has intelligent Linux distribution detection, secure configuration merging, and comprehensive diagnostic functions.
2 points
5.6K

Installation

Copy the following command to your Client for configuration
Note: Your key is sensitive information, do not share it with anyone.

๐Ÿš€ 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. It 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

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

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
}

๐Ÿ’ป Usage Examples

Basic Usage

Once configured, you can use various 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

๐Ÿ“š Documentation

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

๐Ÿ™ 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!

Alternatives

V
Vestige
Vestige is an AI memory engine based on cognitive science. By implementing 29 neuroscience modules such as prediction error gating, FSRS - 6 spaced repetition, and memory dreaming, it provides long - term memory capabilities for AI. It includes a 3D visualization dashboard and 21 MCP tools, runs completely locally, and does not require the cloud.
Rust
6.2K
4.5 points
M
Moltbrain
MoltBrain is a long-term memory layer plugin designed for OpenClaw, MoltBook, and Claude Code, capable of automatically learning and recalling project context, providing intelligent search, observation recording, analysis statistics, and persistent storage functions.
TypeScript
7.2K
4.5 points
B
Bm.md
A feature-rich Markdown typesetting tool that supports multiple style themes and platform adaptation, providing real-time editing preview, image export, and API integration capabilities
TypeScript
15.5K
5 points
S
Security Detections MCP
Security Detections MCP is a server based on the Model Context Protocol that allows LLMs to query a unified security detection rule database covering Sigma, Splunk ESCU, Elastic, and KQL formats. The latest version 3.0 is upgraded to an autonomous detection engineering platform that can automatically extract TTPs from threat intelligence, analyze coverage gaps, generate SIEM-native format detection rules, run tests, and verify. The project includes over 71 tools, 11 pre-built workflow prompts, and a knowledge graph system, supporting multiple SIEM platforms.
TypeScript
5.9K
4 points
P
Paperbanana
Python
7.6K
5 points
B
Better Icons
An MCP server and CLI tool that provides search and retrieval of over 200,000 icons, supports more than 150 icon libraries, and helps AI assistants and developers quickly obtain and use icons.
TypeScript
8.7K
4.5 points
A
Assistant Ui
assistant - ui is an open - source TypeScript/React library for quickly building production - grade AI chat interfaces, providing composable UI components, streaming responses, accessibility, etc., and supporting multiple AI backends and models.
TypeScript
7.2K
5 points
A
Apify MCP Server
The Apify MCP Server is a tool based on the Model Context Protocol (MCP) that allows AI assistants to extract data from websites such as social media, search engines, and e-commerce through thousands of ready-to-use crawlers, scrapers, and automation tools (Apify Actors). It supports OAuth and Skyfire proxy payment and can be integrated into MCP clients such as Claude and VS Code through HTTPS endpoints or local stdio.
TypeScript
7.3K
5 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
36.4K
5 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
22.8K
4.5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
27.0K
4.3 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
75.7K
4.3 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
35.5K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
68.4K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
22.3K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
51.5K
4.8 points