Skip to main content
Glama
MCP ChatGPT Responses

MCP ChatGPT Responses

by billster45

MCP ChatGPT 服务器

铁匠徽章

该 MCP 服务器允许您直接从 Claude Desktop 访问 OpenAI 的 ChatGPT API。

📝了解我为何创建这个项目: 我构建了一个可以与其他 AI 对话的 AI:揭开 MCP 炒作的神秘面纱

特征

  • 使用可自定义的参数调用 ChatGPT API

  • Aks Claude 和 ChatGPT 可以在长时间的讨论中互相交谈!

  • 配置模型版本、温度和其他参数

  • 使用网络搜索从互联网获取最新信息

  • 使用 OpenAI 的 Responses API 进行自动对话状态管理

  • 使用您自己的 OpenAI API 密钥

Related MCP server: GPT-MCP Bridge

设置说明

通过 Smithery 安装

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

npx -y @smithery/cli install @billster45/mcp-chatgpt-responses --client claude

先决条件

安装

  1. 克隆此存储库:

    git clone https://github.com/billster45/mcp-chatgpt-responses.git
    cd mcp-chatgpt-responses
  2. 使用 uv 设置虚拟环境并安装依赖项:

    uv venv
    .venv\\Scripts\\activate
    uv pip install -r requirements.txt

与 Claude Desktop 一起使用

  1. 按照以下说明配置 Claude Desktop 以使用此 MCP 服务器: MCP 快速入门指南

  2. 将以下配置添加到您的 Claude Desktop 配置文件(根据需要调整路径):

    {
      "mcpServers": {
        "chatgpt": {
          "command": "uv",
          "args": [
            "--directory",
            "\\path\\to\\mcp-chatgpt-responses",
            "run",
            "chatgpt_server.py"
          ],
          "env": {
            "OPENAI_API_KEY": "your-api-key-here",
            "DEFAULT_MODEL": "gpt-4o",
            "DEFAULT_TEMPERATURE": "0.7",
            "MAX_TOKENS": "1000"
          }
        }
      }
    }
  3. 重新启动 Claude Desktop。

  4. 您现在可以通过 Claude 使用 ChatGPT API,询问提及 ChatGPT 或 Claude 可能无法回答的问题。

可用工具

MCP 服务器提供以下工具:

  1. ask_chatgpt(prompt, model, temperature, max_output_tokens, response_id) - 向 ChatGPT 发送提示并获得响应

  2. ask_chatgpt_with_web_search(prompt, model, temperature, max_output_tokens, response_id) - 向启用了网络搜索的 ChatGPT 发送提示以获取最新信息

示例用法

ChatGPT 基本用法:

告诉 Claude 向 ChatGPT 提问!

Use the ask_chatgpt tool to answer: What is the best way to learn Python?

告诉 Claude 与 ChatGPT 进行对话:

Use the ask_chatgpt tool to have a two way conversation between you and ChatGPT about the topic that is most important to you.

请注意,在轮流对话中,响应 ID 允许 ChatGPT 存储对话历史记录,因此它是一次真正的对话,而不仅仅是一系列 API 调用。这被称为对话状态。

通过网页搜索:

对于可能需要了解最新信息的问题:

Use the ask_chatgpt_with_web_search tool to answer: What are the latest developments in quantum computing?

现在尝试以代理方式进行网络搜索,根据天气情况计划您完美的一天!

Use the ask_chatgpt_with_web_search tool to find the weather tomorrow in New York, then based on that weather and what it returns, keep using the tool to build up a great day out for someone who loves food and parks

工作原理

该工具利用 OpenAI 的 Responses API,该 API 会自动在 OpenAI 服务器上维护对话状态。该方法:

  1. 通过让 OpenAI 处理对话历史记录来简化代码

  2. 提供更可靠的上下文跟踪

  3. 通过维护消息间的上下文来改善用户体验

  4. 允许使用网络搜索工具访问网络上的最新信息

执照

MIT 许可证

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables integration with OpenAI models through the MCP protocol, supporting concise and detailed responses for use with Claude Desktop.
      1
      3
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables Claude and other MCP-compatible tools to communicate with OpenAI's GPT models (GPT-5, GPT-5-mini, o3) with conversation history and session management. Features advanced controls like reasoning effort settings, token tracking, and parallel conversation sessions for efficient AI workflows.
      21 npm
      -
    • A
      license
      A
      quality
      C
      maintenance
      Provides access to OpenAI's ChatGPT API with web search capabilities for Claude and other MCP clients. Supports various GPT models with configurable parameters like reasoning effort, temperature, and streaming mode.
      1
      50 npm
      3
      MIT