Skip to content

Published v0.9.30: memory_sessions returns nextCursor but the stdio proxy drops it (fix in #1534 is not released) #1567

Closed

Description

@HuAzurestar

Summary

The published @agentmemory/agentmemory@0.9.30 stdio MCP can list recent sessions, but cannot advance beyond the first page. The REST endpoint returns nextCursor; the MCP proxy silently discards a supplied cursor. Additionally, the advertised tool schema declares no arguments, so a schema-following agent cannot discover pagination at all.

Release status matters: I checked upstream before reporting. PR #1534, merged on October 13, 2026, already appears to address this through parseSessionArguments and matching contract tests. This report concerns the still-published release, not a claim that current main lacks that fix. On October 15, both npm's latest and the latest GitHub release are still 0.9.30 / v0.9.30.

Environment

  • Windows 10 host, Docker Desktop with a Linux container.
  • Installed core and MCP-reported server version: 0.9.30.
  • MCP launch: docker exec -i --user node <container> agentmemory mcp.
  • A reachable, authenticated local Agent Memory backend with more than 100 existing sessions. This is proxy mode, not an empty local fallback store.
  • No LLM calls or data mutations are required to reproduce.

Reproduction through the actual stdio MCP

After the normal MCP initialize/initialized handshake:

  1. Call tools/list and inspect memory_sessions.inputSchema.properties: it is {}.
  2. Call tools/call with {"name":"memory_sessions","arguments":{}}: the response contains 20 sessions and a non-null nextCursor.
  3. As a diagnostic, supply the otherwise-undocumented limit: {"name":"memory_sessions","arguments":{"limit":3}}. Save the returned cursor as C.
  4. Call {"name":"memory_sessions","arguments":{"limit":3,"cursor":"<C>"}}.
  5. Compare session IDs and the returned cursor between steps 3 and 4: both are identical.

The undocumented arguments in steps 3-4 demonstrate the dropped-cursor implementation; they are not a substitute for fixing the public tool schema.

Control test against the same backend:

  1. GET /agentmemory/sessions?limit=3
  2. GET /agentmemory/sessions?limit=3&cursor=<URL-encoded nextCursor>

The REST control advances correctly and returns disjoint session IDs. Authentication is supplied locally; no credentials or session contents are included here.

Actual read-only test output, with identifiers and cursors intentionally omitted:

{
  "server": { "name": "agentmemory", "version": "0.9.30" },
  "advertisedSessionArguments": [],
  "defaultMcpPageLength": 20,
  "mcpFirstPageLength": 3,
  "mcpSecondPageLength": 3,
  "mcpReturnedCursor": true,
  "mcpCursorRepeated": true,
  "mcpReturnedSameSessionIds": true,
  "restFirstPageLength": 3,
  "restSecondPageLength": 3,
  "restCursorAdvanced": true,
  "restPagesDisjoint": true
}

Root cause in the released source

  • src/mcp/tools-registry.ts at v0.9.30: memory_sessions advertises an empty properties object.
  • src/mcp/standalone.ts at v0.9.30: validation retains only limit for this tool; handleProxy constructs /agentmemory/sessions?limit=${v.limit} without forwarding cursor.
  • The backend REST pagination works; it is not a missing-records or indexing problem.

Consequently, an agent asking which projects are represented in session history cannot enumerate the session collection through the released MCP contract. Retrying the cursor loops over the first page. Falling back to a full export is also impractical for large stores and can hit the approximately 15 MiB engine frame limit.

Expected behavior / request

Please publish the existing #1534 pagination fix in the next release (or a patch release), and mention this specific stdio MCP fix in the release notes so users pinned to 0.9.30 know an upgrade is necessary.

The released tools/list schema should expose the supported pagination/filter fields, and the stdio proxy should forward the cursor so successive pages advance and eventually return nextCursor: null. The new test/mcp-sessions-contract.test.ts coverage in #1534 looks directly relevant; including a packed-artifact stdio regression check would also help prevent source/release drift.

This was reproduced against the installed artifact. I have inspected the main-branch fix but have not deployed or independently runtime-tested an unreleased build.

Related but different scope: #392 (time-range filters), #1022 / #1034 (REST session limits), and #1352 (bounded MCP response sizes).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions