Get the FREE Ultimate OpenClaw Setup Guide →

memcp

A persistent memory MCP server for Claude Code - Recursive Language Model integration for Claude Code inspired by MIT CSAIL paper

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio maydali28-memcp python -m memcp \
  --env MEMCP_HOME="Path to the MemCP data directory (defaults to ~/.memcp)" \
  --env MEMCP_LOG_LEVEL="Logging level (e.g., INFO, DEBUG)"

How to use

MemCP is a persistent memory MCP server designed to augment Claude Code with long-term memory capabilities. It stores insights, decisions, and context on disk and exposes a suite of MCP tools to save, retrieve, organize, and search information across sessions. The server integrates with the MemCP memory graph (MAGMA) and supports context management, multi-tier search, and sub-agents to enable more reliable and scalable memory operations for long-running conversations. Tools are categorized into memory, context management, search, and lifecycle actions, enabling you to remember important facts, chunk large texts, recall relevant insights, and manage your stored content efficiently.

To interact with MemCP, run the server using the provided MCP entrypoint and then call the available tools (e.g., memcp_remember, memcp_recall, memcp_load_context, memcp_search). The system persists data on disk and provides a 24-tool memory surface, a context store, and a multi-faceted search stack. You can explore and leverage the 6 chunking strategies, memory consolidation features, and the MAGMA graph to connect insights via semantic, temporal, causal, and entity edges. This enables Claude Code to retrieve relevant information across sessions without losing critical context, even after compact or session boundaries.

How to install

Prerequisites:

  • Python 3.10+ installed on your system
  • Git to clone the repository (optional if you already have the source)
  1. Clone the MemCP repository or install via your preferred method:
  1. Create and activate a virtual environment (recommended):
  • macOS/Linux: python -m venv venv source venv/bin/activate
  • Windows: python -m venv venv .\venv\Scripts\activate
  1. Install dependencies:
  • If using a local clone: pip install -r requirements.txt
  1. Configure environment variables (optional but recommended):
  • MEMCP_HOME: Path to store data (default: ~/.memcp)
  • MEMCP_LOG_LEVEL: Logging level (INFO, DEBUG)
  1. Run the server:
  • python -m memcp
  1. Verify the server is running by calling a health check tool (e.g., memcp_ping) or querying the API as documented in the repo.

Notes:

  • If you use Docker or other deployment methods, adapt the commands to fit your environment if you have a different entrypoint.

Additional notes

Tips and common issues:

  • Ensure Python 3.10+ is used to meet MemCP's compatibility requirements.
  • The MEMCP_HOME directory stores the SQLite graph (graph.db) and context files; ensure it has sufficient disk space for your workload.
  • Enable verbose logging (MEMCP_LOG_LEVEL=DEBUG) while debugging issues, then revert to INFO for production.
  • MemCP supports 24 MCP tools across multiple categories; refer to docs/TOOLS.md for full parameter details and examples.
  • If you upgrade MemCP, review compatibility notes related to schema migrations for graph.db and context storage.
  • When running with Docker or containerized environments, ensure persistent volumes are mounted to MEMCP_HOME so data survives restarts.
  • For memory-sensitive deployments, tune max_tokens and chunking strategies to balance performance and memory usage.

Related MCP Servers

Sponsor this space

Reach thousands of developers