mem0-open-mcp 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mem0-open-mcp
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Open-source MCP server for mem0 - local LLMs, self-hosted, Docker-free
5
5
  Author: Alex
6
6
  License-Expression: Apache-2.0
@@ -86,9 +86,6 @@ mem0-open-mcp test
86
86
  # Start the server
87
87
  mem0-open-mcp serve
88
88
 
89
- # Test and start server
90
- mem0-open-mcp serve --test
91
-
92
89
  # With options
93
90
  mem0-open-mcp serve --port 8765 --user-id alice
94
91
  ```
@@ -1,5 +1,5 @@
1
1
  mem0_server/__init__.py,sha256=FrcCqmcA_VSR57xjgdQ1obSrsSzxDsDsXdEGSdVhUq0,379
2
- mem0_server/cli.py,sha256=IcR7eTQjJvYVwENLctbNGd7Ej1AAtX3BekTIDbhdj5A,25962
2
+ mem0_server/cli.py,sha256=1ZWZIch8RIJJ6w-ffprvs0Fz9qg9AwVeLlYSm7M_sRU,27633
3
3
  mem0_server/server.py,sha256=Obc2eZaAYuZdUgYpOY8qWwbOXgc3w1vRmmEF3tc0gdI,12494
4
4
  mem0_server/api/__init__.py,sha256=JOOnrq3v7yym3xotMkOUAoZj1zjhI8C_a1wEdbpCakQ,122
5
5
  mem0_server/api/routes.py,sha256=fBOeQ1kckEa9Nr57cutCunhG9D1J5zYrv9sFiYcZ1yQ,21743
@@ -9,7 +9,7 @@ mem0_server/config/schema.py,sha256=HnFWUR4KxwHkyukFw_ptMCHt7K26Zl7AU02-5jdtjL4,
9
9
  mem0_server/mcp/__init__.py,sha256=8BWWjlJj5_jdeUuQFN4i5hm5Zd3Pk0cCR2Vf0G4eUB4,127
10
10
  mem0_server/mcp/server.py,sha256=Y_f8upEtvjr0JjZaUQ4YWLRrof9btR2ds8FL2DucCZI,184
11
11
  mem0_server/utils/__init__.py,sha256=GvVR3Tz4OmU2gRGCbTyQg5Xip5cAx7KW6ToIh2sKA4w,41
12
- mem0_open_mcp-0.1.5.dist-info/METADATA,sha256=aXza5vrdT6hLelN4pLFGGMfTwT-sl_R4UYjZ3epZ8Mg,4960
13
- mem0_open_mcp-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
- mem0_open_mcp-0.1.5.dist-info/entry_points.txt,sha256=WXqVdvwhFvMkzAmNtdlHlRZV23yikM43BtB8S4F9ByE,54
15
- mem0_open_mcp-0.1.5.dist-info/RECORD,,
12
+ mem0_open_mcp-0.1.7.dist-info/METADATA,sha256=IOtypdi-yunILO6wgrSEvZQ-b6mdZ0TWLx2QhTyu8qs,4908
13
+ mem0_open_mcp-0.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ mem0_open_mcp-0.1.7.dist-info/entry_points.txt,sha256=WXqVdvwhFvMkzAmNtdlHlRZV23yikM43BtB8S4F9ByE,54
15
+ mem0_open_mcp-0.1.7.dist-info/RECORD,,
mem0_server/cli.py CHANGED
@@ -76,6 +76,26 @@ def _check_for_updates() -> None:
76
76
  pass
77
77
 
78
78
 
79
+ def _model_matches(config_model: str, available_models: list[str]) -> bool:
80
+ """Check if configured model matches any available model.
81
+
82
+ Handles :latest suffix - 'llama3.2' matches 'llama3.2:latest'
83
+ """
84
+ config_lower = config_model.lower()
85
+ config_with_latest = f"{config_lower}:latest" if ":" not in config_lower else config_lower
86
+
87
+ for m in available_models:
88
+ m_lower = m.lower()
89
+ if config_lower == m_lower:
90
+ return True
91
+ if config_with_latest == m_lower:
92
+ return True
93
+ m_without_latest = m_lower.replace(":latest", "") if m_lower.endswith(":latest") else m_lower
94
+ if config_lower == m_without_latest:
95
+ return True
96
+ return False
97
+
98
+
79
99
  def _run_connectivity_tests(config: Mem0ServerConfig) -> bool:
80
100
  """Run connectivity tests for LLM, Embedder, and Vector Store."""
81
101
  console.print("[bold]Running connectivity tests...[/bold]\n")
@@ -117,7 +137,7 @@ def _run_connectivity_tests(config: Mem0ServerConfig) -> bool:
117
137
  resp = httpx.get(f"{base_url}/api/tags", timeout=5)
118
138
  resp.raise_for_status()
119
139
  models = [m["name"] for m in resp.json().get("models", [])]
120
- if llm_config.config.model in models or any(llm_config.config.model in m for m in models):
140
+ if _model_matches(llm_config.config.model, models):
121
141
  console.print(f"[green]✓ Connected ({llm_config.config.model})[/green]")
122
142
  else:
123
143
  console.print(f"[yellow]⚠ Connected but model '{llm_config.config.model}' not found[/yellow]")
@@ -147,7 +167,7 @@ def _run_connectivity_tests(config: Mem0ServerConfig) -> bool:
147
167
  resp = httpx.get(f"{base_url}/api/tags", timeout=5)
148
168
  resp.raise_for_status()
149
169
  models = [m["name"] for m in resp.json().get("models", [])]
150
- if emb_config.config.model in models or any(emb_config.config.model in m for m in models):
170
+ if _model_matches(emb_config.config.model, models):
151
171
  console.print(f"[green]✓ Connected ({emb_config.config.model})[/green]")
152
172
  else:
153
173
  console.print(f"[yellow]⚠ Connected but model '{emb_config.config.model}' not found[/yellow]")
@@ -178,6 +198,7 @@ def _run_connectivity_tests(config: Mem0ServerConfig) -> bool:
178
198
 
179
199
  def _run_memory_tests(config: Mem0ServerConfig) -> bool:
180
200
  """Run actual mem0 memory add/search tests."""
201
+ import os
181
202
  import uuid
182
203
  console.print("[bold]Running memory tests...[/bold]\n")
183
204
 
@@ -186,13 +207,16 @@ def _run_memory_tests(config: Mem0ServerConfig) -> bool:
186
207
 
187
208
  try:
188
209
  console.print(" [dim]Initializing mem0 client...[/dim]", end=" ")
210
+ os.environ["MEM0_TELEMETRY"] = "false"
189
211
  from mem0 import Memory
190
212
  mem0_config = config.to_mem0_config()
191
213
  memory = Memory.from_config(mem0_config)
192
214
  console.print("[green]✓[/green]")
193
215
 
194
- console.print(" [dim]Adding test memory...[/dim]", end=" ")
216
+ # 1. Add memory
217
+ console.print(" [dim]1. Adding test memory...[/dim]", end=" ")
195
218
  add_result = memory.add(test_memory_text, user_id=test_user_id)
219
+ memory_id = None
196
220
  if add_result and add_result.get("results"):
197
221
  first_result = add_result["results"][0]
198
222
  memory_id = first_result.get("id") if first_result else None
@@ -203,14 +227,40 @@ def _run_memory_tests(config: Mem0ServerConfig) -> bool:
203
227
  else:
204
228
  console.print("[green]✓ Added[/green]")
205
229
 
206
- console.print(" [dim]Searching memories...[/dim]", end=" ")
230
+ # 2. List memories
231
+ console.print(" [dim]2. Listing memories...[/dim]", end=" ")
232
+ list_result = memory.get_all(user_id=test_user_id)
233
+ if list_result and list_result.get("results"):
234
+ stored_count = len(list_result["results"])
235
+ console.print(f"[green]✓ Found {stored_count} memory(s)[/green]")
236
+ # Get memory_id from list if not captured from add
237
+ if not memory_id and stored_count > 0:
238
+ memory_id = list_result["results"][0].get("id")
239
+ else:
240
+ console.print("[red]✗ Memory not stored[/red]")
241
+ return False
242
+
243
+ # 3. Search memories
244
+ console.print(" [dim]3. Searching memories...[/dim]", end=" ")
207
245
  search_result = memory.search("test memory verification", user_id=test_user_id, limit=5)
208
246
  if search_result and search_result.get("results"):
209
247
  console.print(f"[green]✓ Found {len(search_result['results'])} result(s)[/green]")
210
248
  else:
211
- console.print("[yellow]⚠ No results (may be expected for new setup)[/yellow]")
249
+ console.print("[yellow]⚠ No search results (indexing may be delayed)[/yellow]")
212
250
 
213
- console.print(" [dim]Cleaning up test data...[/dim]", end=" ")
251
+ # 4. Delete single memory
252
+ console.print(" [dim]4. Deleting single memory...[/dim]", end=" ")
253
+ if memory_id:
254
+ delete_result = memory.delete(memory_id)
255
+ if delete_result and delete_result.get("message"):
256
+ console.print(f"[green]✓ Deleted (id: {memory_id[:8]}...)[/green]")
257
+ else:
258
+ console.print("[green]✓ Deleted[/green]")
259
+ else:
260
+ console.print("[yellow]⚠ Skipped (no memory_id)[/yellow]")
261
+
262
+ # 5. Cleanup remaining test data
263
+ console.print(" [dim]5. Cleaning up test data...[/dim]", end=" ")
214
264
  memory.delete_all(user_id=test_user_id)
215
265
  console.print("[green]✓ Cleaned[/green]")
216
266
 
@@ -278,10 +328,6 @@ def serve(
278
328
  str,
279
329
  typer.Option("--log-level", "-l", help="Logging level."),
280
330
  ] = "info",
281
- test: Annotated[
282
- bool,
283
- typer.Option("--test", "-t", help="Run connectivity tests before starting server."),
284
- ] = False,
285
331
  ) -> None:
286
332
  """Start the MCP server.
287
333
 
@@ -330,12 +376,6 @@ def serve(
330
376
  console.print(f" Vector Store: [cyan]{config.vector_store.provider.value}[/cyan]")
331
377
  console.print()
332
378
 
333
- if test:
334
- if not _run_connectivity_tests(config):
335
- raise typer.Exit(1)
336
- if not _run_memory_tests(config):
337
- raise typer.Exit(1)
338
-
339
379
  # Start the server
340
380
  try:
341
381
  from mem0_server.server import run_server