Skip to main content
Glama

ContainerGuard MCP

by rockmelodies

项目名称: ContainerGuard MCP

README.md

# ContainerGuard MCP 一个基于Model Context Protocol (MCP)的容器安全监控与管理工具,提供远程容器管理、安全日志分析和事件监控功能。 ## 功能特性 - 🔐 **远程连接管理**: 支持Docker API和SSH两种方式连接远程容器环境 - 📊 **容器监控**: 实时查看容器状态、日志和运行信息 - 🛡️ **安全分析**: 自动分析容器安全性,检测可疑活动和配置问题 - 📋 **事件监控**: 实时监控Docker事件,及时发现异常行为 - 🔍 **深度检查**: 全面的容器安全扫描,包括进程、网络、文件权限等 ## 安装依赖 ```bash pip install mcp-server-fastmcp docker paramiko

快速开始

  1. 启动MCP服务:

python container_guard_mcp.py
  1. 在支持MCP的客户端中使用 (如Claude AI):

连接到Docker守护进程: connect_docker host="192.168.1.100" port=2375 查看容器列表: list_containers all_containers=true 分析容器安全: security_analysis container_id="container_id"

可用工具

连接管理

  • connect_docker() - 连接到远程Docker守护进程

  • connect_ssh() - 通过SSH连接到远程主机

容器操作

  • list_containers() - 获取容器列表

  • get_container_logs() - 查看容器日志

  • execute_command() - 在容器中执行命令

安全分析

  • security_analysis() - 基础安全分析

  • check_container_security() - 全面安全检查

  • monitor_docker_events() - 监控Docker事件

安全配置

Docker远程访问

# 在目标主机上配置Docker远程API sudo systemctl edit docker # 添加: -H tcp://0.0.0.0:2375 sudo systemctl restart docker

SSH密钥认证

# 生成SSH密钥对 ssh-keygen -t rsa -b 4096 # 将公钥复制到目标主机 ssh-copy-id user@host

使用示例

  1. 连接远程Docker:

connect_docker(host="10.0.0.5", port=2375)
  1. 查看所有容器:

containers = list_containers(all_containers=true)
  1. 分析特定容器:

analysis = security_analysis(container_id="abc123")
  1. 监控实时事件:

events = monitor_docker_events(duration=30)

安全建议

  • 使用TLS加密Docker远程连接

  • 限制Docker API的访问权限

  • 定期更新SSH密钥

  • 监控容器资源使用情况

  • 设置容器资源限制

许可证

MIT License

支持

如有问题请提交Issue或联系开发团队。

## 使用说明 1. **安装依赖**: ```bash pip install mcp-server-fastmcp docker paramiko
  1. 运行服务:

python container_guard_mcp.py
  1. 在MCP客户端中配置: 将上述Python脚本路径添加到你的MCP客户端配置中。

  2. 开始使用:

  • 首先连接到远程Docker或SSH

  • 然后使用各种工具进行容器管理和安全分析

这个MCP服务提供了完整的容器安全管理功能,可以帮助你远程监控和分析容器环境的安全状况。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables remote container security monitoring and management through Docker API and SSH connections. Provides real-time container monitoring, security analysis, event tracking, and comprehensive security scanning for containerized environments.

  1. README.md
    1. 快速开始
      1. 可用工具
        1. 连接管理
        2. 容器操作
        3. 安全分析
      2. 安全配置
        1. Docker远程访问
        2. SSH密钥认证
      3. 使用示例
        1. 安全建议
          1. 许可证
            1. 支持

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/rockmelodies/ContainerGuardMCP'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server