Skip to content

Commit bd4f551

Browse files
authored
fix: Problems with MCP #190 (#202)
Signed-off-by: Drew Cain <groksrc@gmail.com>
1 parent 5360005 commit bd4f551

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/basic_memory/mcp/tools/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
from basic_memory.mcp.tools.move_note import move_note
2121
from basic_memory.mcp.tools.sync_status import sync_status
2222
from basic_memory.mcp.tools.project_management import (
23-
list_projects,
23+
list_memory_projects,
2424
switch_project,
2525
get_current_project,
2626
set_default_project,
27-
create_project,
27+
create_memory_project,
2828
delete_project,
2929
)
3030

3131
__all__ = [
3232
"build_context",
3333
"canvas",
34-
"create_project",
34+
"create_memory_project",
3535
"delete_note",
3636
"delete_project",
3737
"edit_note",
3838
"get_current_project",
3939
"list_directory",
40-
"list_projects",
40+
"list_memory_projects",
4141
"move_note",
4242
"read_content",
4343
"read_note",

src/basic_memory/mcp/tools/project_management.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@mcp.tool("list_memory_projects")
22-
async def list_projects(ctx: Context | None = None) -> str:
22+
async def list_memory_projects(ctx: Context | None = None) -> str:
2323
"""List all available projects with their status.
2424
2525
Shows all Basic Memory projects that are available, indicating which one
@@ -29,7 +29,7 @@ async def list_projects(ctx: Context | None = None) -> str:
2929
Formatted list of projects with status indicators
3030
3131
Example:
32-
list_projects()
32+
list_memory_projects()
3333
"""
3434
if ctx: # pragma: no cover
3535
await ctx.info("Listing all available projects")
@@ -144,13 +144,13 @@ async def switch_project(project_name: str, ctx: Context | None = None) -> str:
144144
Your session remains on the previous project.
145145
146146
## Troubleshooting:
147-
1. **Check available projects**: Use `list_projects()` to see valid project names
147+
1. **Check available projects**: Use `list_memory_projects()` to see valid project names
148148
2. **Verify spelling**: Ensure the project name is spelled correctly
149149
3. **Check permissions**: Verify you have access to the requested project
150150
4. **Try again**: The error might be temporary
151151
152152
## Available options:
153-
- See all projects: `list_projects()`
153+
- See all projects: `list_memory_projects()`
154154
- Stay on current project: `get_current_project()`
155155
- Try different project: `switch_project("correct-project-name")`
156156
@@ -231,7 +231,7 @@ async def set_default_project(project_name: str, ctx: Context | None = None) ->
231231

232232

233233
@mcp.tool("create_memory_project")
234-
async def create_project(
234+
async def create_memory_project(
235235
project_name: str, project_path: str, set_default: bool = False, ctx: Context | None = None
236236
) -> str:
237237
"""Create a new Basic Memory project.
@@ -248,8 +248,8 @@ async def create_project(
248248
Confirmation message with project details
249249
250250
Example:
251-
create_project("my-research", "~/Documents/research")
252-
create_project("work-notes", "/home/user/work", set_default=True)
251+
create_memory_project("my-research", "~/Documents/research")
252+
create_memory_project("work-notes", "/home/user/work", set_default=True)
253253
"""
254254
if ctx: # pragma: no cover
255255
await ctx.info(f"Creating project: {project_name} at {project_path}")

tests/mcp/test_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_create_auth_config_supabase_provider_missing_anon_key(self):
9393
# Missing SUPABASE_ANON_KEY
9494
}
9595

96-
with patch.dict(os.environ, env_vars):
96+
with patch.dict(os.environ, env_vars, clear=True):
9797
with pytest.raises(ValueError, match="SUPABASE_URL and SUPABASE_ANON_KEY must be set"):
9898
create_auth_config()
9999

0 commit comments

Comments
 (0)