Skip to content

create_memory_project has no way to target a non-default workspace #788

Description

@phernandez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcloudBasic Memory CloudvalidatedTested and verified working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions