mcp-bash
A simple model context protocol (MCP) server that allows Claude Desktop or other MCP aware clients to run Bash commands on your local machine.
claude mcp add --transport stdio patrickomatik-mcp-bash python -m mcp.cli.server --module server
How to use
MCP Bash exposes a simple interface to execute bash commands through the Model-Context-Protocol. It maintains a working directory across commands, so subsequent commands operate from the same directory unless you change it. You can start the server with Python and then interact with it via the MCP client to set the working directory and run arbitrary shell commands, receiving both stdout and stderr as results. This is useful for automating shell tasks from an LLM or other clients while keeping command execution encapsulated in a server.
How to install
Prerequisites
- Python 3.10 or higher
- pip (or another Python package manager)
Setup
-
Clone the repository git clone https://github.com/yourusername/mcp-bash.git cd mcp-bash
-
Create and activate a virtual environment python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies pip install -e .
-
Run the server python -m mcp.cli.server --module server
Optional: If you plan to integrate with Claude Desktop or other tools, ensure the server is reachable at the expected URL/port (default may be http://localhost:8000).
Additional notes
Security: This server executes bash commands, which can be dangerous. Do not expose it publicly. Consider running in a restricted environment or container, and implement validation or allowlists for commands if possible. If you need to persist or restrict filesystem access, consider running under a restricted user and configuring working directory boundaries. When integrating with Claude Desktop, ensure the client configuration references the correct path to the server module and that the MCP server name matches the client configuration.
Related MCP Servers
MCP-Bridge
A middleware to provide an openAI compatible endpoint that can call MCP tools
claude-config-editor
Claude Config Editor is a lightweight web tool that helps you clean and optimize your Claude Code/Desktop config files (.claude.json). Analyze project sizes, bulk delete chat histories, export data for backup, manage servers visually, and speed up Claude—all locally, with auto-backup, no dependencies, and cross-platform support.
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
lmstudio-toolpack
A MCP stdio toolpack for local LLMs
NeoCoder-neo4j-ai-workflow
An MCP server allowing AI assistants to use a Neo4j knowledge graph as their primary, dynamic instruction manual and long term project memory with adaptive templating and autonomous tool development tools.
google-search-console
It connects directly to your Google Search Console account via the official API, letting you access key data right from AI tools like Claude Desktop or OpenAI Agents SDK and others .