mcp-registry/cli-mcp-server

    ==================
      
       /// MCP ///
      /// CLI ///
        
    ==================
        
    [server:online]
    [protocol:ready]

cli-mcp-server

by MladenSU

A secure Model Context Protocol (MCP) server that allows controlled execution of command-line operations with extensive security controls (whitelisting, path validation, timeouts, etc.).

134
19
Open Source

01

run_command

Executes whitelisted CLI commands within the allowed directory, enforcing command, flag, and path security rules.

02

show_security_rules

Displays the current security configuration, including working directory, allowed commands, allowed flags, and enforced limits.

Installation

1. Clone the repository
git clone https://github.com/MladenSU/cli-mcp-server.git cd cli-mcp-server
2. (Recommended) create an isolated Python environment
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate
3. Install server dependencies
pip install -r requirements.txt
4. Copy the sample configuration and review security settings
cp config.example.yml config.yml # or use .env.example → .env if the project ships env files # Set the following keys in the new file/environment: # MCP_AUTH_TOKEN – random long string shared with all authorised clients # ALLOWED_COMMANDS – comma-separated whitelist for the secure policy engine # BIND_HOST / BIND_PORT – interface and port to listen on (default 0.0.0.0:8080)
5. Run database/bootstrap tasks if they exist (skip when not required)
python -m mcp_server migrate
6. Start the MCP CLI server
python -m mcp_server # or: uvicorn mcp_server.api:app --host 0.0.0.0 --port 8080
7. Verify it is working
----------------
curl -H "X-API-Key: $MCP_AUTH_TOKEN" http://localhost:8080/healthz Container option # Build and run docker build -t cli-mcp-server . docker run -e MCP_AUTH_TOKEN=secret -p 8080:8080 cli-mcp-server

Documentation

License: MIT License
Updated 7/30/2025