home / mcp / command mcp server
Provides a secure, whitelisted command-execution service for MCP clients with user confirmation and audit logging.
Configuration
View docs{
"mcpServers": {
"andrew-beniash-mcp-command-server": {
"command": "uv",
"args": [
"run",
"python",
"-m",
"mcp_command_server"
],
"env": {
"ALLOWED_COMMANDS": "ls,pwd,echo"
}
}
}
}You run a secure MCP server that lets your LLM applications execute system commands within strict whitelists, comprehensive audits, and user-confirmed actions. This makes it safe to harness command execution from AI prompts while keeping full control over what runs on your machines.
Use this MCP Server with an MCP client to execute allowed system commands from your AI workflows. You configure a client to point at your MCP server, then issue requests that are constrained by a defined whitelist. Each command requires explicit user confirmation and is logged for auditing, so you can review what ran and when.
Prerequisites: you need Python and a modern shell environment. You also need the ability to install Python packages and run a local command server. Follow these steps to install the MCP server package and prepare it for use.
uv pip install mcp-command-serverConfiguration follows a simple pattern: you expose a single local command server that the MCP client can invoke, and you specify the allowed commands via an environment variable. This keeps your system safe while allowing automation to request only the commands you trust.
export ALLOWED_COMMANDS="ls,pwd,echo"To connect Claude Desktop to the command server, provide a small MCP configuration snippet that tells Claude how to start the local server process and what environment variables to apply.
{
"mcpServers": {
"command_server": {
"command": "uv",
"args": ["run", "python", "-m", "mcp_command_server"],
"env": {
"ALLOWED_COMMANDS": "ls,pwd,echo"
}
}
}
}