Bash MCP (Master Control Program)
A TypeScript application that allows Claude to safely execute bash commands with security safeguards. This project implements the Model Context Protocol (MCP) to provide a secure interface for executing bash commands from AI assistants like Claude.
Features
Execute bash commands in a controlled environment
Support for both stateless and stateful (interactive) command execution
Security safeguards:
Whitelisted commands
Whitelisted directories
Command validation
Output sanitization
Session management for interactive commands
Comprehensive logging
MCP server implementation for AI integration
Installation
Configuration
The configuration is stored in config/default.json
. You can customize:
Allowed commands
Allowed directories
Session settings
Security settings
Logging settings
Example configuration:
Usage
As a Library
Simple Command Execution
Interactive Sessions
As an MCP Server
This project includes an MCP server implementation that can be used with Claude Desktop or other MCP clients:
See MCP.md
for detailed documentation on the MCP server implementation.
Security Considerations
This MCP is designed with security in mind, but it's important to:
Keep the allowed commands and directories list as restrictive as possible
Regularly review and update the configuration
Monitor the logs for suspicious activity
Keep the MCP and its dependencies up to date
Development
Building
Linting and Formatting
To check for linting issues:
To automatically fix linting and formatting issues:
Or manually:
Testing
MCP SDK Version
This project uses MCP SDK version 1.0.1.
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 TypeScript application that allows Claude to safely execute bash commands with security safeguards, providing a secure interface through the Model Context Protocol.
Related MCP Servers
- AsecurityAlicenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -1131MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides secure command-line access to Windows systems, allowing MCP clients like Claude Desktop to safely execute commands in PowerShell, CMD, and Git Bash shells with configurable security controls.Last updated -9256248MIT License
- AsecurityAlicenseAqualityA Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.Last updated -111737MIT License
- -securityFlicense-qualityA TypeScript application that allows Claude to safely execute bash commands with security safeguards including whitelisted commands, directories, and comprehensive logging.Last updated -