Token-aware response paging for MCP servers — chunks large tool responses and delivers them page by page with agent-readable metadata
Project description
mcp-pager (Python)
Token-aware response paging for MCP servers. One line of code — large tool responses chunked and delivered page by page with agent-readable metadata.
pip install mcp-pager
from mcp.server.fastmcp import FastMCP
from mcp_pager import paginate
mcp = FastMCP("my-server")
paginate(mcp, max_tokens=4000)
@mcp.tool()
async def list_records(limit: int = 500) -> str:
records = await db.fetch(limit=limit) # could be huge
return json.dumps(records)
See github.com/SatishKakollu/mcp-pager for full documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_pager-0.5.0.tar.gz.
File metadata
- Download URL: mcp_pager-0.5.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bae03a8479f6576a61d31f96f28a981612f0c6b95fc42ec210cba298137da525
|
|
| MD5 |
70f5d2a8a62f818ef61f32ce50f921b4
|
|
| BLAKE2b-256 |
31cf2be71a239c47c3796d14a5ae356e5c7ffef9e5867dfa2e14362a795dcb57
|
File details
Details for the file mcp_pager-0.5.0-py3-none-any.whl.
File metadata
- Download URL: mcp_pager-0.5.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bd371ae3dd112b993c914fe320341f0e567bc63fcaa8e4bcc70807381c16d23
|
|
| MD5 |
72aaf4a478ce32de716c814becb0db3d
|
|
| BLAKE2b-256 |
18ddd34950cbb611af2317052d2259fed8f13d24a120370cd536caf3617a7940
|