You want to add an MCP server to Codex’s config.toml so the agent can do more than edit files. At the same time, ~/.codex keeps growing: every thread is written to disk as it runs, each task gets its own git worktree that Codex does not always remove, and the ChatGPT app downloads a 1.6 GB runtime bundle.
Room Service covers both. One click registers it as a stdio MCP server in ~/.codex/config.toml, and it scans Codex’s own storage as four separate groups, so a cache cleanup never reaches a conversation and a worktree in use is never removed mid-task.
Add Room Service to Codex’s config.toml
In Room Service, open Settings > Agents and turn on “Allow agents to connect”. Nothing listens on the network.
Open the Codex row and click “Add to Codex”. If Room Service finds the
codexbinary in a standard location, it runs Codex’s own command:codex mcp add room-service -- /usr/local/bin/roomservice mcpOtherwise it appends its own table to
~/.codex/config.toml, keeping every other table and setting in the file:[mcp_servers.room-service] command = "/usr/local/bin/roomservice" args = ["mcp"]The command is the absolute path of the CLI inside the app, or
/usr/local/bin/roomservicewhen that link points into it, because Codex does not inherit your shell’s PATH.Restart Codex. The CLI, the IDE extension, and the ChatGPT app all read the same entry.
On the first tool call, Room Service asks once whether Codex may use it, showing the executable macOS reports (the
codexprocess). Click Allow.
Room Service only rewrites a room-service entry that is its own [mcp_servers.room-service] table. If you defined it as an inline table or dotted keys under [mcp_servers], Add and Remove say “Could not read … Nothing was changed.” and leave your file alone.
What Codex can do with it
The same tools as any agent, in Codex’s terminal or the ChatGPT app: list_categories and get_category for what takes space with a risk label per row, clean_items with dry_run: true and then for real, list_ports and stop_port with the PID it saw, get_project and git_sweep for the repo it is working in. Each tool group has its own switch in Settings > Agents. Permanent actions are off by default and, when on, wait for your Allow in Room Service. Developer Vault has no scope.
git_sweep is read-only and reports uncommitted, unpushed, and stashed work: the question to ask before anything deletes a worktree. And clean_items never touches Codex’s own conversations, worktrees, or runtime bundle, so an agent cannot remove its own history by accident.
What Room Service does about ~/.codex
Codex’s storage is four groups in the AI Apps category, each with its own risk:
ChatGPT & Codex (caches). ~/Library/Caches/Codex, the updater cache at ~/Library/Caches/com.openai.codex, the Electron caches under ~/Library/Application Support/Codex, and ~/.codex/cache. Rated safe and rebuilt as needed.
ChatGPT & Codex Runtime. The tools bundle at ~/.cache/codex-runtimes, about 1.6 GB. Rated review: the next task that needs it downloads it again.
ChatGPT & Codex Conversations. ~/.codex/sessions, one row per month, plus archived_sessions and generated_images. Rated review. Deleted threads cannot be reopened or resumed.
ChatGPT & Codex Worktrees. One row per folder in ~/.codex/worktrees, named after the checkout inside it because Codex’s own folder name is a short hash. Rated risky: a worktree can hold the only copy of uncommitted work. A permanent delete runs git worktree prune in the source repository afterwards; a move to the Trash does not, because it can be undone.
Never listed: SQLite databases, settings, credentials, memories, plugins, skills, automations, and the lock files under .tmp. If CODEX_HOME moves the data folder, the scan follows it.
Two guards apply at cleanup. While the ChatGPT app or a codex process is running, every row in these groups is refused with “ChatGPT & Codex is running. Quit it first, then try again.” And a conversation month, worktree, or runtime bundle written to in the last hour is refused as used recently, so a thread still writing or a task still running is never cut off. Those three groups are cleaned only from the app: roomservice clean stays cache-only, and agents are refused.
Codex and ChatGPT are trademarks of OpenAI. Room Service is not affiliated with OpenAI.