Memcp

v1.0.0Knowledge & Memorystable

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

claudeclaude-codecontext-engineeringcontext-managementllm
Share:
18
Stars
0
Downloads
0
Weekly
0/5

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

Persistent agent memory for Claude Code
Recursive language model integration
Context management and persistence
maydali28

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 5, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx memcp

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 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)
1

Clone the repository

Clone the MemCP repository from GitHub to your local machine.

git clone https://github.com/mohamedali-may/memcp.git
cd memcp
2

Run 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 setup
3

Configure 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=false
4

Alternative: 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 memcp
5

Verify 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.

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": { "memcp": { "command": "npx", "args": ["-y", "memcp"] } } }

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

Read the full setup guide →

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.

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