Repository navigation
Description
Summary
create_memory_project doesn't accept a workspace_id parameter, so MCP callers can only create projects in the workspace their connection is scoped to (typically the default workspace).
Context
PR #777 (basic-memory) removed the workspace parameter from MCP tools and introduced project_id (external_id UUID) for cross-workspace targeting on tools that operate on existing projects (read_note, write_note, search_notes, recent_activity, etc.).
But create_memory_project is the chicken-and-egg case: there's no project to address by project_id because the project doesn't exist yet. Today, the only way to create a project in a non-default workspace is to reconnect the MCP client with ?workspace_id=<tenant_id> on the URL — which most clients can't easily do mid-session.
Current Behavior
async def create_memory_project(
project_name: str,
project_path: str,
set_default: bool = False,
output_format: Literal[\"text\", \"json\"] = \"text\",
context: Context | None = None,
) -> str | dict:
...
async with get_client() as client: # No workspace passed
project_client = ProjectClient(client)get_client() is called without a workspace argument, so the cloud factory routes to the connection's default workspace.
Proposed Fix
Add an optional workspace_id parameter to create_memory_project:
async def create_memory_project(
project_name: str,
project_path: str,
set_default: bool = False,
workspace_id: Optional[str] = None,
output_format: Literal[\"text\", \"json\"] = \"text\",
context: Context | None = None,
) -> str | dict:
...
async with get_client(workspace=workspace_id) as client:
...Callers can discover available workspace_id values via list_workspaces (returns tenant_id for each workspace). When workspace_id is omitted, behavior is unchanged (defaults to connection's workspace).
Related
- basic-memory PR fix(mcp): resolve projects by external_id, remove workspace from MCP tools #777 (workspace removal, project_id introduction)
- basic-memory-cloud Auto-write
created/modifiedfrontmatter on BM-owned writes #684 (list_memory_projects multi-workspace fix)
Activity
claude commentedon May 3, 2026
Claude finished @phernandez's task in 3m 29s —— View job •
claude/issue-788-20260503-1511• Create PR ➔Triage & Implementation
Type: Enhancement — MCP tool improvement
Priority: Medium
Component: MCP tools, Cloud
Complexity: Simple
create_memory_projectimplementationworkspace_idparameter and pass toget_client()Changes
src/basic_memory/mcp/tools/project_management.pyAdded
workspace_id: str | None = Noneparameter tocreate_memory_projectand forwarded it asworkspace=workspace_idtoget_client(). When omitted, behaviour is unchanged — the connection's default workspace is used.tests/mcp/test_tool_project_management.pyAdded
test_create_memory_project_passes_workspace_idwhich patchesget_clientwith a fake factory that captures theworkspacekwarg, verifyingworkspace_id="tenant-abc-123"is properly forwarded.|