Docker容器管理MCP服务器

Sentinel Docker MCP是一个本地MCP服务器,提供安全的Docker容器管理操作,适用于需要通过MCP协议进行容器管理的场景。

  • by Adjoshi06
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Adjoshi06/mcp-sentinel

使用说明

Sentinel Docker MCP

Sentinel Docker MCP is a local Model Context Protocol (MCP) server that exposes a safe, typed subset of Docker operations over stdio.

Features

  • Resources:
    • docker://containers
    • docker://logs/{container_id}
  • Tools:
    • list_containers(all: bool = False)
    • inspect_container(container_id: str)
    • restart_container(container_id: str)
    • get_stats(container_id: str)
  • Safe mode (--safe-mode) hides mutating tools and blocks invocation.
  • Strict container_id validation (^[a-f0-9]{12,64}$).
  • Docker error mapping to stable user-facing categories.

Quick Start

  1. Install dependencies:
python -m pip install -e .[dev]
  1. Run the server:
sentinel-docker-mcp --safe-mode

CLI Options

  • --safe-mode
  • --docker-timeout-seconds <float>
  • --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
  • --transport {stdio,sse,streamable-http}

Testing

python -m pytest

Documentation

See docs/README.md for complete architecture, contracts, workflows, security controls, test strategy, and implementation roadmap.