This is a Model Context Protocol (MCP) server implementation for the Remem Memory Agent. It exposes the sophisticated memory system capabilities as standardized tools that can be used by any MCP-compatible client like Claude Desktop, IDEs, or other AI applications.
Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools.
The Remem MCP Server provides the following tools:
- store_memory: Store new memories (Memories) with contextual grounding
- search_memories: Search for relevant memories using vector similarity
- get_memory_stats: Get statistics about the memory system
- answer_question: Answer questions using the memory system with confidence scoring
- extract_and_store_memories: Extract and store memories from conversations or text
- set_context: Set contextual information for memory grounding
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env and add your OpenAI API key and Redis configuration -
Start Redis (if not already running):
docker run -d --name redis -p 6379:6379 redis:8
Download and install Claude Desktop from claude.ai/download.
Create or edit the Claude Desktop configuration file:
macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use the example configuration:
{
"mcpServers": {
"remem-memory": {
"command": "python",
"args": ["/ABSOLUTE/PATH/TO/remem/mcp_server.py"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here",
"REDIS_HOST": "localhost",
"REDIS_PORT": "6379",
"REDIS_DB": "0"
}
}
}
}Important: Replace /ABSOLUTE/PATH/TO/remem/ with the actual absolute path to your remem directory.
After saving the configuration, restart Claude Desktop completely.
Look for the "Search and tools" icon in Claude Desktop. You should see the remem memory tools listed.
Try these example commands:
- "Store this memory: I prefer coffee over tea"
- "What do I prefer to drink?"
- "Search my memories for food preferences"
- "What's the current state of my memory system?"
Store a new memory in the system.
Parameters:
text(required): The memory content to storevectorstore_name(required): Vectorstore nameapply_grounding(optional): Apply contextual grounding (default: true)
Example: "Store this memory: I met John at the coffee shop yesterday"
Search for relevant memories using vector similarity.
Parameters:
query(required): Search query textvectorstore_name(required): Vectorstore nametop_k(optional): Number of results (default: 5)min_similarity(optional): Minimum similarity threshold (default: 0.7)
Example: "Search my memories for coffee shops"
Get statistics about the memory system.
Parameters:
vectorstore_name(required): Vectorstore name
Example: "What's the current state of my memory system?"
Answer a question using the memory system with confidence scoring.
Parameters:
question(required): The question to answervectorstore_name(required): Vectorstore nametop_k(optional): Number of memories to consider (default: 5)confidence_threshold(optional): Minimum confidence threshold (default: 0.7)
Example: "What restaurants have I been to?"
Extract and store memories from conversation text.
Parameters:
conversation_text(required): Text to extract memories fromvectorstore_name(required): Vectorstore nameapply_grounding(optional): Apply contextual grounding (default: true)
Example: "Extract memories from this conversation: [conversation text]"
Set contextual information for memory grounding.
Parameters:
vectorstore_name(required): Vectorstore namelocation(optional): Current locationactivity(optional): Current activitypeople_present(optional): People present (comma-separated)environment(optional): Environmental context
Example: "Set my context: location=home, activity=working, environment=quiet"
The MCP server acts as a bridge between MCP clients and the Remem memory system:
MCP Client (Claude Desktop) <-> MCP Server <-> Remem Memory Agent <-> Redis VectorSet
The server uses the FastMCP framework for easy tool definition and automatic schema generation from Python type hints and docstrings.
- Check the configuration file syntax
- Ensure the path to
mcp_server.pyis absolute - Verify environment variables are set correctly
- Check Claude Desktop logs:
~/Library/Logs/Claude/mcp*.log
- Ensure Redis is running and accessible
- Verify OpenAI API key is valid
- Check server logs for error messages
- Test the memory agent directly with
python cli.py
- Verify Redis connection settings
- Check if the vectorstore exists and is accessible
- Ensure sufficient OpenAI API credits
- Test with simple operations first
To extend the MCP server with additional tools:
- Add new tool functions using the
@mcp.tool()decorator - Use proper type hints and docstrings for automatic schema generation
- Handle errors gracefully and return informative messages
- Test with Claude Desktop or other MCP clients