You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build_context resolves the first URL segment as a project even when project is passed #1814
build_context(project="basic-memory-testing-20261022-1842", url="memory://graph/node-a") logs, on every call:
Client error: POST /v2/projects/resolve: Project not found: 'graph'
The explicit project is given, yet the first URL segment is still tried as a project name. This costs an extra round trip per call and puts a misleading client error in the log. When project/project_id is passed, the URL should be read as project-relative without a project lookup.
Component: MCP tools (build_context). It isn't Cloud-specific.
Priority: Medium. Results are correct, but every call makes a wasted POST /v2/projects/resolve and logs a misleading client error.
Complexity: Simple to medium.
Duplicates: I searched for existing issues and found none.
Analysis
In src/basic_memory/mcp/tools/build_context.py:380, build_context always calls resolve_project_and_path(client, url, active_project.name, context). That function (mcp/project_context.py:800) treats the leading segment of any memory:// URL as a possible project prefix. It does this even though get_project_client(project, project_id=...) has already pinned the project.
The prefix auto-detection at lines 323-332 is correctly skipped when project or project_id is passed. The later resolve_project_and_path call isn't gated the same way. That is why memory://graph/node-a triggers a lookup for a project named graph.
The likely fix is to skip project-prefix resolution when the caller passed project or project_id, and read the URL as project-relative. I haven't verified that this is safe. If permalinks_include_project is on, a caller's own project name may legitimately appear as the first segment, so that case needs to still be stripped. resolve_project_and_path is also shared with other tools, so the change should be scoped to build_context or made opt-in.
A regression test could assert that no /v2/projects/resolve request is made when project is given with a non-project-looking first segment.
Folded into the 1.0 tool surface work: #1829 (tracking #1827). This issue stays open until that lands, with a regression test for the behavior described here.
Fixed in the 1.0 tool surface (bd0eaaf): bm_context reads the URL as project-relative when project is passed, with no extra project lookup. Regression test in tests/mcp/test_tool_bm_context.py.
Activity
claude commentedon Oct 23, 2026
Claude finished @phernandez's task in 21s —— View job
Triage
build_context). It isn't Cloud-specific.POST /v2/projects/resolveand logs a misleading client error.Analysis
In
src/basic_memory/mcp/tools/build_context.py:380,build_contextalways callsresolve_project_and_path(client, url, active_project.name, context). That function (mcp/project_context.py:800) treats the leading segment of anymemory://URL as a possible project prefix. It does this even thoughget_project_client(project, project_id=...)has already pinned the project.The prefix auto-detection at lines 323-332 is correctly skipped when
projectorproject_idis passed. The laterresolve_project_and_pathcall isn't gated the same way. That is whymemory://graph/node-atriggers a lookup for a project namedgraph.The likely fix is to skip project-prefix resolution when the caller passed
projectorproject_id, and read the URL as project-relative. I haven't verified that this is safe. Ifpermalinks_include_projectis on, a caller's own project name may legitimately appear as the first segment, so that case needs to still be stripped.resolve_project_and_pathis also shared with other tools, so the change should be scoped tobuild_contextor made opt-in.A regression test could assert that no
/v2/projects/resolverequest is made whenprojectis given with a non-project-looking first segment.This is triage only; no fix has been implemented.
phernandez commentedon Oct 23, 2026
Folded into the 1.0 tool surface work: #1829 (tracking #1827). This issue stays open until that lands, with a regression test for the behavior described here.
feat(mcp): add bm_context and match project-relative permalink patterns
feat(mcp): add bm_context and match project-relative permalink patterns
feat(mcp): add bm_context and match project-relative permalink patterns
feat(mcp): add bm_context and match project-relative permalink patterns
feat(mcp): add bm_context and match project-relative permalink patterns
feat(mcp): add bm_context and match project-relative permalink patterns
phernandez commentedon Oct 29, 2026
Fixed in the 1.0 tool surface (bd0eaaf): bm_context reads the URL as project-relative when project is passed, with no extra project lookup. Regression test in tests/mcp/test_tool_bm_context.py.