Skip to main content
Glama
ChatGPT MCP Server

ChatGPT MCP Server

by Toowiredd

ChatGPT MCP 服务器

铁匠徽章

通过自定义 GPT 接口提供 Docker 管理功能的模型上下文协议 (MCP) 服务器。

特征

  • 通过自然语言管理 Docker 容器

  • 基于模型上下文协议(MCP)

  • TypeScript 实现

  • 容器化部署

  • 强大的错误处理和正常关机

  • 资源管理和端口处理

  • 速率限制和 API 密钥认证

Related MCP server: MCP Development Server

设置

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 ChatGPT MCP 服务器:

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
# Edit .env with your configuration
  1. 构建项目

npm run build

使用 Docker 运行

  1. 构建容器

npm run docker:build
  1. 运行容器

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. 资源得到适当释放

错误处理

  • 检测并报告端口冲突

  • 捕获未处理的拒绝和异常

  • 网络错误得到妥善处理

  • 通过适当的处理可以防止资源泄漏

  • 超时确保服务器在关闭期间不会挂起

执照

麻省理工学院

Available Tools

7 tools
container_createC

Create and start a new Docker container

Inputs: image (required), name, ports, env.

container_execC

Execute a command in a running container

Inputs: container (required), command (required).

container_logsC

Get container logs

Inputs: container (required), tail.

container_removeC

Remove a container

Inputs: container (required), force.

containers_listC

List all Docker containers

Inputs: all.

container_startC

Start a stopped container

Inputs: container (required).

container_stopC

Stop a running container

Inputs: container (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific Docker container operations: create, execute, logs, remove, list, start, and stop. There is no overlap or ambiguity between these functions, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tools follow a consistent 'container_verb' or 'containers_verb' pattern with snake_case, except for 'containers_list' which uses plural 'containers' for listing multiple items. This minor deviation is logical and maintains overall naming predictability across the set.

    Tool Count5/5

    With 7 tools, this server is well-scoped for Docker container management, covering essential lifecycle operations without being overly sparse or bloated. Each tool serves a clear and necessary function in the domain.

    Completeness5/5

    The tool set provides complete CRUD/lifecycle coverage for Docker containers: create, start, stop, execute commands, view logs, list, and remove. There are no obvious gaps, enabling agents to handle typical container workflows without dead ends.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers