feat(mcp): add deleteDocument tool for exact-ID removal (#1442) - #1633
Open
devaniketh wants to merge 1 commit into
Open
feat(mcp): add deleteDocument tool for exact-ID removal (#1442)#1633devaniketh wants to merge 1 commit into
devaniketh wants to merge 1 commit into
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.
Summary
Adds a
deleteDocumenttool to the Supermemory MCP server to allow AI clients (Claude Desktop, Cursor, Claude Code) to delete documents by their exact ID, completing the document CRUD lifecycle.Fixes #1442
Problem
Previously, the MCP server exposed full reading (
listDocuments,getDocument,listMemories,search_memory) and writing (add_memory,save-memory,upload-file,guided-save), but had no direct way to delete a document by ID.The only removal option was
add_memorywithaction: "forget", which uses vector cosine similarity (threshold 0.85). This posed two problems:listDocumentsor inspect them viagetDocumentreceive exactdocumentIds, but had no tool to delete that specific document.Solution
deleteDocumentMCP Tool: Addedapps/mcp/src/server/tools/delete-document.tstaking{ documentId: string }.MEMORY_TOOL_ANNOTATIONS(destructiveHint: true) so MCP hosts prompt the user for confirmation.getDocumentbehavior).SupermemoryClient.deleteDocument(id)callingthis.client.documents.delete(id).deleteDocumentunderTOOL_SURFACES("model_tool") and added toEXPECTED_TOOLS.apps/docs/supermemory-mcp/mcp.mdxandapps/mcp/README.md.Testing
apps/mcp/src/server/tools/delete-document.test.tscovering tool registration, space validation, successful deletion, and error propagation.