From a35fc5347d16c172580238e96ba5ab1f8dd35351 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Tue, 10 Mar 2026 12:54:05 -0500 Subject: [PATCH 1/3] Fix project list MCP column to show transport type Rename "MCP (stdio)" column to "MCP" and show actual transport type (stdio/https) based on project routing mode instead of just checking whether a local DB entry exists. Clear local path display for cloud-mode projects since they route through the cloud API. Fixes #659 Co-Authored-By: Claude Opus 4.6 Signed-off-by: Drew Cain --- src/basic_memory/cli/commands/project.py | 15 +++++++++++++-- tests/cli/test_project_list_and_ls.py | 5 +++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/basic_memory/cli/commands/project.py b/src/basic_memory/cli/commands/project.py index a6d39bf2..22d7e572 100644 --- a/src/basic_memory/cli/commands/project.py +++ b/src/basic_memory/cli/commands/project.py @@ -128,7 +128,7 @@ async def _list_projects(ws: str | None = None): table.add_column("Cloud Path", style="green") table.add_column("Workspace", style="green") table.add_column("CLI Route", style="blue") - table.add_column("MCP (stdio)", style="blue") + table.add_column("MCP", style="blue") table.add_column("Sync", style="green") table.add_column("Default", style="magenta") @@ -164,6 +164,11 @@ async def _list_projects(ws: str | None = None): elif entry and entry.mode == ProjectMode.LOCAL and entry.path: local_path = format_path(normalize_project_path(entry.path)) + # Clear local path for cloud-mode projects — only local projects + # should display a local path + if entry and entry.mode == ProjectMode.CLOUD: + local_path = "" + cloud_path = "" if cloud_project is not None: cloud_path = normalize_project_path(cloud_project.path) @@ -182,7 +187,13 @@ async def _list_projects(ws: str | None = None): is_default = config.default_project == project_name has_sync = bool(entry and entry.local_sync_path) - mcp_stdio_target = "local" if local_project is not None else "n/a" + # Determine MCP transport based on project routing mode + if entry and entry.mode == ProjectMode.CLOUD: + mcp_stdio_target = "https" + elif cloud_project is not None and local_project is None: + mcp_stdio_target = "https" + else: + mcp_stdio_target = "stdio" # Show workspace name (type) for cloud-sourced projects ws_label = "" diff --git a/tests/cli/test_project_list_and_ls.py b/tests/cli/test_project_list_and_ls.py index be9f583d..ed49b038 100644 --- a/tests/cli/test_project_list_and_ls.py +++ b/tests/cli/test_project_list_and_ls.py @@ -122,15 +122,16 @@ async def fake_list_projects(self): assert "Local Path" in result.stdout assert "Cloud Path" in result.stdout assert "CLI Route" in result.stdout - assert "MCP (stdio)" in result.stdout + assert "MCP" in result.stdout lines = result.stdout.splitlines() alpha_line = next(line for line in lines if "│ alpha" in line) beta_line = next(line for line in lines if "│ beta" in line) assert "local" in alpha_line # CLI route for alpha + assert "stdio" in alpha_line # Local projects use stdio transport assert "cloud" in beta_line # CLI route for beta - assert "n/a" in beta_line # MCP stdio route is unavailable for cloud-only projects + assert "https" in beta_line # Cloud projects use HTTPS transport assert "alpha-local" in result.stdout assert "/alpha" in result.stdout assert "/beta" in result.stdout From f2fd83f726ad3a39f2428ad5af474ca9f20059f8 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Tue, 10 Mar 2026 13:07:07 -0500 Subject: [PATCH 2/3] Rename mcp_stdio_target variable to mcp_transport Follow-up from review: the variable now holds "https" or "stdio", so the old name was misleading. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Drew Cain --- src/basic_memory/cli/commands/project.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/basic_memory/cli/commands/project.py b/src/basic_memory/cli/commands/project.py index 22d7e572..0a2d3a74 100644 --- a/src/basic_memory/cli/commands/project.py +++ b/src/basic_memory/cli/commands/project.py @@ -189,11 +189,11 @@ async def _list_projects(ws: str | None = None): has_sync = bool(entry and entry.local_sync_path) # Determine MCP transport based on project routing mode if entry and entry.mode == ProjectMode.CLOUD: - mcp_stdio_target = "https" + mcp_transport = "https" elif cloud_project is not None and local_project is None: - mcp_stdio_target = "https" + mcp_transport = "https" else: - mcp_stdio_target = "stdio" + mcp_transport = "stdio" # Show workspace name (type) for cloud-sourced projects ws_label = "" @@ -206,7 +206,7 @@ async def _list_projects(ws: str | None = None): "local_path": local_path, "cloud_path": cloud_path, "cli_route": cli_route, - "mcp_stdio": mcp_stdio_target, + "mcp_stdio": mcp_transport, "sync": has_sync, "is_default": is_default, } From f8856f71a40621796d1720b9205dc3800edc8921 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Tue, 10 Mar 2026 20:53:46 -0500 Subject: [PATCH 3/3] Gate HTTPS fallback on missing project config entry Only fall back to HTTPS transport for projects that have no local config entry at all. Previously a local-mode project that also existed in the cloud list could be mislabeled as HTTPS. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Drew Cain --- src/basic_memory/cli/commands/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic_memory/cli/commands/project.py b/src/basic_memory/cli/commands/project.py index 0a2d3a74..99c716bb 100644 --- a/src/basic_memory/cli/commands/project.py +++ b/src/basic_memory/cli/commands/project.py @@ -190,7 +190,7 @@ async def _list_projects(ws: str | None = None): # Determine MCP transport based on project routing mode if entry and entry.mode == ProjectMode.CLOUD: mcp_transport = "https" - elif cloud_project is not None and local_project is None: + elif entry is None and cloud_project is not None: mcp_transport = "https" else: mcp_transport = "stdio"