How do I paginate PR review comments in github-mcp-server when responses exceed the token limit?
Using github-mcp-server's
get_pull_request_commentstool from Claude Code and Copilot in VSCode, PRs with many review comments produce responses that exceed the client token limit, e.g. "MCP tool get_pull_request_comments response (25925 tokens) exceeds maximum allowed tokens (25000)". The tool appears to accept no pagination parameters. Is there a supported way to paginate or otherwise reduce the response size?Originally asked on GitHub: https://github.com/github/github-mcp-server/issues/567
4 answers
This is a known limitation, not a configuration problem on your side. GitHub issue #567 ("PR Review comments too large") was closed as NOT_PLANNED, so no pagination support is coming for the
get_pull_request_commentstool.The tool does not accept pagination, filtering, or limit parameters, so Claude Code and Copilot receive the full comment list and hit the client's token ceiling. The exact error seen in the thread:
Error: MCP tool "get_pull_request_comments" response (25925 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.The message is misleading: there is nothing to pass to the tool. When asked to paginate, Claude Code simply reports that no such parameter exists.
No fix or official workaround was provided. The only workaround people reported using is manually copy/pasting the PR review comments into the assistant. As general advice, you can also fetch the review comments yourself via the GitHub REST API (using the paginated PR comments endpoint) and feed your assistant smaller chunks of the response — but that bypasses the MCP server entirely.
The thread confirms this affects several clients (Claude Code, Copilot in VSCode) and makes PR comment summarization unusable, so if you need the capability it may be worth opening a new issue with a concrete use case — though as of this writing the feature is not planned.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Asked Claude Code to paginate the 25 PR review comments on a pull request. Claude replied that get_pull_request_comments accepts no pagination parameters and that the full response exceeds the token limit.
Source: https://github.com/github/github-mcp-server/issues/567 (opens external site)
Did this work for you?What @mnbiehl tried on GitHub (Didn't work)
Tried summarizing a PR with many review comments using Copilot in VSCode. Copilot looped through "pull comments -> summarize conversation" until the user interrupted or the iteration limit kicked in.
Source: https://github.com/github/github-mcp-server/issues/567#issuecomment-3032414303 (opens external site)
Did this work for you?What @arnaudbreton tried on GitHub (Worked)
Manually copy/pasted the PR review comments into Claude Code to work around the token limit when the MCP tool response was too large.
Source: https://github.com/github/github-mcp-server/issues/567#issuecomment-3139419637 (opens external site)
Did this work for you?
Related questions
- Is there a remote GitHub MCP server I can use without Docker or a local build?
- Does github-mcp-server support GitHub Actions workflows and logs?
- How can the GitHub MCP server access a repository's wiki?
- GitHub remote MCP server fails with PAT: HTTP 404 or 400 in Claude Code and Cursor?
- Private org repos fail with 404 or Bad credentials in GitHub MCP Server even with PAT: how to fix?