Mem0 Memory MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Mem0 Memory MCP ServerRemember that I like dark mode"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mem0 Memory MCP Server
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.
Features
Store memories with user-specific context
Search through stored memories with relevance scoring
Simple and intuitive API
Built on the Model Context Protocol
Automatic error handling
Support for multiple user contexts
Related MCP server: Mem0 Memory MCP Server
Usage
This server now supports StreamableHTTP via Smithery CLI while retaining optional STDIO compatibility.
StreamableHTTP (recommended)
Development (opens Smithery Playground and exposes HTTP transport):
npm run devBuild for HTTP/StreamableHTTP (Smithery):
npm run buildStart the HTTP server locally (Smithery-built entrypoint):
npm run start:httpYou can configure the server using Smithery’s generated form in the playground or by setting environment variables (e.g., MEM0_API_KEY).
STDIO (backward compatible)
Run the server over STDIO (useful for local clients that only support STDIO):
env MEM0_API_KEY=your-api-key-here npm run build:stdio && npm run start:stdioConfiguration for AI Tools
Running on Cursor (STDIO)
Configuring Cursor 🖥️
To configure Mem0 MCP in Cursor:
Open Cursor Settings
Go to Features > MCP Servers
Click "+ Add New MCP Server"
Enter the following:
Name: "mem0-mcp" (or your preferred name)
Type: "command"
Command:
env MEM0_API_KEY=your-api-key-here npx -y @mem0/mcp(or usestart:stdiofrom this repo)
To configure Mem0 MCP using JSON configuration:
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": ["-y", "@mem0/mcp"],
"env": {
"MEM0_API_KEY": "YOUR-API-KEY-HERE"
}
}
}
}Running on VS Code (STDIO)
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}"
}
}
}
}
}Available Tools
1. Add Memory Tool (add-memory)
Store new memories with user-specific context.
{
"name": "add-memory",
"arguments": {
"content": "User prefers dark mode interface",
"userId": "user123"
}
}2. Search Memories Tool (search-memories)
Search through stored memories to retrieve relevant information.
{
"name": "search-memories",
"arguments": {
"query": "What are the user's interface preferences?",
"userId": "user123"
}
}Response Format
Add Memory Response
{
"content": [
{
"type": "text",
"text": "Memory added successfully"
}
],
"isError": false
}Search Memory Response
{
"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
}Configuration
Environment Variables
MEM0_API_KEY: Your Mem0 API key (required)Required for operation
Can be obtained from Mem0 Dashboard
Development
Prerequisites
Node.js >= 18
A Mem0 API key
Setup
Install dependencies:
npm installOptionally create a
.envfile in the project directory and add your Mem0 API key:
MEM0_API_KEY=your-api-key-here
DEFAULT_USER_ID=mem0-mcp-userHTTP/StreamableHTTP Dev
npm run devSTDIO Dev
npm run build:stdio
npm run start:stdioError Handling
The server includes error handling for:
API connection issues
Invalid memory operations
Search errors
Authentication failures
Example error response:
{
"content": [
{
"type": "text",
"text": "Error: Failed to search memories: Invalid API key"
}
],
"isError": true
}Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -license-quality-maintenanceProvides AI agents with persistent long-term memory capabilities using semantic search. Enables storing, retrieving, and searching memories through three core tools integrated with Mem0 and vector storage.Last updated
- Alicense-qualityDmaintenanceEnables AI agents to store and retrieve memories with user-specific context using Mem0, allowing them to maintain conversation history and make informed decisions based on past interactions.Last updated1801ISC
- Flicense-quality-maintenanceEnables persistent storage and semantic search of coding preferences, patterns, and implementations using Mem0, allowing AI agents to remember and retrieve development best practices across sessions.Last updated3
- AlicenseAquality-maintenanceEnables AI applications to add, search, update, and delete long-term memories using the Mem0 Memory API, allowing agents to persistently remember user preferences, conversation history, and contextual information across sessions.Last updated9
Related MCP Connectors
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/whysosaket/sample-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server