codex-chats-mcp
Manages ChatGPT conversations and Codex Cloud tasks, allowing listing, searching, renaming, archiving, exporting, and permanently deleting chats.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
codex-chats-mcp
An MCP server for managing ChatGPT conversations and Codex Cloud tasks (chats) from any MCP-compatible client — Claude Code, Codex, Cline, etc.
ChatGPT's web UI lets you archive chats but the "Delete all" button only wipes visible ones, and Codex Cloud has no per-task delete at all. This server wraps the internal chatgpt.com/backend-api endpoints so you can list, search, rename, archive, export, and permanently delete both kinds of chats from your agent.
Unofficial. This uses undocumented internal endpoints (
/conversations/*,/wham/tasks/*). They can change without notice and require a valid ChatGPT session. Use at your own risk.
Install
pip install codex-chats-mcpOr with uv:
uv tool install codex-chats-mcpThis installs a codex-chats-mcp executable.
Related MCP server: ThreadShelf MCP Server
Authentication
The server reads ~/.codex/auth.json — the same file the Codex CLI maintains after codex login. If you don't have Codex installed, log in once with npx @openai/codex login (or sign in via the Codex desktop app) to produce the file.
The token has full access to your ChatGPT account. Treat the auth file as a secret.
Wire it up
Codex CLI (~/.codex/config.toml)
[mcp_servers.codex-chats]
command = "codex-chats-mcp"Claude Code
claude mcp add codex-chats codex-chats-mcpAnything else
Point your MCP client at the codex-chats-mcp executable. It speaks MCP over stdio.
Tools
ChatGPT conversations (the "Recents" list)
Tool | What it does |
| Paginates through your conversations. Filters out archived by default. |
| Full payload for one conversation, including the message tree. |
| Substring match on titles (client-side). |
| Change a conversation's title. |
| Toggle the archive flag. |
| Permanently delete one chat ( |
| Delete every chat whose title matches a substring. Requires |
| Nuke every visible chat — same as ChatGPT's "Delete all chats" button. Requires |
| Dump titles/IDs (and optionally full message trees) to a JSON file. |
Codex Cloud tasks
Tool | What it does |
| Paginate Codex tasks, filterable by |
| Summary of one task. |
| Full raw task payload. |
| Toggle archive state. |
| Permanently delete a task. Works on active OR archived. |
| Bulk-delete every archived task. Requires |
Safety
Every destructive bulk action (delete_all_conversations, delete_all_archived, delete_conversations_matching) requires confirm=True. Without it the tool returns a preview of what would be deleted. There is no undo on the ChatGPT side.
Development
git clone https://github.com/shoyu-ramen/codex-chats-mcp
cd codex-chats-mcp
python3 codex_chats_mcp.pyLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Manage Superlist tasks and lists in plain language from any MCP-compatible AI agent.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a read-only MCP server to access ChatGPT conversation history via a local browser process. Allows AI clients to list, get, and search conversations from the authenticated user's ChatGPT account.116 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables semantic search and retrieval of archived AI conversations from multiple providers via the MCP protocol, allowing thread continuation and integration with MCP-capable tools.144 npm22MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that turns one authenticated ChatGPT browser page into a bounded MCP server, exposing tools for creating, listing, searching, exporting, sending, editing chats and downloading media via a CDP driver.MIT
- AlicenseNot gradedqualityBmaintenanceEnables searching local OpenAI Codex conversation history by keywords, project, date, or role, listing sessions, and retrieving exact supporting messages through MCP tools.1MIT