mem0-local-mcp
A fully local, self-hosted memory server for MCP clients (Claude Code, Cursor, etc.) that provides persistent memory storage with semantic search, using local embeddings and a local Qdrant vector store.
README
mem0-local-mcp
A fully local, self-hosted mem0 memory server for MCP clients (Claude Code, Claude Desktop, Cursor, …).
- Local embeddings via fastembed (ONNX, no PyTorch, no GPU) —
BAAI/bge-small-en-v1.5, 384-dim. Can be used with different LLM via API key. - Local vector store via Qdrant on
localhost. - Switchable extraction LLM — Anthropic Claude (default) or Google Gemini, chosen by one env var.
- No API key needed for normal use. Reads and verbatim writes (
infer=False) run entirely on your machine. A provider key is used only when you opt into LLM fact-extraction (infer=True).
Tools
| Tool | Purpose |
|---|---|
add_memory(content, user_id, agent_id?, run_id?, infer=False) |
Store a memory. infer=False stores verbatim (local, no LLM); infer=True extracts/dedupes via the LLM. |
search_memories(query, user_id, agent_id?, run_id?, top_k=5) |
Semantic search within a scope. |
list_memories(user_id, agent_id?, run_id?) |
List a scope without ranking. |
delete_memory(memory_id) |
Delete a single memory. |
Memories are scoped by any of user_id / agent_id / run_id.
Instructions for your agent
Copy the block below and paste it to your coding agent (Claude Code, Cursor, …) — it will install and verify everything for you:
Set up the mem0-local-mcp memory server on this machine for me:
1. Ensure a local Qdrant is running on port 6333: run `curl -s http://localhost:6333/`.
If it is not running, start it with Docker:
docker run -d --name qdrant --restart always -p 6333:6333 -v ~/.qdrant_storage:/qdrant/storage qdrant/qdrant
If Docker is unavailable, download the Qdrant binary for my OS from
https://github.com/qdrant/qdrant/releases and run it.
2. Ensure `uv` is installed (`which uv`); if not, install it from https://docs.astral.sh/uv/.
3. Register the MCP server at user scope:
claude mcp add mem0 --scope user -- uvx --from git+https://github.com/sanchezvivi/mem0-local-mcp.git mem0-local-mcp
4. Verify with `claude mcp list` that `mem0` shows Connected. The first run downloads the
embedding model (~130 MB), so allow up to a minute.
5. Reads and infer=False writes need no API key. Only if I want infer=True (LLM) extraction,
confirm ANTHROPIC_API_KEY (or GOOGLE_API_KEY with MEM0_LLM_PROVIDER=gemini) is set in my
environment before launching the client. Then tell me it is ready.
Prerequisites
1. A running Qdrant (pick one):
# Docker
docker run -d --name qdrant -p 6333:6333 -v ~/.qdrant_storage:/qdrant/storage qdrant/qdrant
# or the binary (macOS/Linux release from https://github.com/qdrant/qdrant/releases)
./qdrant
2. uv to run the server (uvx), or pip install mem0-local-mcp.
The embedding model (~130 MB) downloads automatically on first use.
Install in Claude Code
claude mcp add mem0 --scope user -- \
uvx --from git+https://github.com/sanchezvivi/mem0-local-mcp.git mem0-local-mcp
For Gemini extraction, install the extra and select the provider:
claude mcp add mem0 --scope user \
--env MEM0_LLM_PROVIDER=gemini \
-- uvx --from "git+https://github.com/sanchezvivi/mem0-local-mcp.git#egg=mem0-local-mcp[gemini]" mem0-local-mcp
Other MCP clients
Any stdio MCP client can launch it. Example config entry:
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["--from", "git+https://github.com/sanchezvivi/mem0-local-mcp.git", "mem0-local-mcp"]
}
}
}
Configuration
All optional, with defaults:
| Variable | Default | Notes |
|---|---|---|
MEM0_USER_ID |
default_user |
Default scope when a tool call omits user_id. |
MEM0_LLM_PROVIDER |
anthropic |
anthropic or gemini. Only used for infer=True. |
MEM0_ANTHROPIC_MODEL |
claude-haiku-4-5 |
|
MEM0_GEMINI_MODEL |
gemini-2.5-flash |
Requires the gemini extra. |
MEM0_EMBED_MODEL |
BAAI/bge-small-en-v1.5 |
Any fastembed model. |
MEM0_EMBED_DIMS |
384 |
Must match the embed model. |
MEM0_QDRANT_HOST |
localhost |
|
MEM0_QDRANT_PORT |
6333 |
|
MEM0_COLLECTION |
mem0 |
|
ANTHROPIC_API_KEY |
— | Only needed for infer=True with Anthropic. |
GOOGLE_API_KEY |
— | Only needed for infer=True with Gemini. |
Keys are read from the process environment; nothing is written to disk by this server.
Local development
git clone https://github.com/sanchezvivi/mem0-local-mcp.git
cd mem0-local-mcp
uv venv && uv pip install -e ".[gemini]"
.venv/bin/mem0-local-mcp # stdio server
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。