Skip to content

fix(mcp): restore scalable project discovery#1181

Open
tmonestudio wants to merge 1 commit into
DeusData:mainfrom
tmonestudio:codex/fix-list-projects-coverage-scope
Open

fix(mcp): restore scalable project discovery#1181
tmonestudio wants to merge 1 commit into
DeusData:mainfrom
tmonestudio:codex/fix-list-projects-coverage-scope

Conversation

@tmonestudio

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes two MCP regressions:

  • restores deterministic pagination for list_projects, sorting database names and opening only the requested page before collecting project metadata;
  • makes expensive node/edge/Git details opt-in through include_details, while preserving the existing metadata_only=true compatibility path;
  • copies normalized check_index_coverage scope strings into the yyjson document so non-root scopes such as src cannot become NUL bytes after the stack buffer is reused.

Reproduce-first evidence

  • Production cache (632 databases): current main exceeded 60 seconds for limit=50, include_details=false; this branch returned 50/632 in 3.54 seconds.
  • Before the fix, scopes=["src"] serialized scope as three NUL bytes. The regression guard now asserts the exact requested_scope and scope strings.

Checklist

  • Every commit is signed off (git commit -s)
  • MCP suite passes locally: 166 passed, 6 platform skips
  • New behavior is covered by reproduce-first tests
  • Promoted-binary smoke passed against the 632-project cache

Paginate and sort list_projects before opening databases, keep expensive details opt-in, and preserve the metadata_only compatibility flag.

Copy normalized coverage scopes into the response document so non-root scopes do not serialize as NUL bytes. Add reproduce-first guards for both regressions.

Signed-off-by: Leonardo trindade miranda <tmonestudio@gmail.com>
@tmonestudio
tmonestudio requested a review from DeusData as a code owner July 19, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant