Skip to content

Fix pagination handling in McpServer#177

Merged
stephentoub merged 1 commit intomodelcontextprotocol:mainfrom
stephentoub:fixcursor
Apr 1, 2025
Merged

Fix pagination handling in McpServer#177
stephentoub merged 1 commit intomodelcontextprotocol:mainfrom
stephentoub:fixcursor

Conversation

@stephentoub
Copy link
Copy Markdown
Contributor

  • We were defeating the purpose of pagination by doing all of the aggregation in the server. If a custom handler returns a paginated result, we should instead propagate that back to the client, who can choose to get more results when needed.
  • We were adding tools/prompts from the collections on every request, even if there was a cursor. If multiple requests came in with different cursors, we'd re-add the same tools each time.

- We were adding tools/prompts from the collections on every request. If multiple requests came in with different cursors, we'd re-add the same tools each time.
- We were defeating the purpose of pagination by doing all of the aggregation in the server. If a custom handler returns a paginated result, we should instead propagate that back to the client, who can choose to get more results when needed.
@stephentoub stephentoub merged commit b12d728 into modelcontextprotocol:main Apr 1, 2025
8 checks passed
@stephentoub stephentoub deleted the fixcursor branch April 1, 2025 13:54
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.

3 participants