-
Notifications
You must be signed in to change notification settings - Fork 180
feat(mcp): Add pagination and filtering to list_repos tool #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mcp): Add pagination and filtering to list_repos tool #614
Conversation
Fixes sourcebot-dev#566 - Add query parameter to filter repositories by name - Add pageNumber and limit parameters for pagination - Include pagination info in response when applicable - Add listReposRequestSchema for request validation - Update README with new list_repos parameters
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Left one comment about ordering guarantees.
I think your approach of putting pagination here instead of the API layer is a good middle-ground. It would be good to support pagination in the API layer at some point, maybe when we take the time to have a stable API surface #101 .
|
Could you also add a entry to packages/mcp/CHANGELOG.md? |
Fixes sourcebot-dev#566 - Updated CHANGELOG.md with pagination and filtering changes
|
Released in v1.0.9 - thanks for the PR! |
Summary
Add pagination and filtering capabilities to the
list_reposMCP tool, enabling users to efficiently browse large repository lists.Changes
queryparameter to filter repositories by name or displayName (case-insensitive)pageNumber(1-indexed, default: 1) andlimit(default: 50) parameters for result paginationlistReposRequestSchemain schemas.ts for request validation with proper Zod descriptorsMotivation
Previously, the
list_repostool returned all repositories at once, which is inefficient for organizations with large repository counts. Without pagination, responses can become too large for LMs to ingest, failing or consuming unnecessary context tokens. This change allows users to:Implementation & Improvements
These changes are implemented entirely on the MCP side since the API is fast. This approach is the least invasive version of this feature. If it is palatable to move filtering and pagination to the API level for better performance, I'm happy to implement that.
Testing
The tool has been tested with various scenarios: