mem0-mcp: Instructions file for Claude Code

CLAUDE.md

mem0-mcp CLAUDE.md is an instructions file for Claude Code from andresmorales07/mem0-mcp. It costs 905 tokens per session, scanned A, original, MIT.

A small MCP server that connects Claude Desktop or Claude Code to a self-hosted Mem0 memory service. Mem0 is a service for storing and retrieving information for AI assistants; this server uses a privately hosted instance rather than Mem0's cloud API.

In plain words
What is it for?
Use it to run the mem0-mcp command and test operations such as listing memories for a user through a configured Mem0 instance.
Why use it?
It lets these clients use a self-hosted memory system when the official integrations only support Mem0's cloud service.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is andresmorales07/mem0-mcp's own configuration. It tells Claude Code how to work on mem0-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mem0-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to andresmorales07/mem0-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/andresmorales07/mem0-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/andresmorales07/mem0-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mem0-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/andresmorales07/mem0-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/andresmorales07/mem0-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/andresmorales07/mem0-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/andresmorales07/mem0-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mem0-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/andresmorales07/mem0-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/andresmorales07/mem0-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 905 This file is loaded in full into every session.
When invoked 905 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00905 $0.00905
Opus 5 $0.00452 $0.00452
Sonnet 5 $0.00181 $0.00181
Haiku 4.5 $0.00090 $0.00090

Measured 10d ago against content hash 64b01b32b125, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mem0-mcp CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

the blast radius of an LLM-driven tool call small — use `curl` directly against the API for
CLAUDE.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

A single-tool-module MCP server (src/mem0_mcp/server.py) that wraps a self-hosted mem0 REST API as tools for Claude Desktop / Claude Code. Mem0's official MCP integrations only target Mem0's cloud API (different auth header, different routes), so this exists to talk to a self-hosted instance instead (see the sibling ../server-compose-files/ai-containers repo for that deployment).

Packaged as an installable console script (mem0-mcp, via [project.scripts] in pyproject.toml) rather than a loose script, so it can be run the way most MCP servers are — uvx --from git+<repo-url> mem0-mcp without cloning, or uv run --directory <path> mem0-mcp from a local clone.

Commands

uv sync                      # install dependencies into .venv
uv run mem0-mcp               # run the MCP server directly (stdio transport)

# Manual smoke test against a running mem0 instance:
MEM0_API_URL=http://dockerhost.home:8888 MEM0_API_KEY=m0sk_... uv run python -c "
from mem0_mcp.server import list_memories
print(list_memories(user_id='alice'))
"

There is no test suite, linter, or build step configured — verification is the manual smoke test above, or exercising the tools through Claude Desktop/Code directly.

Required env vars (server raises RuntimeError at import time if missing):

  • MEM0_API_URL — base URL of the self-hosted mem0 API
  • MEM0_API_KEY — an m0sk_... key from the mem0 dashboard

Optional env vars: MEM0_DEFAULT_USER_ID, MEM0_DEFAULT_AGENT_ID (see scoping rules below).

Architecture

Everything lives in src/mem0_mcp/server.py: an httpx.Client configured with the mem0 API's X-API-Key auth, wrapped by FastMCP tool functions that each map 1:1 to a mem0 REST endpoint (add_memoryPOST /memories, search_memoriesPOST /search, etc.). Bulk-delete endpoints (delete_all_memories, /reset) are intentionally not exposed as tools, to keep the blast radius of an LLM-driven tool call small — use curl directly against the API for those.

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 68 lines · 905 tokens per session scan A 64b01b32b125

Subscribe to this mod's changes

mem0-mcp CLAUDE.md is an instructions file published in the GitHub repository andresmorales07/mem0-mcp (1 stars, last pushed 2mo ago), licensed MIT. It adds 905 tokens to every session, about $0.0045 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories