Skip to content

feat: add listMemories tool to MCP server#1090

Open
Nemskri wants to merge 1 commit into
supermemoryai:mainfrom
Nemskri:feat/list-memories
Open

feat: add listMemories tool to MCP server#1090
Nemskri wants to merge 1 commit into
supermemoryai:mainfrom
Nemskri:feat/list-memories

Conversation

@Nemskri

@Nemskri Nemskri commented Jun 10, 2026

Copy link
Copy Markdown

What does this PR do?

This PR implements the requested listMemories tool for the Supermemory Model Context Protocol (MCP) server, addressing Issue #1030. This allows AI assistants (like Claude) to enumerate and audit stored memories in a paginated/sortable list instead of only retrieving them via semantic recall.


Implementation Details

  1. MCP Tool Registration (apps/mcp/src/server.ts):

    • Registered the listMemories tool.
    • Defined Zod schemas for limit (max 200), cursor (opaque token for pages), sort (created_desc, created_asc, updated_desc), filter (optional search substring), and optional project containerTag.
  2. SDK client helper (apps/mcp/src/client.ts):

    • Added listMemories helper method to the SupermemoryClient.
    • Queries this.client.documents.list under the hood (per the SDK v4 design where /v3/documents/list returns the list of memories).
    • Applies local case-insensitive substring filter matching on titles and text.
  3. Standard Transport Fix (apps/mcp/src/index.ts):

    • Set the default server transport to "sse" in SupermemoryMCP.serve(...).
    • This resolves a 400 Bad Request connection error when standard SSE clients (like the official MCP Inspector) try to connect without a pre-initialized session ID header.

Verification & Testing

  • Type Checking: Verified that the type check passes on the mcp app target with bunx tsc --noEmit --project apps/mcp/tsconfig.json.
  • Formatting: Ran npx biome check on modified files to ensure strict compliance with code formatting/linting rules (all checks passed).
  • Manual verification: Connected successfully via the official MCP Inspector using standard SSE at http://localhost:8788/mcp and verified that the schema parameters show up correctly and run under local mock authentications.

@graphite-app graphite-app Bot requested a review from Dhravya June 10, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants