Agents

Codex CLI

Codex CLI configures MCP servers in ~/.codex/config.toml.

Setup

Install greatmemory first (local quickstart), then add:

# ~/.codex/config.toml

[mcp_servers.greatmemory]
command = "gmem"
args = ["mcp"]

To share one memory store across all your projects, pin the data dir to an absolute path (otherwise it resolves to ./.greatmemory relative to wherever Codex launches the process):

[mcp_servers.greatmemory]
command = "gmem"
args = ["mcp"]

[mcp_servers.greatmemory.env]
GM_DATA_DIR = "/Users/you/.greatmemory"

Restart Codex; the remember, recall, get_context, get_profile, and forget tools become available (parameters in the MCP reference).

No separate server process is needed — gmem mcp opens the database directly.

Usage

Ask Codex to "remember that ..." to store durable notes, and "what do you know about ..." to retrieve them in later sessions. Use a distinct space per project if you point several projects at one shared data dir.

Troubleshooting

  • If the server fails to start, use an absolute path for command (e.g. "/Users/you/.cargo/bin/gmem") — GUI-launched processes often have a minimal PATH.
  • The first tool call downloads the embedding model (one-time, a few tens of MB); subsequent calls are fast and offline.