feat: add listMemories tool to MCP server#1090
Open
Nemskri wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR implements the requested
listMemoriestool 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 semanticrecall.Implementation Details
MCP Tool Registration (
apps/mcp/src/server.ts):listMemoriestool.limit(max 200),cursor(opaque token for pages),sort(created_desc,created_asc,updated_desc),filter(optional search substring), and optional projectcontainerTag.SDK client helper (
apps/mcp/src/client.ts):listMemorieshelper method to theSupermemoryClient.this.client.documents.listunder the hood (per the SDK v4 design where/v3/documents/listreturns the list of memories).filtermatching on titles and text.Standard Transport Fix (
apps/mcp/src/index.ts):"sse"inSupermemoryMCP.serve(...).400 Bad Requestconnection error when standard SSE clients (like the official MCP Inspector) try to connect without a pre-initialized session ID header.Verification & Testing
mcpapp target withbunx tsc --noEmit --project apps/mcp/tsconfig.json.npx biome checkon modified files to ensure strict compliance with code formatting/linting rules (all checks passed).http://localhost:8788/mcpand verified that the schema parameters show up correctly and run under local mock authentications.