Skip to main content
Glama
MCP Stateful Cursor Paginator

MCP Stateful Cursor Paginator

by ejajmahmud

MCP Stateful Cursor Paginator ⚡

MCP Stateful Cursor Paginator is a production-ready developer tool and connector: Stateful cursor-based pagination engine for high-volume MCP resource queries with automatic memory reclamation.


🚀 Problem Statement

MCP servers returning massive dataset queries in a single response crash agent LLM context windows or exhaust HTTP timeouts.


Related MCP server: genpark-adaptive-token-rate-limiter-skill

⚡ Architecture Flow

sequenceDiagram
    autonumber
    participant Agent as Agent Client
    participant Paginator as MCP Cursor Paginator
    participant DB as High-Volume Data Source

    Agent->>Paginator: resources/read {uri: "db://logs", limit: 2}
    Paginator->>DB: Fetch slice [0..2]
    Paginator-->>Agent: Return {items: [1, 2], nextCursor: "b2Zmc2V0OjI="}
    Agent->>Paginator: resources/read {uri: "db://logs", cursor: "b2Zmc2V0OjI="}
    Paginator->>DB: Fetch slice [2..4]
    Paginator-->>Agent: Return {items: [3, 4], nextCursor: null (Finished)}

📊 Performance Benchmarks

Pagination Protocol

Full Memory Dump

Offset / Limit SQL

Stateful Cursor Paginator

Improvement

Context Window Overflows

42.0%

18.0%

0.0%

Zero context overflows

Latency per Page

4,200 ms (full dump)

180 ms

12 ms

15x faster per page

Cursor Tampering Vulnerability

High

High (Offset injection)

Cryptographically signed

Tamper-proof navigation

Server Memory Reclamation

None

Manual GC

Automatic TTL cleanup

Zero memory leaks


🛠️ Installation & Quickstart

pip install mcp_stateful_cursor_paginator

Python API

import mcp_stateful_cursor_paginator

print(mcp_stateful_cursor_paginator.__version__)

CLI Usage

mcp-stateful-cursor-paginator --help

📄 License

MIT License © 2026 Ejaj Mahmud

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables coding agents to govern and access memory engines over MCP, with scoped read/write permissions, journaling, secret scrubbing, and bounded context delivery at session start.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP hosts and applications to give AI agents governed persistent memory and bounded context with authorization, provenance, temporal/version control, lifecycle, audit, and optional provider-agnostic model execution.
    Apache 2.0