![]()
Power your agent
การติดตั้งจากผู้เผยแพร่ ไม่ใช่เอนด์พอยต์ของ PlugMCP
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิด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.
add_memory: Stores a memory from text content or structured message arrays.
content (string) or messages (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)waitForCompletion: false to get the eventId immediately.search_memories: Searches memories using semantic and BM25 hybrid filters.
query (string), userId (string), runId / sessionId (string), agentId (string), appId (string), filters (object), threshold (number), topK (number), rerank (boolean), referenceDate (string)filters block to prevent API validation errors.search_memory: Backward-compatible alias for search_memories.list_memories: Paginated listing of memory records scoped by identifiers.
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.
memoryId (string)update_memory: Modifies the text or metadata of an existing memory.
memoryId (string), text (string), metadata (object)delete_memory: Deletes a specific memory record by ID.
memoryId (string)get_memory_history: Retrieves the audit trail of memory revisions (cloud only).
memoryId (string)get_memory_capabilities: Exposes the feature matrix and support flags of the active backend storage mode.
batch_update_memories: Performs bulk updates of text contents for multiple memories (cloud only).
updates (array of { memoryId: string, text: string } objects)batch_delete_memories: Performs bulk deletions of multiple memories.
memoryIds (array of strings), confirm (boolean, must be true to execute)rate_memory: Submits quality feedback evaluation for a memory record (cloud only).
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).
eventId (string)list_memory_events: Lists history logs of background memory processing events (cloud only).
page (number), pageSize (number)create_memory_export: Initiates an asynchronous memory export query job (cloud only).
schema (object), filters (object, optional), exportInstructions (string, optional)get_memory_export: Retrieves status and download metadata of a memory export job (cloud only).
exportId (string)This server supports three storage modes:
Cloud Storage Mode ☁️ (Recommended for production)
MEM0_API_KEY environment variable)Supabase Storage Mode 🗄️ (Recommended for self-hosting)
SUPABASE_URL and SUPABASE_KEY environment variables)OPENAI_API_KEY environment variable) for embeddingsLocal Storage Mode 💾 (Development/testing only)
OPENAI_API_KEY environment variable)You can run this server in three main ways:
To install Mem0 Memory Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @pinkpixel-dev/mem0-mcp-server --client claude
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:
{
"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"
}
}
}
}
{
"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"
}
}
}
}
{
"mcpServers": {
"mem0-mcp": {
"command": "mem0-mcp",
"args": [],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
}
}
}
}
npx (Recommended for occasional use)Configure your MCP client (e.g., Claude Desktop, Cursor, Cline, Roo Code, etc.) to run the server using 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"
}
}
}
}
{
"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"
}
}
}
}
{
"mcpServers": {
"mem0-mcp": {
"command": "npx",
"args": [
"-y",
"@pinkpixel/mem0-mcp"
],
"env": {
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY_HERE",
"DEFAULT_USER_ID": "user123"
}
}
}
}
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:
{
"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"
}
}
}
}
{
"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"
}
}
}
}
{
"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:
/absolute/path/to/mem0-mcp/ with the actual absolute path to your cloned repositorybuild/index.js file, not the src/index.ts fileIf you choose to use Supabase storage mode, you'll need to set up your Supabase database with the required table.
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
);
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)✅ 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
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 to run_id in Mem0) (optional)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// 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
To ensure your environment variables are used, instruct your LLM:
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"
}
}
}
}
agent_id and threshold parametersClone the repository and install dependencies:
git clone https://github.com/pinkpixel-dev/mem0-mcp
cd mem0-mcp
npm install
Build the server:
npm run build
For development with auto-rebuild on file changes:
npm run watch
Since MCP servers communicate over stdio, debugging can be challenging. Here are some approaches:
npm run inspector
Console Logging: When adding console logs, always use console.error() instead of console.log() to avoid interfering with the MCP protocol
Environment Files: Use a .env file for local development to simplify setting API keys and other configuration options
Mem0 Cloud V3 addition is an asynchronous background task. When calling add_memory, the server submits the request to /v3/memories/add/ and receives an eventId.
/v1/event/{id}/) every 500ms for up to timeoutMs (default 15000ms) until the status becomes SUCCEEDED or FAILED. Once resolved, it returns the final outcome."waitForCompletion": false to bypass polling. The server will immediately return the eventId and a PENDING status.The Mem0 Cloud V3 search and list endpoints reject top-level scope IDs (user_id, agent_id, app_id, run_id) and return an HTTP 400 error. V3 requires these fields inside the nested filters object.
To prevent breaking client configurations, this server automatically normalizes top-level scope variables (userId, agentId, appId, runId/sessionId) and merges them into the nested filters object under the hood before sending the API request.
Different backends support different feature sets. Call get_memory_capabilities to get a structured capability matrix of the active backend.
apiVersion: "v3", async events, listing, audit histories, logical queries).get_memory_history or list_memories) will fail gracefully with clear feature-unavailable messages.MCP servers communicate using JSON-RPC over stdout. Any unexpected library logs printed to stdout will corrupt the protocol channel and cause clients to crash.
This server overrides the default console output methods (such as console.log) to redirect/mute standard logging, ensuring clean stdio communication.
Made with 💖 by Pink Pixel
A memory system using mem0 for AI applications. Enables long-term memory for AI agents as a drop-in MCP server.
เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Mem0 ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-14 A memory system using mem0 for AI applications. Enables long-term memory for AI agents as a drop-in MCP server.