feat: smart response pagination for large MCP tool results #38

Merged
michal merged 1 commits from feat/response-pagination into main 2026-02-24 21:40:54 +00:00
Owner

Summary

  • Adds transparent pagination for MCP tool responses exceeding 80K chars
  • Caches oversized responses and returns a page index with per-page summaries
  • LLM can fetch specific pages via _resultId/_page params or get full response with _page=all
  • Supports smart LLM-generated summaries with simple char-range fallback when no LLM available
  • 34 new tests covering pagination, caching, LRU eviction, TTL expiry, and page splitting

Test plan

  • All 198 mcplocal tests pass (34 new + 164 existing)
  • E2E: call tool returning >80K (e.g. node-red get_flows), verify index returned
  • Verify _page=N returns correct page content
  • Verify _page=all returns full content

🤖 Generated with Claude Code

## Summary - Adds transparent pagination for MCP tool responses exceeding 80K chars - Caches oversized responses and returns a page index with per-page summaries - LLM can fetch specific pages via `_resultId`/`_page` params or get full response with `_page=all` - Supports smart LLM-generated summaries with simple char-range fallback when no LLM available - 34 new tests covering pagination, caching, LRU eviction, TTL expiry, and page splitting ## Test plan - [x] All 198 mcplocal tests pass (34 new + 164 existing) - [ ] E2E: call tool returning >80K (e.g. node-red get_flows), verify index returned - [ ] Verify `_page=N` returns correct page content - [ ] Verify `_page=all` returns full content 🤖 Generated with [Claude Code](https://claude.com/claude-code)
michal added 1 commit 2026-02-24 21:40:48 +00:00
feat: smart response pagination for large MCP tool results
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / typecheck (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / package (pull_request) Has been cancelled
e06db9afba
Intercepts oversized tool responses (>80K chars), caches them, and returns
a page index. LLM can fetch specific pages via _resultId/_page params.
Supports LLM-generated smart summaries with simple fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
michal merged commit 32b4de4343 into main 2026-02-24 21:40:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: michal/mcpctl#38