
Mem0
STDIOMCP server providing memory storage and retrieval capabilities using Mem0
MCP server providing memory storage and retrieval capabilities using Mem0
A Model Context Protocol (MCP) server that provides memory storage and retrieval capabilities using Mem0. This tool allows you to store and search through memories, making it useful for maintaining context and making informed decisions based on past interactions.
env MEM0_API_KEY=your-api-key-here npx -y @mem0/mcp
npm install -g @mem0/mcp
To configure Mem0 MCP in Cursor:
env MEM0_API_KEY=your-api-key-here npx -y @mem0/mcp
To configure Mem0 MCP using JSON configuration:
{ "mcpServers": { "mem0-mcp": { "command": "npx", "args": ["-y", "@mem0/mcp"], "env": { "MEM0_API_KEY": "YOUR-API-KEY-HERE" } } } }
Add the following JSON block to your User Settings (JSON) file in VS Code:
{ "mcp": { "inputs": [ { "type": "promptString", "id": "apiKey", "description": "Mem0 API Key", "password": true } ], "servers": { "mem0-memory": { "command": "npx", "args": ["-y", "@mem0/mcp"], "env": { "MEM0_API_KEY": "${input:apiKey}" } } } } }
Store new memories with user-specific context.
{ "name": "add-memory", "arguments": { "content": "User prefers dark mode interface", "userId": "user123" } }
Search through stored memories to retrieve relevant information.
{ "name": "search-memories", "arguments": { "query": "What are the user's interface preferences?", "userId": "user123" } }
{ "content": [ { "type": "text", "text": "Memory added successfully" } ], "isError": false }
{ "content": [ { "type": "text", "text": "Memory: User prefers dark mode interface\nRelevance: 0.95\n---\nMemory: User mentioned liking minimal UI\nRelevance: 0.82\n---" } ], "isError": false }
MEM0_API_KEY
: Your Mem0 API key (required)
npm install
.env
file in the root directory and add your Mem0 API key:MEM0_API_KEY=your-api-key-here
To run the server in development mode:
npm run dev
To build the project:
npm run build
To start the server after building:
npm start
The server includes error handling for:
Example error response:
{ "content": [ { "type": "text", "text": "Error: Failed to search memories: Invalid API key" } ], "isError": true }
Contributions are welcome! Please feel free to submit a Pull Request.
MIT