Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Summary
There is currently no MCP tool that lets a client read or set session-scoped preferences (active project, active workspace, etc.). Most note tools accept an explicit project / project_id param, but a few — notably the ChatGPT-compatible fetch (#782) — cannot, because their input schema is fixed by OpenAI's compatibility contract (fetch(id: str)).
A settings tool would give the LLM a way to establish project/workspace context out-of-band, so strict-schema tools can still route correctly.
Motivation
- fetch MCP tool cannot target non-default project (no project_id parameter) #782 (fetch cross-project routing): the right architectural fix for fetch MCP tool cannot target non-default project (no project_id parameter) #782 is to project-qualify IDs in
searchresults. But even with that, there is value in letting the LLM say "from now on, work in project X" once at the start of a conversation rather than re-resolving from each id. - Permalinks are not workspace-disambiguated (teams launch blocker) #783 (workspace-disambiguated permalinks): same shape of problem — workspace context needs to be establishable.
- General ergonomics: today the LLM must thread
project=...through every call, or rely on the user's default. A settings tool centralizes that.
Proposed shape (sketch)
get_settings() -> { active_project, active_workspace, defaults, ... }
set_settings(active_project=..., active_workspace=...) -> Settings
- Session-scoped (per MCP connection), not persisted to the user's global config — so an LLM "trying out" a project doesn't mutate the user's CLI default.
- Other tools (read_note, fetch, search, etc.) consult session settings when no explicit project param is given, falling back to the user's configured default.
Open questions
- Scope: session-only vs. also writable to global config (probably gated by an explicit
persist=Truearg). - Naming:
settingsis generic — could besession,context,set_active_project, etc. - Discovery: should
list_memory_projects()results expose which one is currently active in the session?
Related
- fetch MCP tool cannot target non-default project (no project_id parameter) #782 — fetch can't target non-default projects (strict OpenAI schema)
- Permalinks are not workspace-disambiguated (teams launch blocker) #783 — permalinks not workspace-disambiguated (teams launch blocker)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
claude commentedon May 3, 2026
Claude finished @groksrc's task in 1m 45s —— View job
Issue Triage
Assessment
Type: Feature Request — new MCP tool(s) for session-scoped project/workspace context
Priority: Medium — ergonomic improvement with architectural value, but not a blocker on its own. Related issues #782 and #783 may deliver partial fixes without requiring this.
Component: MCP tools (
src/basic_memory/mcp/tools/)Complexity: Complex — requires careful design and cross-cutting changes
Technical Analysis
After reviewing the codebase, here's the lay of the land:
Current state: MCP tools thread
project=...per call, routing throughget_project_client()inmcp/project_context.py. There is no session-scoped state — the FastMCPContextobject exists per call but no persistent session store is maintained across calls within a connection.Why this is complex:
Contextlifespan mechanism or an external dict keyed on session/connection ID. Neither is trivial.fetch(id), every tool that callsget_project_client()would need to fall back to the session-active project, not just the config default. That's a change to most MCP tools.fetchschema constraint: Thefetch(id: str)tool inchatgpt_tools.pyhas a fixed OpenAI-compatible signature. A settings tool is the right architectural path here —fetchwould consult the session-active project when no project-qualified ID is present.~/.config/basic-memory/config.toml) is the right default. Thepersist=Trueescape hatch adds complexity.No duplicate found: This is a distinct request from the related issues listed (#782, #783).
Open Questions (from issue) — My Take
set_active_project/get_active_projectis clearer thansettingsfor the initial scope. The genericsettingsname implies more than is being requested here.persist=Truepath can come in a follow-up once the session plumbing is solid.list_memory_projects()already returnsis_default. Adding asession_activeflag to its JSON output would be a natural complement once session state exists.Suggested Implementation Path
get_active_project() -> strandset_active_project(project: str) -> strtools.get_project_client()to consult session state before falling back to config default.fetchand other strict-schema tools to benefit automatically.Labels added:
enhancementgroksrc commentedon May 4, 2026
Closing this, should be fixed via #782