MCP Containerd

MCP Containerd

site icon
2025.04.16 14
Rust容器管理镜像管理开发效率数据库
MCP Containerd 是一个基于 RMCP(Rust Model Context Protocol)库实现的 MCP 服务器,用于操作 Containerd 的 CRI 接口。它提供了完整的 Containerd CRI 接口操作支持,包括运行时服务和镜像服务接口。
View on GitHub

Overview

基本能力

产品定位

MCP Containerd 是一个用于管理和操作 Containerd CRI 接口的 MCP 服务器,主要用于容器和镜像的管理。

核心功能

  • 使用 RMCP 库实现 MCP 服务器
  • 支持所有 Containerd CRI 接口操作
  • 提供运行时服务接口(如创建/停止/删除 Pod 沙箱、容器管理等)
  • 提供镜像服务接口(如列出镜像、获取镜像状态、拉取/删除镜像等)

适用场景

  • 容器运行时管理
  • 容器镜像管理
  • 开发和测试环境中的容器操作

工具列表

  • simple_chat 客户端:用于与 MCP Containerd 服务交互,支持列出容器和镜像等操作。

常见问题解答

  • 默认连接端点:unix:///run/containerd/containerd.sock
  • 未来版本将支持通过配置文件自定义连接参数

使用教程

使用依赖

  • Rust 开发环境
  • 已安装并运行的 Containerd
  • Protobuf 编译工具

安装教程

cargo build --release

运行服务

cargo run --release

调试方式

使用 simple_chat 客户端进行交互:

# 首先启动 MCP Containerd 服务
cargo run --release

# 在另一个终端中运行 simple_chat 客户端
cd simple-chat-client
cargo run --bin simple_chat

示例交互:

> please give me a list of containers
AI: Listing containers...
Tool: list_containers
Result: {"containers":[...]}

> please give me a list of images
AI: Here are the images in your containerd:
Tool: list_images
Result: {"images":[...]}

许可证

该项目遵循 Apache-2.0 开源许可条款。