Skip to main content
Glama

openai-mcp

在 Claude Code、Codex 以及任何 MCP 客户端中使用您的 ChatGPT Plus 或 Pro 订阅。

PyPI version License: MIT Python 3.10+


功能简介

openai-mcp 提供了 15 个 MCP 工具,可将请求直接转发至 ChatGPT 的后端 API。 无需代理进程,无需额外账户。使用您自己的令牌,消耗您自己的配额。

适用于 Claude Code、Codex CLI 以及任何支持通过 stdio 使用 MCP 协议的客户端。


Related MCP server: claude-max-mcp

安装

pip install openai-mcp

或者使用 pipx 进行隔离安装:

pipx install openai-mcp

设置

openai-mcp setup

设置向导将执行以下操作:

  1. 查找 ~/.codex/auth.json 中现有的 Codex 认证令牌

  2. 如果未找到,将提示您粘贴 ChatGPT 会话令牌

  3. 将凭据保存至 ~/.openai-mcp/token.json


在 Claude Code 中配置

将以下内容添加到 ~/.claude.json(在 mcpServers 下):

{
  "mcpServers": {
    "openai": {
      "type": "stdio",
      "command": "openai-mcp",
      "args": ["run", "--stdio"]
    }
  }
}

保存后重启 Claude Code。工具将出现在 openai 命名空间下。


工具

工具

功能

chat

与 GPT-5.x、Pro 模型、o3、o3-pro 聊天

deep_research

网络增强搜索回答(约 30 秒)

deep_research_heavy

通过 gpt-5-5-pro 进行长篇深度研究(5–30 分钟,消耗月度配额)

account_status

ChatGPT 计划及已启用的功能

list_models

您账户可用的所有模型

memory_list

列出 ChatGPT 记忆(已屏蔽个人隐私信息)

memory_search

按关键词搜索 ChatGPT 记忆

custom_instructions_get

获取您的 ChatGPT 自定义指令

list_codex_envs

列出 Codex 环境

list_codex_tasks

列出最近的 Codex 任务

list_custom_gpts

列出您的自定义 GPTs

list_conversations

最近的 ChatGPT 对话

list_tasks

已计划的 ChatGPT 任务

list_apps

已连接的应用程序和连接器


架构

原生 Python 实现——无代理。服务器使用 curl_cffi 进行 TLS 模拟,直接调用 /backend-api/conversation (SSE)。内置的 POW 和 Turnstile 求解器用于处理 OpenAI Sentinel 挑战。归属信息请参阅 NOTICES

~/.codex/auth.json  (or ~/.openai-mcp/token.json)
        |
   openai-mcp  (stdio MCP server)
        |
   curl_cffi  →  chatgpt.com /backend-api/conversation  (SSE)
        |
   14 read tools + 1 heavy DR tool

限制

  • 深度研究配额: Pro 用户每月 248 次请求;Plus 用户配额较低。

  • image_gen: 存根已存在,但尚未连接到可用的端点。

  • memory_add: 只读——写入端点返回 405;工具未注册。

  • 需要有效的 ChatGPT Plus 或 Pro 订阅。


开发

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

许可证

MIT。第三方归属信息请参阅 NOTICES


致谢

A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
6dRelease cycle
7Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/robotlearning123/gpt2agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server