Mem0 Custom Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Mem0 Custom Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A custom Model Context Protocol (MCP) server that connects to self-hosted Mem0 API instances. Enables Claude Code to use your own Mem0 deployment for memory management.
The official @mem0/mcp-server and community @pinkpixel/mem0-mcp packages only support:
MEM0_API_KEY)Neither supports connecting to custom self-hosted Mem0 API endpoints.
This custom MCP server bridges that gap by providing a wrapper around your self-hosted Mem0 API.
add_memory - Store new memoriessearch_memories - Semantic search through memoriesget_memories - Retrieve all memories for a userdelete_memory - Delete specific memories# Clone the repository
git clone https://github.com/emasoudy/mem0-custom-mcp.git
cd mem0-custom-mcp
# Install dependencies
npm install
# Build the project
npm run build# This will be available after npm publish
npm install -g mem0-custom-mcpThe server is configured via environment variables:
MEM0_API_URL - Your Mem0 API endpoint (default: http://localhost:8888)DEFAULT_USER_ID - Default user ID for memory operations (default: default)Example configurations:
http://localhost:8888http://host.docker.internal:8888http://your-server-ip:8888You can configure this MCP server at either user level (available in all projects) or project level (specific project only).
#### Option 1: Using CLI (Recommended)
User-level (available everywhere):
claude mcp add mem0 \
--scope user \
--command node \
--arg "/absolute/path/to/mem0-custom-mcp/dist/index.js" \
--env MEM0_API_URL=http://localhost:8888 \
--env DEFAULT_USER_ID=defaultProject-level (specific project only):
cd /path/to/your/project
claude mcp add mem0 \
--scope project \
--command node \
--arg "/absolute/path/to/mem0-custom-mcp/dist/index.js" \
--env MEM0_API_URL=http://localhost:8888 \
--env DEFAULT_USER_ID=default#### Option 2: Manual Configuration
User-level - Edit ~/.claude.json:
{
"mcpServers": {
"mem0": {
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/mem0-custom-mcp/dist/index.js"
],
"env": {
"MEM0_API_URL": "http://localhost:8888",
"DEFAULT_USER_ID": "default"
}
}
}
}Project-level - Edit .claude.json in your project root:
{
"projects": {
"your-project-path": {
"mcpServers": {
"mem0": {
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/mem0-custom-mcp/dist/index.js"
],
"env": {
"MEM0_API_URL": "http://localhost:8888",
"DEFAULT_USER_ID": "default"
}
}
}
}
}
}Verify installation:
claude mcp list
# Should show "mem0" in the listnpm run build - Compile TypeScript to JavaScriptnpm run dev - Build and run the servernpm start - Run the compiled serverStore a new memory in Mem0.
Parameters:
content (required) - The content to storeuser_id (optional) - User ID (defaults to env DEFAULT_USER_ID)metadata (optional) - Additional metadata objectSearch memories using semantic search.
Parameters:
query (required) - Search query stringuser_id (optional) - User ID (defaults to env DEFAULT_USER_ID)limit (optional) - Maximum results (default: 10)Retrieve all memories for a user.
Parameters:
user_id (optional) - User ID (defaults to env DEFAULT_USER_ID)limit (optional) - Maximum results (default: 100)Delete a specific memory by ID.
Parameters:
memory_id (required) - ID of the memory to deleteThis MCP server acts as a bridge between Claude Code and your self-hosted Mem0 API instance:
┌─────────────────────────┐
│ Claude Code │
└────────────┬────────────┘
│ MCP stdio protocol
│
┌────────────▼────────────┐
│ mem0-custom-mcp │ ← This MCP server (Node.js)
│ (MCP wrapper) │
└────────────┬────────────┘
│ HTTP REST API (localhost:8888 or custom URL)
│
┌────────────▼────────────┐
│ Self-Hosted Mem0 API │ ← Mem0 API server (Python/FastAPI)
│ (your-server:8888) │ Handles memory operations
└────────────┬────────────┘
│
┌────┴─────┐
│ │
┌────▼───┐ ┌──▼──────┐
│PGVector│ │ Neo4j │ ← Databases managed by Mem0 API
│(Vector)│ │ (Graph) │
└────────┘ └─────────┘Flow:
Note: This server does NOT directly access PostgreSQL or Neo4j. It communicates only with the Mem0 API endpoint, which handles all database operations.
This MCP server uses the following Mem0 API endpoints:
POST /v1/memories - Add new memory{"messages": [{"role": "user", "content": "..."}], "user_id": "...", "metadata": {}}GET /v1/memories/{user_id} - Get all memories for a userPOST /v1/memories/search - Search memories with semantic search{"query": "...", "user_id": "...", "limit": 10}DELETE /v1/memories/{memory_id} - Delete a specific memoryCheck debug logs in ~/.claude/debug/ for error messages.
Common issues:
The MCP server has a built-in 120-second timeout for Mem0 API requests. This accommodates the time needed for:
Typical memory creation takes 30-60 seconds when using GPT-5-mini.
If you need to adjust the timeout, modify src/index.ts line 59:
const timeoutId = setTimeout(() => controller.abort(), 120000); // 2 minutesVerify your Mem0 API is running:
# For local deployment
curl http://localhost:8888/health
# For remote/VPN deployment
curl http://your-server-ip:8888/healthExpected response:
{"status":"ok","db_connected":true,"stores":{"vector":"postgresql","graph":"neo4j"}}Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
# Clone and setup
git clone https://github.com/emasoudy/mem0-custom-mcp.git
cd mem0-custom-mcp
npm install
# Make changes to src/index.ts
# Build and test
npm run build
npm run dev # Build and runSee CHANGELOG.md for version history.
MIT License - see LICENSE for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.