Описание
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
Установка Cmd Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/null-create/mcp-cmd-serverFAQ
Cmd Server MCP бесплатный?
Да, Cmd Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Cmd Server?
Нет, Cmd Server работает без API-ключей и переменных окружения.
Cmd Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Cmd Server в Claude Desktop, Claude Code или Cursor?
Открой Cmd Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: 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
автор: xuzexin-hzCompare Cmd Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
