8000 Paginate mr_discussions and list_issue_discussions by pxpeterxu · Pull Request #80 · zereight/gitlab-mcp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Paginate mr_discussions and list_issue_discussions #80

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

pxpeterxu
Copy link
Contributor

Motivation

We wanted to automatically have Claude Code and Cursor address merge request comments with a prompt like:

Can you read the merge request comments for MR 123 in the user/reponame repository and fix them?

Start by reading the merge request description, diffs, and discussions using the GitLab MCP get_merge_request, mr_discussions, and get_merge_request_diffs tools

We realized though that the mr_discussions will only return the first 20 discussions in a merge request, which means that it can't get all comments for larger merge requests.

Changes

  • Change the mr_discussions endpoint so that it takes in additional pagination arguments (similar to what list_issue_discussions already has)
    • Share types around PaginationOptions with all the APIs that can be paginated
  • Change both the list_issue_discussions and list_issue_discussions to return pagination statistics (e.g., total_pages) in addition to the results, so an agent can know how many pages there are and potentially fetch more pages

Testing

Tested by using the updated MCP server with Cursor:

image

@pxpeterxu pxpeterxu changed the title Add pagination options and response to mr_discussions tol Add pagination options and response to mr_discussions and list_issue_discussions Jun 3, 2025
@pxpeterxu pxpeterxu changed the title Add pagination options and response to mr_discussions and list_issue_discussions Paginate mr_discussions and list_issue_discussions Jun 3, 2025
@bbang-dduck bbang-dduck merged commit c82be8c into zereight:main Jun 3, 2025
7 checks passed
@bbang-dduck
Copy link
Collaborator

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.

2 participants
0