memcp
A persistent memory MCP server for Claude Code - Recursive Language Model integration for Claude Code inspired by MIT CSAIL paper
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)
- Clone the MemCP repository or install via your preferred method:
- Git (local development): git clone https://github.com/mohamedali-may/memcp.git cd memcp
- PyPI (if available in your workflow): pip install memcp # if published as a package
- 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
- Install dependencies:
- If using a local clone: pip install -r requirements.txt
- Configure environment variables (optional but recommended):
- MEMCP_HOME: Path to store data (default: ~/.memcp)
- MEMCP_LOG_LEVEL: Logging level (INFO, DEBUG)
- Run the server:
- python -m memcp
- 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
mcp-tasks
A comprehensive and efficient MCP server for task management with multi-format support (Markdown, JSON, YAML)
omega-memory
Persistent memory for AI coding agents
rlm-claude
Recursive Language Models for Claude Code - Infinite memory solution inspired by MIT CSAIL paper
claude-code-agentic-semantic-memory-system
This guide provides complete instructions for implementing an **Agentic Semantic Memory System** that enables Claude agents to:
mcp-tidy
CLI tool to visualize and manage MCP server configurations in Claude Code. List servers, analyze usage statistics, and clean up unused servers
mwilliams_mcpbridge
MCP Bridge - 99% context reduction for AI agents. Consolidates multiple MCP servers behind lazy-loading meta-tools. Result compaction, schema caching, health checks.