Install
$ agentstack add mcp-pinkpixel-dev-mem0-mcp ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
[](https://badge.fury.io/js/@pinkpixel%2Fmem0-mcp) [](https://opensource.org/licenses/MIT) [](https://nodejs.org/) [](https://www.typescriptlang.org/) [](https://modelcontextprotocol.io/) [](https://mem0.ai) [](https://www.npmjs.com/package/@pinkpixel/mem0-mcp) [](https://github.com/pinkpixel-dev/mem0-mcp) [](https://smithery.ai/server/@pinkpixel-dev/mem0-mcp-server)
@pinkpixel/mem0-mcp MCP Server ✨
A Model Context Protocol (MCP) server that integrates with Mem0.ai to provide persistent memory capabilities for LLMs. It allows AI agents to store and retrieve information across sessions.
This server uses the mem0ai Node.js SDK for its core functionality.
Features 🧠
Modernized & Advanced Tools (v0.8.0)
add_memory: Stores a memory from text content or structured message arrays.- Inputs:
content(string) ormessages(array of role/content objects),userId(string),runId/sessionId(string),agentId(string),appId(string),metadata(object),infer(boolean),customInstructions(string),waitForCompletion(boolean, default: true),timeoutMs(number, default: 15000) - Behavior: Cloud V3 additions are asynchronous. By default, this tool polls the background queue until completed. Pass
waitForCompletion: falseto get theeventIdimmediately. search_memories: Searches memories using semantic and BM25 hybrid filters.- Inputs:
query(string),userId(string),runId/sessionId(string),agentId(string),appId(string),filters(object),threshold(number),topK(number),rerank(boolean),referenceDate(string) - Behavior: Automatically nests scope variables inside the V3
filtersblock to prevent API validation errors. search_memory: Backward-compatible alias forsearch_memories.list_memories: Paginated listing of memory records scoped by identifiers.- Inputs:
userId(string),runId/sessionId(string),agentId(string),appId(string),filters(object),page(number),pageSize(number) get_memory: Retrieves a single memory record by its ID.- Inputs:
memoryId(string) update_memory: Modifies the text or metadata of an existing memory.- Inputs:
memoryId(string),text(string),metadata(object) delete_memory: Deletes a specific memory record by ID.- Inputs:
memoryId(string) get_memory_history: Retrieves the audit trail of memory revisions (cloud only).- Inputs:
memoryId(string) get_memory_capabilities: Exposes the feature matrix and support flags of the active backend storage mode.- Inputs: None
batch_update_memories: Performs bulk updates of text contents for multiple memories (cloud only).- Inputs:
updates(array of{ memoryId: string, text: string }objects) batch_delete_memories: Performs bulk deletions of multiple memories.- Inputs:
memoryIds(array of strings),confirm(boolean, must betrueto execute) rate_memory: Submits quality feedback evaluation for a memory record (cloud only).- Inputs:
memoryId(string),feedback(string:positive,negative,very_negative),reason(string, optional) get_memory_event: Manually retrieves details of a specific background event job (cloud only).- Inputs:
eventId(string) list_memory_events: Lists history logs of background memory processing events (cloud only).- Inputs:
page(number),pageSize(number) create_memory_export: Initiates an asynchronous memory export query job (cloud only).- Inputs:
schema(object),filters(object, optional),exportInstructions(string, optional) get_memory_export: Retrieves status and download metadata of a memory export job (cloud only).- Inputs:
exportId(string)
Prerequisites 🔑
This server supports three storage modes:
- Cloud Storage Mode ☁️ (Recommended for production)
- Requires a Mem0 API key (provided as
MEM0_API_KEYenvironment variable) - Memories are persistently stored on Mem0's cloud servers
- No local database needed
- Full feature support with advanced filtering and search
- Supabase Storage Mode 🗄️ (Recommended for self-hosting)
- Requires Supabase credentials (
SUPABASE_URLandSUPABASE_KEYenvironment variables) - Requires OpenAI API key (
OPENAI_API_KEYenvironment variable) for embeddings - Memories are persistently stored in your Supabase database
- Free tier available, self-hostable option
- Requires initial database setup (SQL migrations provided below)
- Local Storage Mode 💾 (Development/testing only)
- Requires an OpenAI API key (provided as
OPENAI_API_KEYenvironment variable) - Memories are stored in an in-memory vector database (non-persistent by default)
- Data is lost when the server restarts unless configured for persistent storage
Installation & Configuration ⚙️
You can run this server in three main ways:
Installing via Smithery
To install Mem0 Memory Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @pinkpixel-dev/mem0-mcp-server --client claude
1. Global Installation (Recommended for frequent use)
Install the package globally and use the mem0-mcp command:
npm install -g @pinkpixel/mem0-mcp
After global installation, you can run the server directly:
mem0-mcp
Configure your MCP client to use the global command:
Cloud Storage Configuration (Global Install)
{
"mcpServers": {
"mem0-mcp": {
"command": "mem0-mcp",
"args": [],
"env": {
"MEM0_API_KEY": "YOUR_MEM0_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Supabase Storage Configuration (Global Install)
{
"mcpServers": {
"mem0-mcp": {
"command": "mem0-mcp",
"args": [],
"env": {
"SUPABASE_URL": "YOUR_SUPABASE_PROJECT_URL",
"SUPABASE_KEY": "YOUR_SUPABASE_ANON_KEY",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Local Storage Configuration (Global Install)
{
"mcpServers": {
"mem0-mcp": {
"command": "mem0-mcp",
"args": [],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
}
}
}
}
2. Using npx (Recommended for occasional use)
Configure your MCP client (e.g., Claude Desktop, Cursor, Cline, Roo Code, etc.) to run the server using npx:
Cloud Storage Configuration (npx)
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": [
"-y",
"@pinkpixel/mem0-mcp"
],
"env": {
"MEM0_API_KEY": "YOUR_MEM0_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Supabase Storage Configuration (npx)
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": [
"-y",
"@pinkpixel/mem0-mcp"
],
"env": {
"SUPABASE_URL": "YOUR_SUPABASE_PROJECT_URL",
"SUPABASE_KEY": "YOUR_SUPABASE_ANON_KEY",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Local Storage Configuration (npx)
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": [
"-y",
"@pinkpixel/mem0-mcp"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
}
}
}
}
3. Running from Cloned Repository
Note: This method requires you to git clone the repository first.
Clone the repository, install dependencies, and build the server:
git clone https://github.com/pinkpixel-dev/mem0-mcp
cd mem0-mcp
npm install
npm run build
Then, configure your MCP client to run the built script directly using node:
Cloud Storage Configuration (Cloned Repository)
{
"mcpServers": {
"mem0-mcp": {
"command": "node",
"args": [
"/absolute/path/to/mem0-mcp/build/index.js"
],
"env": {
"MEM0_API_KEY": "YOUR_MEM0_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Supabase Storage Configuration (Cloned Repository)
{
"mcpServers": {
"mem0-mcp": {
"command": "node",
"args": [
"/absolute/path/to/mem0-mcp/build/index.js"
],
"env": {
"SUPABASE_URL": "YOUR_SUPABASE_PROJECT_URL",
"SUPABASE_KEY": "YOUR_SUPABASE_ANON_KEY",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"DEFAULT_AGENT_ID": "your-agent-id",
"DEFAULT_APP_ID": "your-app-id"
}
}
}
}
Local Storage Configuration (Cloned Repository)
{
"mcpServers": {
"mem0-mcp": {
"command": "node",
"args": [
"/absolute/path/to/mem0-mcp/build/index.js"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
},
"disabled": false,
"alwaysAllow": [
"add_memory",
"search_memory",
"delete_memory"
]
}
}
}
Important Notes:
- Replace
/absolute/path/to/mem0-mcp/with the actual absolute path to your cloned repository - Use the
build/index.jsfile, not thesrc/index.tsfile - The MCP server requires clean stdout for protocol communication - any libraries or code that writes to stdout may interfere with the protocol
Supabase Setup 🗄️
If you choose to use Supabase storage mode, you'll need to set up your Supabase database with the required table.
1. Create a Supabase Project
- Go to supabase.com and create a new project
- Note your project URL and anon key from the project settings
2. Run SQL Migrations
Run these SQL commands in your Supabase SQL Editor:
-- Enable the vector extension
create extension if not exists vector;
-- Create the memories table
create table if not exists memories (
id text primary key,
embedding vector(1536),
metadata jsonb,
created_at timestamp with time zone default timezone('utc', now()),
updated_at timestamp with time zone default timezone('utc', now())
);
-- Create the vector similarity search function
create or replace function match_vectors(
query_embedding vector(1536),
match_count int,
filter jsonb default '{}'::jsonb
)
returns table (
id text,
similarity float,
metadata jsonb
)
language plpgsql
as $$
begin
return query
select
t.id::text,
1 - (t.embedding query_embedding) as similarity,
t.metadata
from memories t
where case
when filter::text = '{}'::text then true
else t.metadata @> filter
end
order by t.embedding query_embedding
limit match_count;
end;
$$;
-- Create the memory_history table for history tracking
create table if not exists memory_history (
id text primary key,
memory_id text not null,
previous_value text,
new_value text,
action text not null,
created_at timestamp with time zone default timezone('utc', now()),
updated_at timestamp with time zone,
is_deleted integer default 0
);
3. Set Environment Variables
Add these to your MCP configuration:
SUPABASE_URL: Your Supabase project URL (e.g.,https://your-project.supabase.co)SUPABASE_KEY: Your Supabase anon keyOPENAI_API_KEY: Your OpenAI API key (for embeddings)
Benefits of Supabase Mode
✅ Persistent Storage - Data survives server restarts ✅ Free Tier Available - Generous free tier for development ✅ Self-Hostable - Can run your own Supabase instance ✅ Scalable - Grows with your needs ✅ SQL Access - Direct database access for advanced queries ✅ Real-time Features - Built-in real-time subscriptions
Parameter Configuration 🎯
Understanding Mem0 Parameters
The server uses four key parameters to organize and scope memories:
userId- Identifies the user (required)agentId- Identifies the LLM/agent making the tool call (optional)appId- Identifies the user's project/application - this controls project scope! (optional)sessionId- Identifies the conversation session (maps torun_idin Mem0) (optional)
Environment Variable Fallbacks 🔄
The MCP server supports environment variable fallbacks for user identification and project settings:
DEFAULT_USER_ID: Fallback user ID when not provided in tool callsDEFAULT_AGENT_ID: Fallback agent ID for identifying the LLM/agentDEFAULT_APP_ID: Fallback app ID for project scoping
Priority Order (Important!)
- Tool Parameters (highest priority) - Values provided by the LLM in tool calls
- Environment Variables (fallback) - Values from your MCP configuration
Example Behavior:
// Your MCP config
"env": {
"DEFAULT_USER_ID": "john-doe",
"DEFAULT_AGENT_ID": "my-assistant",
"DEFAULT_APP_ID": "my-project"
}
If LLM provides parameters:
{
"tool": "add_memory",
"arguments": {
"content": "Remember this",
"userId": "session-123", // ← Overrides DEFAULT_USER_ID
"agentId": "different-agent", // ← Overrides DEFAULT_AGENT_ID
"appId": "special-project" // ← Overrides DEFAULT_APP_ID
// sessionId omitted // ← No fallback, will be undefined
}
}
Result: Uses session-123, different-agent, and special-project
If LLM omits parameters:
{
"tool": "add_memory",
"arguments": {
"content": "Remember this"
// All IDs omitted - uses environment variables
}
}
Result: Uses john-doe, my-assistant, and my-project
Controlling LLM Behavior
To ensure your environment variables are used, instruct your LLM:
- "Use the default user ID configured in the environment"
- "Don't specify userId, agentId, or appId parameters"
- "Let the server use the configured defaults"
System Prompt Recommendation
For best results, include instructions in your system prompt like:
When creating memories, use:
- agentId: "my-assistant"
- appId: "my-project"
- sessionId: "current-conversation-id"
Example configuration using DEFAULT_USER_ID:
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": [
"-y",
"@pinkpixel/mem0-mcp"
],
"env": {
"MEM0_API_KEY": "YOUR_MEM0_API_KEY_HERE",
"DEFAULT_USER_ID": "user123",
"ORG_ID": "your-org-id",
"PROJECT_ID": "your-project-id"
}
}
}
}
Or when running directly with node:
git clone https://github.com/pinkpixel-dev/mem0-mcp
cd mem0-mcp
npm install
npm run build
{
"mcpServers": {
"mem0-mcp": {
"command": "node",
"args": [
"path/to/mem0-mcp/build/index.js"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
}
}
}
}
Storage Mode Comparison 🔄
Cloud Storage (Mem0 API) ☁️
- Persistent by default - Your memories remain available across sessions and server restarts
- No local database required - All data is stored on Mem
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: pinkpixel-dev
- Source: pinkpixel-dev/mem0-mcp
- License: MIT
- Homepage: https://pinkpixel.dev
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.