Codex Agent Memory

v1.0.0Knowledge & Memorystable

Local-first Model Context Protocol (MCP) memory layer for Codex CLI/Desktop, Claude Code, Gemini CLI, Qwen/DeepSeek/Ollama and agent workflows. SQLite + FTS5 compact context packs, token savings, read-only mode, no external memory server.

ai-agentauditable-memoryclaude-codecodexcodex-cli
Share:
22
Stars
0
Downloads
0
Weekly
0/5

What is Codex Agent Memory?

Codex Agent Memory is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to local-first model context protocol (mcp) memory layer for codex cli/desktop, claude code, gemini cli, qwen/deepseek/ollama and agent workflows. sqlite + fts5 compact context packs, token savings, read...

Local-first Model Context Protocol (MCP) memory layer for Codex CLI/Desktop, Claude Code, Gemini CLI, Qwen/DeepSeek/Ollama and agent workflows. SQLite + FTS5 compact context packs, token savings, read-only mode, no external memory server.

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Local-first Model Context Protocol (MCP) memory layer for Co

Use Cases

Local-first agent memory
Context compression
Token-efficient persistence
MarceloCaporale

Maintainer

LicenseApache-2.0
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx codex-agent-mem

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Codex Agent Memory

Codex Agent Memory is a local-first MCP memory layer that gives AI coding agents — including Codex CLI, Claude Code, Gemini CLI, and Ollama-based agents — a persistent SQLite + FTS5 memory store without requiring any external server or cloud service. It exposes 34 MCP tools for storing and retrieving past decisions, tracking open work items, creating snapshots, validating memory governance policies, and bootstrapping compact context packs that dramatically reduce token usage on agent startup. The server runs entirely on your machine and supports a read-only audit mode for reviewing stored memory safely.

Prerequisites

  • Python 3.9 or later with pipx installed
  • Git to clone the repository (or pipx install from the GitHub URL directly)
  • An MCP-compatible client: Claude Code, Codex CLI, Gemini CLI, or Claude Desktop
  • ~50MB of disk space for the SQLite database (path is configurable)
1

Install via pipx from GitHub

pipx installs the package in an isolated environment and makes the codex-agent-mem-mcp command available globally without polluting your system Python.

pipx install "git+https://github.com/MarceloCaporale/codex-agent-mem.git"
2

Verify the install and check available commands

Confirm the MCP server entry point and supporting utilities are available on PATH.

codex-agent-mem-mcp --help
codex-agent-mem-smoke --db-path "$HOME/.codex_agent_mem/codex_agent_mem.db"
3

Add to Claude Desktop or Claude Code config

Register the MCP server in your client configuration. The --db-path flag tells the server where to persist the SQLite database. Use --idle-timeout-seconds 1800 for Desktop clients to avoid premature disconnects.

{
  "mcpServers": {
    "codex-agent-mem": {
      "command": "codex-agent-mem-mcp",
      "args": [
        "--db-path", "/Users/yourname/.codex_agent_mem/codex_agent_mem.db",
        "--idle-timeout-seconds", "1800",
        "--profile", "standard"
      ]
    }
  }
}
4

Optional: enable AGENTS.md sync

Pass --sync-project-doc to have the server automatically reinject an AGENTS.md file from your project root into the context on each session. This is useful for persisting project-level conventions.

codex-agent-mem-mcp \
  --db-path "$HOME/.codex_agent_mem/codex_agent_mem.db" \
  --sync-project-doc \
  --profile full
5

Bootstrap context at the start of each session

At the beginning of a new agent session, call mem_bootstrap_context to load a compact summary of relevant past decisions and open work items. This is the primary token-saving workflow.

Codex Agent Memory Examples

Client configuration

Claude Desktop config entry for codex-agent-mem with standard profile and 30-minute idle timeout.

{
  "mcpServers": {
    "codex-agent-mem": {
      "command": "codex-agent-mem-mcp",
      "args": [
        "--db-path", "/Users/yourname/.codex_agent_mem/codex_agent_mem.db",
        "--idle-timeout-seconds", "1800",
        "--profile", "standard"
      ]
    }
  }
}

Prompts to try

Example prompts for using codex-agent-mem tools in a Claude Code session.

- "Bootstrap context for the payment service project and summarise what you know"
- "Search memory for any past decisions about the database schema"
- "Create a snapshot of the current session state before we refactor the auth module"
- "List all open work items and check which ones are completed"
- "What does the memory health check say about the current database state?"

Troubleshooting Codex Agent Memory

pipx install fails with 'could not find a version that satisfies the requirement'

The package is installed directly from GitHub, not PyPI. Make sure you include the full git+ prefix in the URL: pipx install "git+https://github.com/MarceloCaporale/codex-agent-mem.git". If you have SSH set up for GitHub you can also use the SSH URL.

MCP client disconnects after a period of inactivity

Increase the idle timeout by passing --idle-timeout-seconds 1800 (30 minutes) or higher. The default is tuned for CLI usage; Desktop clients need a longer timeout.

mem_search returns no results even though context was stored in a previous session

Confirm --db-path points to the same file in every client config entry. If you have multiple configs using different paths, the databases are separate. Run codex-agent-mem-smoke with the correct db-path to confirm the database contains records.

Frequently Asked Questions about Codex Agent Memory

What is Codex Agent Memory?

Codex Agent Memory is a Model Context Protocol (MCP) server that local-first model context protocol (mcp) memory layer for codex cli/desktop, claude code, gemini cli, qwen/deepseek/ollama and agent workflows. sqlite + fts5 compact context packs, token savings, read-only mode, no external memory server. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Codex Agent Memory?

Follow the installation instructions on the Codex Agent Memory GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Codex Agent Memory?

Codex Agent Memory works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Codex Agent Memory free to use?

Yes, Codex Agent Memory is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "codex-agent-mem": { "command": "npx", "args": ["-y", "codex-agent-mem"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Codex Agent Memory?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides