MCP cover image
Secure-Command-Executor-MCP-Merver logo
Public

Secure-Command-Executor-MCP-Merver

See in Github
2025-03-30

Un servicio de ejecución de comandos robusto con rotación diaria de registro, diseñado para administrar y ejecutar de forma segura comandos del sistema con verificaciones de seguridad y registro.

1

Github Watches

0

Github Forks

0

Github Stars

Secure Command Executor MCP Server

A robust command execution MCP service with daily log rotation, designed to securely manage and execute system commands with safety checks and logging. And this README.md is written by DeepSeek V3.

Features

  • Command Execution: Execute system commands with optional arguments.
  • Safety Checks: Warns and requires confirmation for dangerous commands.
  • Command Management: Add, update, remove, enable, or disable commands.
  • Logging: Daily log rotation with detailed action tracking.
  • Query Tools: Query available commands and logs with filters.

Installation

  1. Clone the repository:

    git clone https://github.com/HappyAny/secure-command-executor-mcp-server.git
    cd secure-command-executor-mcp-server
    
  2. Install dependencies:

    npm install minimist
    npm install @modelcontextprotocol/sdk
    npm install zod
    
  3. Configure the service:

    • Modify commands.json to define available commands.
    • Set environment variables (optional).

Usage

Starting the Service

node index.js --file commands.json --logs logs --port 3000

MCP Setting

{
    "mcpServers": {
        "cmd-exec": {
          "command": "node",
          "args": [
            "path_to_file/index.js",
            "--file",
            "path_to_file/commands.json",
            "--logs",
            "path_to_dict/logs"
          ]
        }
    }
}

Commands File

The commands.json file defines the available commands. Example:

[
  {
    "name": "dir",
    "description": "List directory contents",
    "example": "dir /w",
    "dangerous": false,
    "enabled": true,
    "confirmationPrompt": "",
    "consequences": ""
  },
  {
    "name": "format",
    "description": "Format disk drive",
    "example": "format C:",
    "dangerous": true,
    "enabled": false,
    "confirmationPrompt": "This will PERMANENTLY erase all data. Confirm?",
    "consequences": "Permanent data loss"
  }
]

API Endpoints

Execute a Command

curl -X POST http://localhost:3000/execute -H "Content-Type: application/json" -d '{"command": "dir", "args": "/w"}'

Query Commands

curl -X GET http://localhost:3000/queryCommands?filter=enabled&detailed=true

Manage Commands

curl -X POST http://localhost:3000/manageCommand -H "Content-Type: application/json" -d '{"action": "add", "name": "ping", "description": "Test network connection", "example": "ping example.com"}'

Query Logs

curl -X GET http://localhost:3000/queryLogs?limit=50&filter=failed

Configuration

  • Environment Variables:

    • NODE_ENV: Set to production for production mode.
    • PORT: Override the default port (3000).
  • Command-Line Arguments:

    • --file: Path to the commands file (default: commands.json).
    • --logs: Path to the logs directory (default: logs).
    • --port: Port to run the service (default: 3000).

Logging

Logs are stored in the specified directory with daily rotation. Each log file is named YYYY-MM-DD.json.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • modelcontextprotocol
  • Servidores de protocolo de contexto modelo

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • n8n-io
  • Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.

  • open-webui
  • Interfaz de IA fácil de usar (admite Ollama, Operai API, ...)

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.

    Reviews

    2 (1)
    Avatar
    user_5apKwaTc
    2025-04-16

    The Secure Command Executor MCP Server by HappyAny is a fantastic tool for securely executing commands with precision and reliability. As a loyal user, I appreciate the robust security features and seamless integration it offers. The GitHub repository provides comprehensive documentation, making it easy to set up and use. Highly recommended for anyone looking to enhance their command execution processes!