Skip to main content
Glama

mem0-mcp

License: MIT

A small MCP server that wraps a self-hosted mem0 REST API (see ../server-compose-files/ai-containers) as tools for Claude Desktop / Claude Code. Mem0's own official MCP integrations (mcp.mem0.ai, the archived mem0-mcp-server package) only target Mem0's cloud API — different auth scheme (Authorization: Token ... vs. this server's X-API-Key) and different routes — so they don't work against a self-hosted instance. This wraps the self-hosted REST API directly instead.

Tools

Tool

mem0 endpoint

add_memory

POST /memories

search_memories

POST /search

list_memories

GET /memories

get_memory

GET /memories/{id}

update_memory

PUT /memories/{id}

delete_memory

DELETE /memories/{id}

Bulk operations (delete_all_memories, /reset) are intentionally not exposed — keeps the blast radius of an LLM-driven tool call small. Use curl directly against the API for those.

Related MCP server: zime-memory

Setup

Requires an API key from the mem0 dashboard (/setup on first run, or the API Keys page after) and the URL your machine can reach the mem0 API at.

Add to Claude Desktop's config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS). Two ways to run it, depending on whether you've cloned the repo:

Without cloning, straight from GitHub — same uvx --from git+... pattern other MCP servers use to run from a repo without publishing to PyPI first:

uvx --from git+https://github.com/andresmorales07/mem0-mcp mem0-mcp
{
  "mcpServers": {
    "mem0": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/andresmorales07/mem0-mcp", "mem0-mcp"],
      "env": {
        "MEM0_API_URL": "http://your-mem0-host:8888",
        "MEM0_API_KEY": "m0sk_...",
        "MEM0_DEFAULT_USER_ID": "your-user-id",
        "MEM0_DEFAULT_AGENT_ID": "claude-desktop"
      }
    }
  }
}

Prefer to pin to a released version instead of tracking main? Append a ref, e.g. git+https://github.com/andresmorales07/mem0-mcp@v0.1.0.

From a local clone:

{
  "mcpServers": {
    "mem0": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/mem0-mcp", "mem0-mcp"],
      "env": {
        "MEM0_API_URL": "http://your-mem0-host:8888",
        "MEM0_API_KEY": "m0sk_...",
        "MEM0_DEFAULT_USER_ID": "your-user-id",
        "MEM0_DEFAULT_AGENT_ID": "claude-desktop"
      }
    }
  }
}

Use the full path to uv/uvx (e.g. which uv) if Claude Desktop can't find them on its own PATH.

Both default env vars are optional, and they behave differently:

  • MEM0_DEFAULT_USER_ID is a last-resort fallback — only used when a tool call supplies no user_id, agent_id, or run_id at all. Applies to both reads and writes.

  • MEM0_DEFAULT_AGENT_ID is merged in only on add_memory (unless that call passes its own agent_id), tagging every memory this server writes with which client created it — useful if you ever point another tool (n8n, a different agent) at the same mem0 instance and want to tell them apart later.

    It's deliberately not applied to search_memories/list_memories. MCP tool calls can't distinguish "no agent_id given" from "search across all agents," so auto-tagging reads would silently and permanently scope every query to just this one agent — making it impossible to ever ask "show me everything anyone has learned about me" again. Reads default to whatever user_id/agent_id/run_id the model explicitly passes (plus the MEM0_DEFAULT_USER_ID fallback above); pass agent_id explicitly on a read if you want to narrow it to one agent's memories.

Restart Claude Desktop after editing the config. Claude will prompt for permission the first time it calls one of these tools.

Manual test

MEM0_API_URL=http://your-mem0-host:8888 MEM0_API_KEY=m0sk_... uv run python -c "
from mem0_mcp.server import list_memories
print(list_memories(user_id='alice'))
"

Available Tools

6 tools
add_memoryA

Store a new memory. Provide at least one of user_id, agent_id, or run_id to scope it; if none are given, falls back to MEM0_DEFAULT_USER_ID. Tagged with MEM0_DEFAULT_AGENT_ID unless agent_id is given explicitly.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYes
run_idNo
user_idNo
agent_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It discloses fallback to MEM0_DEFAULT_USER_ID and tagging with MEM0_DEFAULT_AGENT_ID unless overridden, providing useful behavioral details beyond what the schema shows. It doesn't mention permissions or side effects, but for a create operation this is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, the first a clear one-line summary, followed by two purpose-specific sentences on scoping and defaults. No filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is a simple creation operation with an output schema. The description covers all behavioral nuances (default IDs, scoping), making it complete for an agent to decide when and how to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does: it explains that user_id, agent_id, and run_id are for scoping, and that agent_id defaults to MEM0_DEFAULT_AGENT_ID. This gives semantic meaning to all optional parameters, though text is self-evident.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Store a new memory,' a specific verb+resource pairing that clearly distinguishes it from sibling tools like update_memory or delete_memory. It also hints at scoping semantics, reinforcing the 'add' operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear operational context: it explains the scoping requirements ('Provide at least one of user_id, agent_id, or run_id') and default behaviors. It doesn't compare to list/get/update/delete, so it lacks explicit when-not-to-use guidance, but the usage context is solid.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_memoryA

Delete a single memory by its id. Confirm the memory_id with the user first if it wasn't just returned by another tool call.

