openai-mcp
Provides tools to interact with ChatGPT, including chat with models like GPT-4o and GPT-5, deep research with web search and citations, and image generation (Pro only).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openai-mcpUse image_gen to create a diagram of a neural network"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openai-mcp
Use your ChatGPT Plus or Pro subscription inside Claude Code, Codex, and any MCP client.
What it does
openai-mcp exposes 15 MCP tools that forward requests directly to ChatGPT's backend API. No proxy process. No separate account. Your token, your quota.
Works with Claude Code, Codex CLI, and any client that speaks the MCP protocol over stdio.
Install
pip install openai-mcpOr with pipx for an isolated install:
pipx install openai-mcpSetup
openai-mcp setupThe wizard will:
Look for an existing Codex auth token at
~/.codex/auth.jsonIf not found, prompt you to paste a ChatGPT session token
Save credentials to
~/.openai-mcp/token.json
Configure in Claude Code
Add the following to ~/.claude.json (under mcpServers):
{
"mcpServers": {
"openai": {
"type": "stdio",
"command": "openai-mcp",
"args": ["run", "--stdio"]
}
}
}Restart Claude Code after saving. Tools appear under the openai namespace.
Tools
Tool | What it does |
| Chat with GPT-5.x, Pro models, o3, o3-pro |
| Web-augmented search answer (~30 s) |
| Long-form Deep Research via gpt-5-5-pro (5–30 min, uses monthly quota) |
| ChatGPT plan and enabled features |
| All models available to your account |
| List ChatGPT memories (PII redacted) |
| Search ChatGPT memories by keyword |
| Retrieve your ChatGPT custom instructions |
| List Codex environments |
| List recent Codex tasks |
| List your custom GPTs |
| Recent ChatGPT conversations |
| Scheduled ChatGPT tasks |
| Connected apps and connectors |
Architecture
Native Python implementation — no proxy. The server calls
/backend-api/conversation (SSE) directly using curl_cffi for TLS
impersonation. Vendored POW and Turnstile solvers handle the OpenAI Sentinel
challenge. See NOTICES for attribution.
~/.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 toolLimitations
Deep Research quota: 248 requests/month on Pro; lower on Plus.
image_gen: stub is present but not yet wired to a working endpoint.
memory_add: read-only — the write endpoint returns 405; tool is not registered.
Requires an active ChatGPT Plus or Pro subscription.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytestLicense
MIT. See NOTICES for third-party attributions.
Acknowledgments
lanqian528/chat2api — POW and Turnstile solver code (MIT)
basketikun/chatgpt2api — survey of ChatGPT backend API patterns
7836246/cursor2api — survey of Cursor API patterns
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/chatgpt2agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server