cli-mcp-serverServer

MladenSU
GitHub
Command LineOS AutomationSecurity

Loading subscription status...

💡 Description

A secure Model Context Protocol (MCP) server implementation for performing controlled command-line operations with comprehensive security features.

📝 JSON Entries

{
  "mcpServers": [
    {
      "cli-mcp-server": {
        "env": {
          "ALLOWED_DIR": "</your/desired/dir>",
          "ALLOWED_FLAGS": "-l,-a,--help,--version",
          "COMMAND_TIMEOUT": "30",
          "ALLOWED_COMMANDS": "ls,cat,pwd,echo",
          "MAX_COMMAND_LENGTH": "1024",
          "ALLOW_SHELL_OPERATORS": "false"
        },
        "args": [
          "--directory",
          "<path/to/the/repo>/cli-mcp-server",
          "run",
          "cli-mcp-server"
        ],
        "command": "uv"
      }
    }
  ]
}

🛠️ Tools

run_commandshow_security_rules

Features

  • Secure command execution with strict validation
  • Command and flag whitelisting with 'all' option
  • Path traversal prevention and validation
  • Protection against shell operator injection
  • Execution timeout and length limitations
  • Detailed error reporting
  • Support for asynchronous operations
  • Working directory restrictions and validations

💬 Example Queries

  • Execute a whitelisted shell command.
  • Show current security rules.