Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables memory storage and retrieval using Mem0, allowing users to store context-specific memories and search through them with relevance scoring.

README.md

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

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 dev
  • Build for HTTP/StreamableHTTP (Smithery):
npm run build
  • Start the HTTP server locally (Smithery-built entrypoint):
npm run start:http

You 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:stdio

Configuration for AI Tools

Running on Cursor (STDIO)

Configuring Cursor 🖥️

To configure Mem0 MCP in Cursor:

  1. Open Cursor Settings
  2. Go to Features > MCP Servers
  3. Click "+ Add New MCP Server"
  4. 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 use start:stdio from 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

  1. Install dependencies:
npm install
  1. Optionally create a .env file in the project directory and add your Mem0 API key:
MEM0_API_KEY=your-api-key-here
DEFAULT_USER_ID=mem0-mcp-user

HTTP/StreamableHTTP Dev

npm run dev

STDIO Dev

npm run build:stdio
npm run start:stdio

Error 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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.