Codex CLI
Connect Codex CLI to MemPalace Cloud with a one-liner. The install script adds the MCP server and downloads the memory skill into your project's AGENTS.md.
Prerequisites
- A MemPalace Cloud account (free tier works)
- Codex CLI installed (
npm i -g @openai/codex)
Installation
macOS / Linux:
curl -sL https://mempalace.cloud/skill-packs/install-codex.sh | bash
Windows (PowerShell):
irm https://mempalace.cloud/skill-packs/install-codex.ps1 | iex
The script does two things:
- Adds the MCP server via
codex mcp add(opens browser for OAuth login) - Downloads the current memory skill into
AGENTS.mdin your working directory
The skill is downloaded fresh on first install. To avoid duplication, the script skips the step if AGENTS.md already contains a "Memory Protocol" section. To update an existing install to a newer skill version, see the Updates section below.
What the skill ships
The memory protocol in AGENTS.md teaches Codex:
- Discovery First — read the palace structure (
list_wings,list_rooms) before writing - Palace Structure — how to organize memories into wings, rooms, and drawers
- Save Decision Flow — a three-question flow (which wing, which room, which tool)
- Anti-patterns — no silent creation, no generic dumps, no "everything into diary"
Note: unlike Claude Code, Codex CLI doesn't support auto-save hooks. You'll need to ask Codex to save memories explicitly at the end of important work ("save what we learned today"), or add your own reminder to AGENTS.md.
Manual setup
If you prefer to set things up manually:
codex mcp add mempalace-cloud --url https://api.mempalace.cloud/mcp
Then append the hosted memory protocol to your AGENTS.md:
curl -sL https://mempalace.cloud/skill-packs/codex-agents.md >> AGENTS.md
Verification
Start Codex in the directory where you installed and ask:
"What do you remember about me?"
Codex should call mempalace_list_wings first (discovery), then mempalace_search or mempalace_kg_query before answering.
Updates
Re-run the install script to pull the latest skill version:
curl -sL https://mempalace.cloud/skill-packs/install-codex.sh | bash
The script detects if AGENTS.md already contains a Memory Protocol and won't duplicate it. If you want to force-refresh, remove the "Memory Protocol" block manually and re-run the script.
Troubleshooting
Codex says "I don't have memory tools"
Run codex mcp list — check that mempalace-cloud is listed. Also verify that AGENTS.md exists in your project with the "Memory Protocol" section.
OAuth login doesn't complete Make sure you have a MemPalace Cloud account and that your browser opened the login page.
Memories captured but don't show up New memories land in your Inbox first. Items auto-approve after 24 hours if you don't review them.