MCP ChatGPT 服务器
该 MCP 服务器允许您直接从 Claude Desktop 访问 OpenAI 的 ChatGPT API。
📝了解我为何创建这个项目: 我构建了一个可以与其他 AI 对话的 AI:揭开 MCP 炒作的神秘面纱
特征
使用可自定义的参数调用 ChatGPT API
Aks Claude 和 ChatGPT 可以在长时间的讨论中互相交谈!
配置模型版本、温度和其他参数
使用网络搜索从互联网获取最新信息
使用 OpenAI 的 Responses API 进行自动对话状态管理
使用您自己的 OpenAI API 密钥
Related MCP server: ClaudeKeep
设置说明
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 ChatGPT 服务器:
npx -y @smithery/cli install @billster45/mcp-chatgpt-responses --client claude先决条件
安装
克隆此存储库:
git clone https://github.com/billster45/mcp-chatgpt-responses.git cd mcp-chatgpt-responses使用 uv 设置虚拟环境并安装依赖项:
uv venv.venv\\Scripts\\activateuv pip install -r requirements.txt
与 Claude Desktop 一起使用
按照以下说明配置 Claude Desktop 以使用此 MCP 服务器: MCP 快速入门指南
将以下配置添加到您的 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" } } } }重新启动 Claude Desktop。
您现在可以通过 Claude 使用 ChatGPT API,询问提及 ChatGPT 或 Claude 可能无法回答的问题。
可用工具
MCP 服务器提供以下工具:
ask_chatgpt(prompt, model, temperature, max_output_tokens, response_id)- 向 ChatGPT 发送提示并获得响应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 服务器上维护对话状态。该方法:
通过让 OpenAI 处理对话历史记录来简化代码
提供更可靠的上下文跟踪
通过维护消息间的上下文来改善用户体验
允许使用网络搜索工具访问网络上的最新信息
执照
MIT 许可证
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.