- Home
- MCP servers
- MCP Memory
MCP Memory
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"ddkang1-mcp-mem": {
"command": "mcp-mem",
"args": [],
"env": {
"LLM_NAME": "gpt-4o-mini",
"LLM_BASE_URL": "https://llm.example",
"OPENAI_API_KEY": "YOUR_API_KEY",
"EMBEDDING_BASE_URL": "https://embedding.example",
"EMBEDDING_MODEL_NAME": "default-model"
}
}
}
}The MCP Memory server provides a memory management layer for data-rich applications, using a knowledge graph to organize and retrieve information from multiple sources, including uploaded files. You can run it locally or expose it via an SSE transport, enabling efficient, session-scoped memory for interactive conversations and search tasks.
How to use
Start the MCP Memory server locally and connect your MCP client to manage memory across chat sessions. Use the default stdio transport for quick testing, or enable the SSE transport to accept remote connections. Once running, you can create memories for a session, add memory entries, and retrieve memory as your application requires. The server automatically cleans up inactive sessions and memory instances to keep resource usage in check.
How to install
Prerequisites you need before installation: Python 3.x, pip, and Git.
# Clone the repository
git clone https://github.com/ddkang1/mcp-mem.git
cd mcp-mem
# Install in editable mode and the HippoRAG dependency
pip install -e .
pip install hipporag
Configuration and usage notes
You can run the server directly after installation. By default, it uses stdio transport. To enable SSE transport, start the server with the --sse flag. You can also specify host and port when using SSE.
mcp-mem
# SSE transport on a specific host and port
mcp-mem --sse --host 127.0.0.1 --port 3001
Additional configuration and environment details
Configure memory management and model endpoints using environment variables or configuration parameters. The server supports several environment variables to select embedding models, LLMs, and API keys, enabling you to tailor memory indexing and retrieval to your needs.
EMBEDDING_MODEL_NAME="your-model"
LLM_NAME="your-llm"
OPENAI_API_KEY="YOUR_API_KEY"
EMBEDDING_BASE_URL="https://embedding.example"
LLM_BASE_URL="https://llm.example"
Example startup with environment variables:
EMBEDDING_MODEL_NAME="your-model" LLM_NAME="your-llm" mcp-mem
Operations you can perform
The server provides a set of tools to manage memories for chat sessions: create_memory to initialize a memory space for a session, store_memory to add memory entries, and retrieve_memory to fetch memory for a session. These operations enable you to build persistent context across interactions and improve search capabilities.
Example runtime script
For convenience, you can run with environment variables using a helper script if available in your installation. This makes it easy to start the server with a predefined configuration.
./examples/run_with_env_vars.sh
Available tools
create_memory
Create a new memory instance for a specific chat session.
store_memory
Add memory entries to a specific session's memory.
retrieve_memory
Retrieve memory associated with a specific session.