About
A simple MCP server that runs read-only commands
README
A Model Context Protocol (MCP) server that provides safe shell command execution capabilities. This server allows executing a predefined set of safe shell commands while blocking potentially dangerous operations.
Features
- Safe Command Execution: Only allows commands from a predefined allowlist to prevent security risks.
- Timeout Support: Configurable timeout for command execution.
- Logging: Comprehensive logging for monitoring and debugging.
- Docker Support: Easy deployment using Docker and Docker Compose.
- FastMCP Integration: Built on the FastMCP framework for MCP compliance.
- Multiple Transport Modes: Supports stdio, SSE, and streamable-http modes.
Installation
Prerequisites
- Python 3.12 or later
- pip
Local Installation
Clone the repository:
git clone <repository-url> cd mcp-cmd-serverCreate a virtual environment and install dependencies:
make initOr manually:
python -m venv venv source venv/bin/activate pip install -r requirements.txt
Configuration
The server can be configured using environment variables or a .env file:
MODE: MCP transport mode (default: "streamable-http", options: "stdio", "sse", "streamable-http")HOST_ADDR: Host address to bind to (default: "0.0.0.0")HOST_PORT: Port to listen on (default: 9595)LOG_LEVEL: Logging level as integer (default: 10, DEBUG)
Usage
Running Locally
Activate the virtual environment and run the server:
source venv/bin/activate
python main.py --mode streamable-http
The server will start on the configured host and port.
Transport Modes
stdio: Standard input/output mode for local MCP clientssse: Server-Sent Events mode for web-based clientsstreamable-http: HTTP streaming mode (default)
Using the Tool
The server exposes a run_command tool that accepts:
command: The shell command to execute (must start with an allowed base command)timeout: Maximum execution time in seconds (default: 30)
Example response:
{
"stdout": "output here",
"stderr": "",
"returncode": 0
}
Docker Deployment
Using Docker Compose
Build and start the container:
make runOr manually:
docker-compose up -d --buildStop the container:
make stopOr manually:
docker-compose down
The server will be available on port 9595.
Allowed Commands
The server only executes commands whose base (first token) is in the allowlist. The current allowed commands include:
- Filesystem navigation & inspection:
ls,cat,head,tail,pwd,find,du,df,stat,file,wc - Text processing:
grep,awk,sed,sort,uniq,cut,tr,diff - System information:
echo,date,uptime,whoami,uname,ps,env,which,lsof
To modify the allowlist, edit tools/cmd.py.
Dependencies
mcp>=1.0.0pydantic~=2.12.5
Security
This server is designed with security in mind:
- Commands are validated against an allowlist before execution.
- No arbitrary code execution is allowed.
- Logging helps track all command executions.
- Timeout prevents runaway processes.
License
MIT
Installing Cmd Server
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/null-create/mcp-cmd-serverFAQ
Is Cmd Server MCP free?
Yes, Cmd Server MCP is free — one-click install via Unyly at no cost.
Does Cmd Server need an API key?
No, Cmd Server runs without API keys or environment variables.
Is Cmd Server hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Cmd Server in Claude Desktop, Claude Code or Cursor?
Open Cmd Server on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzCompare Cmd Server with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
