Connect AI agents to the Mem0 MCP server
Vendor MCP11 toolsOAuth 2.1/DCRAIThe Mem0 MCP connector routes your AI agent's tool calls to Mem0's own MCP server through Scalekit. Each user signs in to Mem0 once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 11 tools.
-
Install the SDK
Section titled “Install the SDK”Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenv -
Set your credentials
Section titled “Set your credentials”Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret> -
Authorize and make your first call
Section titled “Authorize and make your first call”quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'mem0mcp'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Mem0 MCP:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'mem0mcp_get_event_status',toolInput: { event_id: 'YOUR_EVENT_ID' },})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "mem0mcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Mem0 MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={"event_id":"YOUR_EVENT_ID"},tool_name="mem0mcp_get_event_status",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.py
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Update memory — Overwrite an existing memory’s text
- Search memories — Run a semantic search over existing memories
- List events, entities — List memory operation events with optional filters and pagination
- Get memory, memories, event status — Fetch a single memory by ID
- Delete memory, entities, all memories — Delete one memory after the user confirms its memory_id
- Memory add — Store a new preference, fact, or conversation snippet
Tool list
Section titled “Tool list”Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.
mem0mcp_add_memory#Store a new preference, fact, or conversation snippet. Requires at least one: user_id, agent_id, or run_id. Returns an event_id for async polling via get_event_status.8 params
Store a new preference, fact, or conversation snippet. Requires at least one: user_id, agent_id, or run_id. Returns an event_id for async polling via get_event_status.
textstringrequiredPlain sentence summarizing what to store.agent_idstringoptionalOptional agent identifier.app_idstringoptionalOptional app identifier.messagesstringoptionalStructured conversation history with `role`/`content`. Use when you have multiple turns.metadatastringoptionalAttach arbitrary metadata JSON to the memory.run_idstringoptionalOptional run identifier.sourcestringoptionalEvent source tag (defaults to MCP if omitted).user_idstringoptionalOverride the default user scope for this write.mem0mcp_delete_all_memories#Delete every memory in the given user/agent/app/run but keep the entity.5 params
Delete every memory in the given user/agent/app/run but keep the entity.
agent_idstringoptionalOptional agent scope to delete.app_idstringoptionalOptional app scope to delete.run_idstringoptionalOptional run scope to delete.sourcestringoptionalEvent source tag (defaults to MCP if omitted).user_idstringoptionalUser scope to delete; defaults to server user.mem0mcp_delete_entities#Remove an entity and cascade-delete its memories.4 params
Remove an entity and cascade-delete its memories.
agent_idstringoptionalDelete this agent and its memories.app_idstringoptionalDelete this app and its memories.run_idstringoptionalDelete this run and its memories.user_idstringoptionalDelete this user and its memories.mem0mcp_delete_memory#Delete one memory after the user confirms its memory_id.1 param
Delete one memory after the user confirms its memory_id.
memory_idstringrequiredExact memory_id to delete.mem0mcp_get_event_status#Check the status of a specific memory operation event by its ID.1 param
Check the status of a specific memory operation event by its ID.
event_idstringrequiredUUID of the event to check.mem0mcp_get_memories#Page through memories using filters instead of search. Use filters to list specific memories. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.4 params
Page through memories using filters instead of search. Use filters to list specific memories. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.
filtersstringoptionalStructured filters; user_id injected automatically.pagestringoptional1-indexed page number when paginating.page_sizestringoptionalNumber of memories per page (default 10).sourcestringoptionalEvent source tag (defaults to MCP if omitted).mem0mcp_get_memory#Fetch a single memory by ID.1 param
Fetch a single memory by ID.
memory_idstringrequiredExact memory_id to fetch.mem0mcp_list_entities#List which users/agents/apps/runs currently hold memories.0 params
List which users/agents/apps/runs currently hold memories.
mem0mcp_list_events#List memory operation events with optional filters and pagination.3 params
List memory operation events with optional filters and pagination.
event_typestringoptionalFilter by type: ADD, SEARCH, UPDATE, DELETE, GET_ALL, DELETE_ALL.pagestringoptional1-indexed page number.page_sizestringoptionalEvents per page (default 50, max 100).mem0mcp_search_memories#Run a semantic search over existing memories. Use filters to narrow results. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.4 params
Run a semantic search over existing memories. Use filters to narrow results. Common filter patterns: single user: {"AND": [{"user_id": "john"}]}, agent memories: {"AND": [{"agent_id": "agent_name"}]}. user_id is automatically added to filters if not provided.
querystringrequiredNatural language description of what to find.filtersstringoptionalAdditional filter clauses (user_id injected automatically).sourcestringoptionalEvent source tag (defaults to MCP if omitted).top_kstringoptionalNumber of results to return (1-1000, default 10).mem0mcp_update_memory#Overwrite an existing memory's text.3 params
Overwrite an existing memory's text.
memory_idstringrequiredExact memory_id to overwrite.textstringrequiredReplacement text for the memory.sourcestringoptionalEvent source tag (defaults to MCP if omitted).