feat(mcp): add all_projects flag to mem_search#408
Merged
Alan-TheGentleman merged 1 commit intoMay 27, 2026
Merged
Conversation
Adds an optional boolean argument to mem_search that bypasses project detection and runs a global FTS5 search. Resolves the case where an agent needs to recall context from a project whose key it does not know. When all_projects is true, the handler skips resolveReadProjectWithProcessOverride entirely and passes an empty project to Store.Search. The project argument is ignored in this mode; documented and tested. The response envelope reports project_source="all_projects" and an empty project so callers can distinguish cross-project results from a scoped query. Adds a new SourceAllProjects constant in internal/project to keep the envelope contract typed and explicit. Closes Gentleman-Programming#303
Contributor
Author
|
Heads up: I do not have permission to add labels on this repo, so the |
16 tasks
Alan-TheGentleman
approved these changes
May 27, 2026
Collaborator
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
Reviewed the diff against #303 in a fresh worktree. The all_projects flag is opt-in, the default mem_search path is untouched, scope filtering is orthogonal so there is no cross-scope leak, and the new tests cover the true, false, and override paths. Build and full mcp suite pass. Approving.
8572633
into
Gentleman-Programming:main
8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked Issue
Closes #303
🏷️ PR Type
type:feature— New feature📝 Summary
all_projectsboolean to themem_searchMCP tool.true, project detection is skipped and FTS5 runs without a project filter so the agent can recall context from any project.project_source: "all_projects"and emptyprojectso callers can tell a cross-project search apart from a scoped one.📂 Changes
internal/mcp/mcp.goall_projectsarg to themem_searchschema; short-circuit project resolution inhandleSearchwhen it istrue.internal/project/detect.goSourceAllProjects = "all_projects"constant for the envelope contract.internal/mcp/mcp_test.goall_projectsoverridesproject, default behavior still scoped. SharedseedCrossProjectMemorieshelper.DOCS.mdmem_searchsection.🧪 Test Plan
go test ./...go test -tags e2e ./internal/server/...go test ./internal/mcp/ -run 'TestHandleSearchAllProjects|TestHandleSearchWithoutAllProjects' -v✅ Contributor Checklist
Closes #303)type:*label (type:feature)DOCS.mdto document the new flagCo-Authored-Bytrailers💬 Notes for Reviewers
projectandall_projects: trueare supplied,all_projectswins. This is documented in the parameter description ("Ignored when all_projects=true") and covered byTestHandleSearchAllProjectsOverridesProjectArg. Happy to switch to a hard error if you prefer a stricter contract.project: ""for cross-project responses. If you'd rather have it omit the field entirely, that is a one-line change.