Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Cmd Server

FreeNot checked

A simple MCP server that runs read-only commands

GitHubEmbed

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

  1. Clone the repository:

    git clone <repository-url>
    cd mcp-cmd-server
    
  2. Create a virtual environment and install dependencies:

    make init
    

    Or 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 clients
  • sse: Server-Sent Events mode for web-based clients
  • streamable-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

  1. Build and start the container:

    make run
    

    Or manually:

    docker-compose up -d --build
    
  2. Stop the container:

    make stop
    

    Or 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.0
  • pydantic~=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

from github.com/null-create/mcp-cmd-server

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-server

FAQ

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

Compare 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