Description
Summary
First, thank you for the work on Paca and on the MCP integration. The pagination improvements are very useful for working with larger projects.
I noticed a reproducible edge case in the MCP list_tasks tool when a page contains enough tasks and full task descriptions to produce a large textual response.
The Paca API generates a valid opaque next_cursor, but the MCP response can become large enough that the cursor is abbreviated in the returned tool text (for example, eyJjYS...jIn0=). Once abbreviated, the value cannot be passed back to list_tasks, so I cannot safely enumerate the complete task collection.
I am sharing this report because it may be especially important for AI clients: a partial task list can look complete unless the continuation metadata is preserved reliably.
Environment
- Paca instance: self-hosted Paca
- MCP package:
@paca-ai/[email protected] - MCP transport: stdio through Hermes Agent
- Client host: Linux
- Repository inspected:
Paca-AI/paca - Affected tool:
list_tasks - Test data: a private project containing more than 300 tasks and long Markdown descriptions
Steps to reproduce
-
Connect an MCP client to Paca using
@paca-ai/[email protected]. -
Select a project with many tasks and long descriptions.
-
Call
list_taskswith a larger page size, such as 100 or 200. -
Observe a response similar to:
Tasks (100 returned, more available) -
Inspect the continuation instruction at the end of the response.
-
In this scenario, the cursor may be abbreviated with an ellipsis instead of being returned byte-for-byte.
-
Passing the abbreviated cursor to the next
list_taskscall cannot continue pagination.
Observed behavior
With pageSize=100, the response was large and the cursor was returned in abbreviated form. The same occurred with pageSize=25.
With pageSize=10, the response remained small enough and the full cursor was returned. Using the full cursor then allowed the next page to be requested.
The API also exposed a useful total_count value that the MCP client did not preserve, so I could not reconcile the complete collection using the normal MCP response alone.
Expected behavior
I would expect list_tasks to always return a usable, exact continuation token and enough structured metadata to enumerate the collection safely, regardless of page size or task-description length.
At minimum, the response could preserve something equivalent to:
{
"items": [],
"page_size": 10,
"returned_count": 10,
"total_count": 370,
"next_cursor": "<exact opaque cursor or null>"
}The cursor should not be summarized, shortened, normalized, or embedded after a large Markdown block that may be subject to a response-size limit.
Investigation and code references
I inspected the current Paca source and found:
- The API handler returns
next_cursorandtotal_countseparately inservices/api/internal/transport/http/handler/task_handler.goinListTasks. services/api/internal/domain/task/cursor.goencodes the cursor as a complete URL-safe Base64 token.- In
apps/mcp/src/api/client.ts,listTaskscurrently returns onlyitemsandnextCursor;total_countis not retained in the MCP result type. - In
apps/mcp/src/tools/task-tools.ts,list_tasksformats every task withformatTask, including full descriptions, and interpolates the cursor at the end of one large text response. - The MCP package contains shared pagination helpers, while
list_tasksuses a custom text formatter instead of returning compact structured pagination metadata.
Based on this, I suspect the issue is in the MCP presentation/serialization path or in the response-size handling around that path, rather than in the backend cursor encoder.
Possible solution
I would appreciate consideration of the following improvements:
1. Preserve pagination metadata
Extend the MCP client result type to retain total_count/total when the API provides it.
2. Return compact structured output
Return pagination metadata separately from task content, so the continuation token is not placed after a potentially large Markdown block.
3. Make list output compact by default
list_tasks could return task summaries by default, without full descriptions, with an explicit option for descriptions or a recommendation to use get_task for full content.
4. Centralize pagination formatting
Use the shared pagination helper consistently, or return JSON-compatible structured content for paginated tools.
5. Encode cursor query parameters defensively
When sending a continuation token back to the API, use encodeURIComponent for the cursor query value. This is not the primary symptom I observed, but it would help protect opaque-token handling.
6. Add regression tests
I suggest tests covering:
- a page with long task descriptions;
pageSize=100or the maximum supported page size;- exact equality of the returned cursor before and after MCP serialization;
- a second-page request using that cursor;
- preservation of
total_count; - a final page with
next_cursor: null; - both compact and detailed task output modes.
Current workaround
Until this is addressed, I can use a small page size, such as pageSize=10, and reject any cursor containing an ellipsis. This works, but it increases the number of round trips and leaves the MCP client without a reliable total count.
Impact
This can lead to incomplete project audits, inaccurate task counts, missed dependencies, and uncertainty about whether a collection was fully inspected. It is particularly relevant for AI clients because opaque continuation tokens must be preserved literally.
Thank you again for maintaining Paca and for considering this report. I hope the details above make the behavior straightforward to reproduce and help improve the pagination experience for large projects.
Activity
pullfrog commentedon Nov 20, 2026
fix(mcp): keep list_tasks pagination cursor intact on large pages