Commit 1cbace3
committed
feat: add pagination support for listRoots operation (#336)
- Add nextCursor field to ListRootsResult for cursor-based pagination
- Implement automatic pagination in McpAsyncServerExchange.listRoots()
- Automatically fetches and combines all pages into single result
- Refactor McpAsyncServerExchange.listRoots() to return Collections.unmodifiableList
- Update tests to verify pagination functionality
- Add test suite for McpAsyncServerExchange covering:
- listRoots() pagination scenarios and edge cases
- Logging notification with level filtering
- Elicitation creation with various capabilities
- Message creation with sampling capabilities
- Error handling and validation scenarios
- Verify sendNotification calls in logging notification tests
- Verify sendRequest is never called when capabilities are missing
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>1 parent 5bd64c2 commit 1cbace3
File tree
4 files changed
+770
-4
lines changed- mcp/src
- main/java/io/modelcontextprotocol
- server
- spec
- test/java/io/modelcontextprotocol
- server
- spec
4 files changed
+770
-4
lines changedLines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
130 | 145 | | |
131 | 146 | | |
132 | 147 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1631 | 1634 | | |
1632 | 1635 | | |
1633 | 1636 | | |
1634 | 1637 | | |
1635 | | - | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1636 | 1644 | | |
1637 | 1645 | | |
1638 | 1646 | | |
0 commit comments