MCP ChatGPT Responses

by billster45
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides access to OpenAI's ChatGPT API with customizable parameters, conversation state management through the Responses API, and web search capabilities for retrieving up-to-date information.

MCP ChatGPT 服务器

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

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

特征

  • 使用可自定义的参数调用 ChatGPT API
  • Aks Claude 和 ChatGPT 可以在长时间的讨论中互相交谈!
  • 配置模型版本、温度和其他参数
  • 使用网络搜索从互联网获取最新信息
  • 使用 OpenAI 的 Responses API 进行自动对话状态管理
  • 使用您自己的 OpenAI API 密钥

设置说明

通过 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 许可证

-
security - not tested
F
license - not found
-
quality - not tested

MCP ChatGPT Responses 通过两个基本工具将 Claude 连接到 ChatGPT:AI 对话的标准查询和基于 Web 的当前信息请求。它使用 OpenAI 的 Responses API 自动维护对话状态。

  1. Features
    1. Setup Instructions
      1. Installing via Smithery
      2. Prerequisites
      3. Installation
      4. Using with Claude Desktop
    2. Available Tools
      1. Example Usage
        1. Basic ChatGPT usage:
        2. With web search:
      2. How It Works
        1. License
          ID: fe168f4v0h