Codex Setup
This guide covers connecting Codex to Hoard.
Quick Setup
-
Ensure Hoard server is running
Terminal window hoard serve -
Run the setup command
Terminal window hoard setup --codex -
Set the environment variable
Add to
~/.zshrcor~/.bashrc:Terminal window export HOARD_TOKEN="hoard_sk_544e528b4b1ae6..." -
Restart terminal and Codex
-
Test the connection In Codex, run
/mcpto list connected servers
Remote Hoard Server
If Hoard runs on another machine:
hoard setup remote --url https://hoard.example.com --token hoard_sk_... --codexAutomation flow (advanced):
hoard setup remote --url https://hoard.example.com --admin-token YOUR_ADMIN_SECRET --codexInstruction Injection
Hoard can inject a short guidance block into AGENTS.md so Codex agents consistently use:
memory_writefor stable facts/preferencesinbox_putfor durable notes/documentssyncwhen file changes are not visible yet
Manual control:
hoard instructions --codex --dry-runhoard instructions --codex --yesConfiguration
Hoard creates ~/.codex/config.toml:
[mcp_servers.hoard]url = "http://127.0.0.1:19850/mcp"bearer_token_env_var = "HOARD_TOKEN"Troubleshooting
”HOARD_TOKEN not set” error
Ensure the environment variable is exported:
echo $HOARD_TOKENServer not appearing in /mcp
- Check config exists:
cat ~/.codex/config.toml - Verify URL is correct
- Restart Codex
Connection errors
- Ensure Hoard server is running:
hoard serve --status - Check the port (default
19850)
Next Steps
- OpenClaw Setup - Configure OpenClaw
hoard instructions- Instruction injection details- MCP Tools Reference - Tool reference