MCP Command Server
A secure server for executing pre-approved system commands via an environment variable.
MCP Command Server
A secure Model Context Protocol (MCP) server for executing system commands through LLM applications like Claude.
Quick Start
- Install the package:
uv pip install mcp-command-server
- Configure allowed commands:
export ALLOWED_COMMANDS="ls,pwd,echo"
- Add to Claude Desktop configuration:
{
"mcpServers": {
"command-server": {
"command": "uv",
"args": ["run", "python", "-m", "mcp_command_server"],
"env": {
"ALLOWED_COMMANDS": "ls,pwd,echo"
}
}
}
}
Features
- 🔒 Secure command execution with whitelist
- ✅ User confirmation for all commands
- 📝 Comprehensive audit logging
- 🔍 Input validation and sanitization
- 🤖 Claude Desktop integration
Documentation
For complete documentation, see the docs/ directory:
Development
Setup
# Clone repository
git clone https://github.com/yourusername/mcp-command-server.git
cd mcp-command-server
# Create virtual environment
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
# Install development dependencies
uv pip install -e ".[dev]"
Testing
# Run all tests
pytest
# Run specific test file
pytest tests/unit/security/test_validator.py
# Run with coverage
pytest --cov=mcp_command_server
Contributing
- Fork the repository
- Create your feature branch
- Run tests and linting
- Submit a pull request
License
MIT License - see LICENSE for details.
Related Servers
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Image Generation
Generate images from text prompts using the Together AI API.
Unity-MCP
A bridge between the Unity game engine and AI assistants using the Model Context Protocol (MCP).
Ping MCP Server
An MCP server providing on-chain AI tools for seamless interaction with the Solana blockchain.
mcp-ssh-sre
An MCP server providing read-only server monitoring tools to AI assistants. Runs predefined diagnostic commands over SSH and passes only the results to the LLM - your server credentials and shell are never exposed.
Have I Been Pwned
Check if an account or password has been compromised in a data breach using the Have I Been Pwned API.
Shadcn UI MCP Server
A powerful and flexible MCP server designed to enhance the development experience with Shadcn UI components, providing tools for component management, documentation, and installation.
Enoch
MCP server for the Enoch control plane: dispatch gates, evidence sync, provenance, and quality gates for long-running autonomous AI work.
Ghost MCP
An MCP server for the Ghost blogging platform with Server-Sent Events (SSE) support.
AI Agent Playwright
An AI agent for the Playwright MCP server, enabling automated web testing and interaction.
MCP Feedback Enhanced
An MCP server for interactive user feedback and command execution in AI-assisted development, supporting both Web and Desktop interfaces.