1. Conduid
  2. Blockchain
  3. Codex MCP Memory
MCP server · Blockchain

Codex MCP Memory

Unclaimed last commit a year ago blockchain
35Low

Scored 27 days ago · breakdown

About Codex MCP Memory

Codex MCP Memory is an MCP server published by geranton93 in the Blockchain category.

The repository has 14 stars and 5 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/geranton93/codex-mcp-memory

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Codex MCP Memory

Powered by Claude · Grounded in docs

I know everything about Codex MCP Memory. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 2 days ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • !License declaredNo license file. Legally you have no right to use it in a product.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

README

MCP Memory Server

A safe, reliable, and production-ready MCP (Model Context Protocol) server that implements long-term memory capabilities for AI assistants. Built with PostgreSQL and pgvector for efficient vector similarity search.

Features

  • Robust Architecture: Clean separation of concerns with dedicated classes for configuration, logging, database, embeddings, and protocol handling
  • PostgreSQL + pgvector: Efficient vector similarity search with proper database connection pooling
  • Advanced Input Validation: Comprehensive input sanitization and validation to prevent injection attacks
  • Configurable Security: Content length limits, tag count limits, and other security measures
  • Retry Logic: Built-in retry mechanisms for embedding generation and database operations
  • Structured Logging: Advanced logging system with configurable levels and MCP protocol logging
  • Graceful Shutdown: Proper resource cleanup on shutdown signals
  • Error Boundaries: Comprehensive error handling with proper error propagation
  • Semantic Search: BERT-based embedding generation with similarity scoring
  • MCP Protocol Compliant: Full compatibility with Codex CLI and other MCP clients

Prerequisites

  1. PostgreSQL 14+ with pgvector extension installed:
# In your PostgreSQL instance:
CREATE EXTENSION vector;
  1. Node.js 18+

Setup

  1. Install dependencies:
npm install
  1. Configure environment variables:

Option A: Using .env file (for development) Copy .env.example to .env and adjust the values:

cp .env.example .env

Option B: Using codex-config.toml (recommended for Codex CLI) Configure environment variables in your codex-config.toml as shown in the MCP Configuration section.

Required configuration:

# Database Configuration (Required)
DATABASE_URL=postgresql://user:password@localhost:5432/dbname

# Optional configurations with defaults
LOG_LEVEL=info                          # error, warn, info, debug
DB_MAX_POOL_SIZE=20                     # Database connection pool size
SEARCH_DEFAULT_LIMIT=10                 # Default search result limit
MAX_CONTENT_LENGTH=10000                # Max content size for security
MAX_TAGS_COUNT=20                       # Max number of tags per memory
MCP_DEBUG_LOG_PATH=/tmp/memory-debug.log # MCP debug logging path
NODE_ENV=production                      # Runtime environment

See .env.example for all available configuration options.

  1. Initialize the database: The database schema is automatically initialized when the server starts. Ensure your PostgreSQL database has the pgvector extension enabled.

  2. Start the server:

npm start

Architecture

The refactored server follows a clean, modular architecture:

  • Config: Environment variable validation and configuration management
  • Logger: Structured logging with configurable levels and MCP protocol support
  • Validator: Input sanitization and validation with security limits
  • DatabaseManager: Connection pooling, query handling, and schema management
  • EmbeddingsManager: BERT model initialization and embedding generation with retries
  • MCPProtocolHandler: MCP protocol compliance and response formatting
  • MemoryServer: Main coordination class with graceful shutdown

MCP Configuration

Adding the MCP Server to Codex CLI

To use this memory server with Codex CLI, add the following configuration to your codex-config.toml:

[mcp_servers.memory]
command = "node"
args = ["/path/to/your/memory/src/server.js"]

[mcp_servers.memory.env]
# Database configuration (required)
DATABASE_URL = "postgresql://user:password@localhost:port/dbname"

# Optional: Custom debug log path (defaults to repo memory-debug.log)
MCP_DEBUG_LOG_PATH = "/tmp/memory-debug.log"

# Recommended runtime
NODE_ENV = "production"

Replace /path/to/your/memory/src/server.js with the actual absolute path to your server file.

The server communicates over stdio using the MCP JSON‑RPC protocol and is launched by Codex CLI when needed.

Available MCP Tools

The server provides three MCP tools for memory operations:

  1. memory_create - Create a new memory entry

    • type: Type of memory (string, required)
    • content: Content to store (object, required)
    • source: Source of the memory (string, required)
    • confidence: Confidence score between 0 and 1 (number, required)
    • tags: Optional tags (array of strings, optional)
  2. memory_search - Search for memories using semantic similarity

    • query: Search query (string, required)
    • type: Optional type filter (string, optional)
    • tags: Optional tags filter (array of strings, optional)
    • limit: Maximum number of results to return (number, optional)
  3. memory_list - List all memories

    • type: Optional type filter (string, optional)
    • tags: Optional tags filter (array of strings, optional)

Memory Schema

  • id: Unique identifier
  • type: Type of memory (learning, experience, etc.)
  • content: Actual memory content (JSON)
  • source: Where the memory came from
  • embedding: Vector representation of the content (384 dimensions)
  • tags: Array of relevant tags
  • confidence: Confidence score (0-1)
  • createdAt: When the memory was created
  • updatedAt: When the memory was last updated

Agent Integration

For projects using AI agents, include an AGENTS.md file with the following memory policy to enable automatic memory integration:

# Memory policy

- After each /apply, /run, file edit, migration or command execution, summarize changes and call MCP tool `memory_create`.
- Always include tags: ["repo:<repo_name>","branch:develop","svc:<service_name>"] (adjust per project).
- On new tasks, first call `memory_search` with the repo/branch tags to recall last context.
- Keep entries concise: what changed, why, artifacts, next steps.

This ensures AI agents automatically maintain project memory and context across sessions.

Claude MCP

claude mcp add memory \
  --env DATABASE_URL="postgresql://user:pass@localhost:5432/db" \
  --env LOG_LEVEL=info \
  --env EMBEDDINGS_CACHE_SIZE=500 \
  -- node /abs/path/to/memory/src/server.js

Use resources:

  • @memory:mem://by-tags/repo:<repo-name>,svc:<service-name>
  • @memory:mem://item/<uuid>

README fetched from the repository 2 days ago. The original is authoritative.

Questions

About Codex MCP Memory

How do I install Codex MCP Memory?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Codex MCP Memory safe to use with an AI agent?

Its trust score is 35 out of 100 (low). It passes 3 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Codex MCP Memory still maintained?

The last commit was a year ago. That's long enough that you should check whether the maintainer is responding to issues before depending on it.