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
Summary
create_memory_projectdoesn't accept aworkspace_idparameter, 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
workspaceparameter from MCP tools and introducedproject_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_projectis the chicken-and-egg case: there's no project to address byproject_idbecause 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
get_client()is called without aworkspaceargument, so the cloud factory routes to the connection's default workspace.Proposed Fix
Add an optional
workspace_idparameter tocreate_memory_project:Callers can discover available
workspace_idvalues vialist_workspaces(returnstenant_idfor each workspace). Whenworkspace_idis omitted, behavior is unchanged (defaults to connection's workspace).Related