ParametersJSON Schema
NameRequiredDescriptionDefault
memory_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the deletion action and adds a crucial confirmation requirement, implying irreversibility. However, it doesn't disclose side effects, permission requirements, or error conditions beyond the core delete behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the action, no extraneous information. The confirmation instruction earns its place and is directly actionable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple deletion tool with a single parameter and an output schema, the description covers the essential action and a key usage guideline. It could mention the irreversible nature or what the response contains, but overall it's sufficiently complete for most use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions 'by its id', which maps to the memory_id parameter, clarifying its purpose. However, it doesn't provide format details or source guidance beyond the confirmation hint. With only one parameter, the description adds some meaning over the schema but doesn't fully compensate for the 0% schema description coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete'), the resource ('a single memory'), and the scope ('by its id'). This distinguishes it from siblings like list_memories, get_memory, and update_memory, leaving no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit usage guideline: confirm the memory_id with the user first unless it was just returned by another tool call. This clarifies when it's appropriate to call the tool and implies a safety check. However, it doesn't explicitly mention alternatives (e.g., use update_memory for modifications) or when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_memoryA

Retrieve a single memory by its id.

ParametersJSON Schema
NameRequiredDescriptionDefault
memory_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden for behavioral disclosure. It clearly indicates this is a read operation ('retrieve') but does not mention edge cases like not-found behavior, return format, or error handling. For a simple get-by-id tool, this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that is front-loaded with the verb and noun. Every word earns its place, with no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one parameter, no nested objects) and has an output schema, so the description does not need to explain return values. It adequately names the action and target, though it lacks explicit usage guidance. For its complexity, the description is largely complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The phrase 'by its id' connects the memory_id parameter to its purpose, but it does not elaborate on format, constraints, or behavior if missing. The parameter name and schema do most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'retrieve' with the resource 'a single memory' and identifies the unique identifier ('by its id'). This clearly distinguishes it from siblings like list_memories (plural) and search_memories (query-based).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a memory ID, contrasting with list/search for broader queries. However, it does not explicitly state when to prefer this over alternatives or exclude cases like retrieving multiple memories.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_memoriesA

List stored memories for a given user_id/agent_id/run_id.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_kNo
run_idNo
user_idNo
agent_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states the action without disclosing whether it is read-only, what the response format looks like, whether pagination applies, or any rate limits. The word 'list' implies a read operation, but details are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant words. Every word contributes to the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values are presumably covered there. However, the description leaves gaps around how filters combine (AND/OR), the meaning of top_k, and ordering of results. Adequate but not complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It clarifies that user_id, agent_id, and run_id are filters, but top_k is not mentioned. This partial compensation justifies a mid-range score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('list') and resource ('stored memories') with a clear scope ('for a given user_id/agent_id/run_id'). This differentiates it from siblings like get_memory (single retrieval) and search_memories (query-based).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'List stored memories' implies when to use it (when you need to retrieve all memories matching given IDs), but there is no explicit guidance on when to prefer this over search_memories or get_memory, nor any exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_memoriesB

Semantic search over stored memories, scoped to a user_id/agent_id/run_id.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
run_idNo
user_idNo
agent_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions scoping but does not clarify read-only nature, result ordering, behavior when no matches found, or any limitations. The description adds little beyond the schema's parameter names, leaving significant behavioral uncertainty.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It immediately states the core purpose and then adds the scoping detail, making it easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a tool with 5 parameters (1 required) and no annotations or parameter descriptions in the schema, the description is too brief. It does not cover the meaning of top_k, the importance of query, or how scoping interacts with the search. Although an output schema exists, the description still needs to explain the input parameters and usage context, which it fails to do.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. The phrase 'scoped to user_id/agent_id/run_id' adds meaning by indicating these are filtering parameters, and 'semantic search' implies query is the search text. However, top_k and the optionality of scope parameters are not explained, leaving gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as a semantic search over stored memories, using a specific verb and resource. It also explicitly mentions scoping by user_id/agent_id/run_id, which distinguishes it from sibling tools like list_memories (non-semantic listing) and get_memory (single retrieval).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for semantic search within a scope but does not explicitly state when to use this tool versus alternatives like list_memories or get_memory. There is no mention of exclusions or alternative tools, so guidance is only implied, not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

update_memoryA

Update an existing memory's text and/or metadata. Confirm the memory_id with the user first if it wasn't just returned by another tool call.

ParametersJSON Schema
NameRequiredDescriptionDefault
textNo
metadataNo
memory_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It does disclose that updates are partial ('text and/or metadata') and implies existing resource, but omits details like merge/replace semantics for metadata, error handling for nonexistent IDs, or permission requirements. The confirmation guideline adds some transparency but isn't a behavioral trait.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the primary action. The second sentence delivers an important usage instruction. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 3-parameter update tool with an output schema, the description covers purpose, usage, and parameter roles. The main gap is unclear metadata semantics (merge vs replace), which is significant for an update operation. Overall adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It names the text and metadata fields and their optionality via 'and/or', and mentions memory_id in the confirmation guidance. However, it doesn't explain the format of metadata or the precise effect of each parameter beyond the schema's type information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb+resource combination ('Update an existing memory's text and/or metadata'), which makes the tool's function unambiguous and distinguishes it from sibling tools like add_memory, delete_memory, or list_memories.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly indicates when to use it (for updating an existing memory) and includes a practical instruction to confirm memory_id with the user if not just obtained from another call. However, it doesn't explicitly mention alternatives or when not to use this tool, so it's clear but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedadd_memory
    • First observeddelete_memory
    • First observedget_memory
    • First observedlist_memories
    • First observedsearch_memories
    • First observedupdate_memory

TDQS

A4.1/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: list, get, add, search, update, and delete memories. There is no functional overlap; even get vs list are differentiated by retrieval method (by ID vs. enumeration).

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (list_, get_, add_, search_, update_, delete_). Minor singular/plural variation (memory vs memories) is natural and does not affect predictability.

Tool Count5/5

With 6 tools, the server is well-scoped for a memory management system. Each tool covers a necessary operation without redundancy or bloat.

Completeness5/5

The tool set provides full CRUD coverage (add, get, update, delete) plus list and semantic search. There are no missing lifecycle operations for the stated purpose.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers