Back to MCP directory
publicPublicdnsLocal runtime

Docker Manager

一个基于Model Context Protocol (MCP)的服务器,通过自然语言提供Docker管理功能。

article

README

🚀 ChatGPT MCP 服务器

ChatGPT MCP 服务器是一个基于 Model Context Protocol (MCP) 的服务器,它借助自定义 GPT 接口,为用户提供便捷的 Docker 管理功能。

🚀 快速开始

你可以通过 Smithery 自动安装,也能手动进行安装。安装完成后,可使用 Docker 运行该服务器。

✨ 主要特性

  • 支持通过自然语言进行 Docker 容器管理,操作更加便捷。
  • 基于 Model Context Protocol (MCP) 构建。
  • 使用 TypeScript 实现,保证代码的可维护性和健壮性。
  • 支持容器化部署,方便快捷。
  • 具备强大的错误处理能力和优雅关闭机制。
  • 实现了资源管理和端口处理。
  • 支持速率限制和 API 密钥身份验证,保障系统安全。

📦 安装指南

通过 Smithery 安装

要通过 Smithery 自动安装 ChatGPT MCP Server for Claude Desktop,可使用以下命令:

npx -y @smithery/cli install @Toowiredd/chatgpt-mcp-server --client claude

手动安装

  1. 克隆仓库
git clone https://github.com/toowiredd/chatgpt-mcp-server.git
cd chatgpt-mcp-server
  1. 安装依赖项
npm install
  1. 创建环境文件
cp env.example .env
# 编辑 .env 文件以配置你的设置
  1. 构建项目
npm run build

💻 使用示例

使用 Docker 运行

构建容器

npm run docker:build

运行容器

npm run docker:run

或手动运行:

docker run -d \
  -p 3001:3001 \
  --env-file .env \
  -v /var/run/docker.sock:/var/run/docker.sock \
  chatgpt-mcp-server

开发相关命令

  • npm run build - 构建 TypeScript 代码
  • npm run watch - 监控更改并自动重建
  • npm run inspector - 运行 MCP 检查工具

📚 详细文档

环境变量

| 属性 | 详情 | |------|------| | API_KEY | API 认证密钥 | | HTTP_PORT | 服务器端口(默认:3001) | | RATE_LIMIT_REQUESTS | 每窗口的最大请求数 | | RATE_LIMIT_WINDOW | 窗口大小(以毫秒为单位) |

资源管理

该服务器实现了强大的资源管理,具体体现在以下方面:

  • 在进程信号(SIGINT、SIGTERM、SIGQUIT)上执行优雅关闭。
  • 拒绝新连接。
  • 允许活动请求完成(带超时)。
  • 关闭保持活动连接。
  • 正确释放服务器端口。
  • 通过适当处理正确释放资源。

关闭过程

  1. 服务器在进程信号上启动优雅关闭。
  2. 拒绝新连接。
  3. 允许活动请求完成(带超时)。
  4. 关闭保持活动连接。
  5. 正确释放服务器端口。
  6. 通过适当处理正确释放资源。

错误处理

  • 检测到端口冲突并报告。
  • 捕获未处理的拒绝和异常。
  • 正确处理网络错误。
  • 通过适当处理防止资源泄漏。
  • 通过超时确保服务器在关闭期间不会挂起。

📄 许可证

本项目采用 MIT 许可证。

READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client