MCP server to list, search, archive, rename, export, and delete ChatGPT conversations and Codex Cloud tasks.
Project description
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 git+https://github.com/shoyu-ramen/codex-chats-mcp
Or with uv:
uv tool install git+https://github.com/shoyu-ramen/codex-chats-mcp
This installs a codex-chats-mcp executable.
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-mcp
Anything 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 |
|---|---|
list_conversations |
Paginates through your conversations. Filters out archived by default. |
get_conversation |
Full payload for one conversation, including the message tree. |
search_conversations |
Substring match on titles (client-side). |
rename_conversation |
Change a conversation's title. |
archive_conversation / unarchive_conversation |
Toggle the archive flag. |
delete_conversation |
Permanently delete one chat (is_visible=false). No undo. |
delete_conversations_matching |
Delete every chat whose title matches a substring. Requires confirm=True. |
delete_all_conversations |
Nuke every visible chat — same as ChatGPT's "Delete all chats" button. Requires confirm=True. |
export_conversations |
Dump titles/IDs (and optionally full message trees) to a JSON file. |
Codex Cloud tasks
| Tool | What it does |
|---|---|
list_chats |
Paginate Codex tasks, filterable by all / current / archived. |
get_chat |
Summary of one task. |
get_chat_raw |
Full raw task payload. |
archive_chat / unarchive_chat |
Toggle archive state. |
delete_chat |
Permanently delete a task. Works on active OR archived. |
delete_all_archived |
Bulk-delete every archived task. Requires confirm=True. |
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.py
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_chats_mcp-0.1.0.tar.gz.
File metadata
- Download URL: codex_chats_mcp-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9103593d5ec8fc642ccfcbd6d7eb272a988b46427d9c7710e2af00ec4f6b4ce7
|
|
| MD5 |
e31769893dd8dc5ed938a536a489dd23
|
|
| BLAKE2b-256 |
0e40e7ac5718f026ee3ee92ad80f337d9e3c8b222722cf3463609080ccd6775a
|
Provenance
The following attestation bundles were made for codex_chats_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on shoyu-ramen/codex-chats-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_chats_mcp-0.1.0.tar.gz -
Subject digest:
9103593d5ec8fc642ccfcbd6d7eb272a988b46427d9c7710e2af00ec4f6b4ce7 - Sigstore transparency entry: 1592881460
- Sigstore integration time:
-
Permalink:
shoyu-ramen/codex-chats-mcp@c193a1bf9db8dbc1be7f09b49a28bd7989ad0c6c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shoyu-ramen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c193a1bf9db8dbc1be7f09b49a28bd7989ad0c6c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file codex_chats_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codex_chats_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e91e1732e41afcb2ff112ce3708abd9ee42f31cfd86adf19e3f1e29f8f919b4
|
|
| MD5 |
5c38ebaf4070418cfda93f44c4b1f0eb
|
|
| BLAKE2b-256 |
4b84e4a63b180111c28b77b2b249772c8108767aa50d3aad300194d0a25996ac
|
Provenance
The following attestation bundles were made for codex_chats_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on shoyu-ramen/codex-chats-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_chats_mcp-0.1.0-py3-none-any.whl -
Subject digest:
7e91e1732e41afcb2ff112ce3708abd9ee42f31cfd86adf19e3f1e29f8f919b4 - Sigstore transparency entry: 1592881707
- Sigstore integration time:
-
Permalink:
shoyu-ramen/codex-chats-mcp@c193a1bf9db8dbc1be7f09b49a28bd7989ad0c6c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shoyu-ramen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c193a1bf9db8dbc1be7f09b49a28bd7989ad0c6c -
Trigger Event:
workflow_dispatch
-
Statement type: