mem0-open-mcp 0.1.4__tar.gz → 0.1.6__tar.gz

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.
Files changed (23) hide show
  1. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/PKG-INFO +5 -5
  2. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/README.md +4 -4
  3. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/pyproject.toml +1 -1
  4. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/cli.py +64 -12
  5. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/.env.example +0 -0
  6. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/.github/workflows/publish.yml +0 -0
  7. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/.gitignore +0 -0
  8. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/Dockerfile +0 -0
  9. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/docker-compose.yaml +0 -0
  10. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/examples/ollama-config.yaml +0 -0
  11. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/mem0-open-mcp.example.yaml +0 -0
  12. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/__init__.py +0 -0
  13. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/api/__init__.py +0 -0
  14. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/api/routes.py +0 -0
  15. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/config/__init__.py +0 -0
  16. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/config/loader.py +0 -0
  17. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/config/schema.py +0 -0
  18. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/mcp/__init__.py +0 -0
  19. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/mcp/server.py +0 -0
  20. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/server.py +0 -0
  21. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/src/mem0_server/utils/__init__.py +0 -0
  22. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/tests/test_api.py +0 -0
  23. {mem0_open_mcp-0.1.4 → mem0_open_mcp-0.1.6}/tests/test_config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mem0-open-mcp
3
- Version: 0.1.4
3
+ Version: 0.1.6
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
@@ -80,17 +80,17 @@ mem0-open-mcp init
80
80
  # Interactive configuration wizard
81
81
  mem0-open-mcp configure
82
82
 
83
+ # Test configuration (recommended for initial setup)
84
+ mem0-open-mcp test
85
+
83
86
  # Start the server
84
87
  mem0-open-mcp serve
85
88
 
86
- # Test configuration before starting (recommended for initial setup)
87
- mem0-open-mcp serve --test
88
-
89
89
  # With options
90
90
  mem0-open-mcp serve --port 8765 --user-id alice
91
91
  ```
92
92
 
93
- The `--test` flag runs connectivity and memory tests before starting the server:
93
+ The `test` command verifies your configuration without starting the server:
94
94
  - Checks Vector Store, LLM, and Embedder connections
95
95
  - Performs actual memory add/search operations
96
96
  - Cleans up test data automatically
@@ -39,17 +39,17 @@ mem0-open-mcp init
39
39
  # Interactive configuration wizard
40
40
  mem0-open-mcp configure
41
41
 
42
+ # Test configuration (recommended for initial setup)
43
+ mem0-open-mcp test
44
+
42
45
  # Start the server
43
46
  mem0-open-mcp serve
44
47
 
45
- # Test configuration before starting (recommended for initial setup)
46
- mem0-open-mcp serve --test
47
-
48
48
  # With options
49
49
  mem0-open-mcp serve --port 8765 --user-id alice
50
50
  ```
51
51
 
52
- The `--test` flag runs connectivity and memory tests before starting the server:
52
+ The `test` command verifies your configuration without starting the server:
53
53
  - Checks Vector Store, LLM, and Embedder connections
54
54
  - Performs actual memory add/search operations
55
55
  - Cleans up test data automatically
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mem0-open-mcp"
3
- version = "0.1.4"
3
+ version = "0.1.6"
4
4
  description = "Open-source MCP server for mem0 - local LLMs, self-hosted, Docker-free"
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -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,6 +207,7 @@ 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)
@@ -278,10 +300,6 @@ def serve(
278
300
  str,
279
301
  typer.Option("--log-level", "-l", help="Logging level."),
280
302
  ] = "info",
281
- test: Annotated[
282
- bool,
283
- typer.Option("--test", "-t", help="Run connectivity tests before starting server."),
284
- ] = False,
285
303
  ) -> None:
286
304
  """Start the MCP server.
287
305
 
@@ -330,12 +348,6 @@ def serve(
330
348
  console.print(f" Vector Store: [cyan]{config.vector_store.provider.value}[/cyan]")
331
349
  console.print()
332
350
 
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
351
  # Start the server
340
352
  try:
341
353
  from mem0_server.server import run_server
@@ -349,6 +361,46 @@ def serve(
349
361
  raise typer.Exit(1) from None
350
362
 
351
363
 
364
+ @app.command()
365
+ def test(
366
+ config_file: Annotated[
367
+ Path | None,
368
+ typer.Option(
369
+ "--config", "-c",
370
+ help="Path to configuration file (YAML or JSON).",
371
+ exists=True,
372
+ ),
373
+ ] = None,
374
+ ) -> None:
375
+ """Test connectivity and memory operations without starting server.
376
+
377
+ Examples:
378
+ mem0-open-mcp test
379
+ mem0-open-mcp test --config ./my-config.yaml
380
+ """
381
+ loader = ConfigLoader(config_file)
382
+ config = loader.load()
383
+
384
+ console.print(Panel.fit(
385
+ f"[bold green]mem0-open-mcp[/bold green] v{__version__}\n"
386
+ f"[dim]Configuration Test[/dim]",
387
+ border_style="green",
388
+ ))
389
+
390
+ console.print("\n[bold]Configuration:[/bold]")
391
+ console.print(f" LLM: [cyan]{config.llm.provider.value}[/cyan] / {config.llm.config.model}")
392
+ console.print(f" Embedder: [cyan]{config.embedder.provider.value}[/cyan] / {config.embedder.config.model}")
393
+ console.print(f" Vector Store: [cyan]{config.vector_store.provider.value}[/cyan]")
394
+ console.print()
395
+
396
+ if not _run_connectivity_tests(config):
397
+ raise typer.Exit(1)
398
+ if not _run_memory_tests(config):
399
+ raise typer.Exit(1)
400
+
401
+ console.print("[bold green]All tests passed! Configuration is ready.[/bold green]")
402
+
403
+
352
404
  @app.command()
353
405
  def configure(
354
406
  config_file: Annotated[
File without changes
File without changes