Memcp
A persistent memory MCP server for Claude Code - Recursive Language Model integration for Claude Code inspired by MIT CSAIL paper
What is Memcp?
Memcp is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent memory mcp server for claude code - recursive language model integration for claude code inspired by mit csail paper
A persistent memory MCP server for Claude Code - Recursive Language Model integration for Claude Code inspired by MIT CSAIL paper
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A persistent memory MCP server for Claude Code - Recursive L
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx memcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Memcp
MemCP is a persistent memory MCP server for Claude Code that implements the Recursive Language Model (RLM) pattern, inspired by MIT CSAIL research. It allows Claude to store insights, decisions, and large documents across sessions using a 5-tier search stack (keyword → BM25 → semantic → hybrid fusion) and a 4-graph knowledge structure with semantic, temporal, causal, and entity edges. Instead of filling the context window with repeated content, Claude navigates memory like named variables — loading only what it needs, when it needs it — achieving up to 218× token reduction for large documents.
Prerequisites
- Python 3.9 or higher installed
- Git installed to clone the repository
- Claude Code or another MCP-compatible client
- Optional: Docker for containerized setup
- Optional: PostgreSQL or vector backend for semantic search (core works zero-dependency)
Clone the repository
Clone the MemCP repository from GitHub to your local machine.
git clone https://github.com/mohamedali-may/memcp.git
cd memcpRun the interactive installer
The Makefile setup command handles Python version checks, optional feature selection (BM25, fuzzy, semantic, NER), MCP server registration, sub-agent deployment, and hook integration into Claude Code settings automatically.
make setupConfigure environment variables
Set environment variables to control storage location, memory limits, and optional features. These follow the 12-factor app pattern and can be set in your shell or a .env file.
export MEMCP_DATA_DIR=~/.memcp
export MEMCP_MAX_INSIGHTS=10000
export MEMCP_RETENTION_ARCHIVE_DAYS=30
export MEMCP_EMBEDDING_PROVIDER=auto
export MEMCP_SECRET_DETECTION=true
export MEMCP_SEMANTIC_DEDUP=falseAlternative: Docker setup
If you prefer containerized deployment, build the Docker image and register it as an MCP server with persistent volume mount.
docker build -t memcp .
claude mcp add memcp -- docker run --rm -i \
-v ~/.memcp:/data -e MEMCP_DATA_DIR=/data memcpVerify the server is running
Call the ping tool through Claude Code to verify the MCP server is connected and responsive.
# In Claude Code, ask:
# "Ping the memcp server and show me its status"Memcp Examples
Client configuration
Register MemCP in your Claude Code MCP configuration after running make setup, or add it manually. The Docker variant shown below works cross-platform.
{
"mcpServers": {
"memcp": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "~/.memcp:/data",
"-e", "MEMCP_DATA_DIR=/data",
"memcp"
]
}
}
}Prompts to try
Use these prompts in Claude Code after MemCP is connected to store decisions, load large files selectively, and recall knowledge across sessions.
- "Remember that we chose SQLite over Postgres for this project because of deployment simplicity — tag it as a decision with high importance"
- "Load the file src/api/routes.py into memcp context named 'api-routes' and show me only lines 100-200"
- "Recall all critical and high-importance insights from our last session about authentication"
- "Show me the knowledge graph edges for the insight about our database decision — what caused it and what depends on it?"
- "Consolidate and archive any insights older than 30 days to keep memory clean"Troubleshooting Memcp
make setup fails with Python version error
MemCP requires Python 3.9+. Run `python3 --version` to check. If your system Python is older, install a newer version via pyenv or Homebrew and ensure it is on PATH before running make setup.
Semantic search returns no results even after storing insights
Semantic search requires the optional embedding backend. Run `pip install memcp[semantic]` inside the project venv, then set `MEMCP_EMBEDDING_PROVIDER=auto`. Without it, MemCP falls back to BM25/keyword tiers which still work.
Claude Code does not list memcp tools after setup
Check that the MCP server entry was added to Claude Code's settings file (usually ~/.claude/settings.json). Run `claude mcp list` to verify. If missing, re-run `make setup` or manually add the entry using `claude mcp add memcp -- python -m memcp`.
Frequently Asked Questions about Memcp
What is Memcp?
Memcp is a Model Context Protocol (MCP) server that persistent memory mcp server for claude code - recursive language model integration for claude code inspired by mit csail paper It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Memcp?
Follow the installation instructions on the Memcp GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Memcp?
Memcp works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Memcp free to use?
Yes, Memcp is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Memcp Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Memcp? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
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.
Set Up Memcp in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Memcp?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.