feat(mcp): Add pagination and filtering to list_repos tool#614
Uh oh!
There was an error while loading. Please reload this page.
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.
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: