Skip to content

[integrations] delete_thought MCP#229

Open
txcfi-scott wants to merge 2 commits intoNateBJones-Projects:mainfrom
txcfi-scott:contrib/txcfi-scott/delete-thought-mcp
Open

[integrations] delete_thought MCP#229
txcfi-scott wants to merge 2 commits intoNateBJones-Projects:mainfrom
txcfi-scott:contrib/txcfi-scott/delete-thought-mcp

Conversation

@txcfi-scott
Copy link
Copy Markdown

What it does

Adds a standalone MCP Edge Function that exposes a single new tool: delete_thought(id).

The core Open Brain MCP server does not expose a delete path. As a result, thoughts accumulate forever — there is no way for an AI client to remove a test entry, a duplicate, or something captured in error without dropping into the Supabase SQL editor.

This integration deploys a second Edge Function with exactly one tool, and the core server/index.ts is not modified.

Safety

  • Hard delete. The row is removed from thoughts. Recovery depends on your Supabase project's backup tier (daily backups on paid tiers; Point-in-Time Recovery on higher tiers).
  • Pre-flight fetch. If the id does not exist, the server returns a clear Thought not found: <id> instead of silently succeeding.
  • Audit hook. If the companion schemas/thought-audit schema is installed, the README documents how to extend this function to write an audit row (with prior content + metadata) before the delete so the operation is recoverable from the audit trail. Left out of the base integration to keep its dependencies minimal.

What it requires

  • Working Open Brain setup (just the thoughts table from the getting-started guide).
  • Supabase CLI for deployment.

No LLM provider is required — this tool does not read or write embeddings.

Tested

Deployed against a live Supabase Open Brain instance. Verified:

  • Deleting an existing UUID returns Deleted thought <id> (prior content length: N chars). and the row disappears from the table.
  • Deleting a non-existent UUID returns Thought not found: <id> with isError: true.
  • The existing search_thoughts, list_thoughts, and capture_thought tools from the core server continue to work — this integration is additive and side-effect-free for existing connectors.

Files touched

Only integrations/delete-thought-mcp/ — stays within the contribution scope check.

Attribution

Adapted from a multi-participant capture design used across live Claude / ChatGPT / Codex sessions.

Adds a standalone MCP Edge Function that exposes a single delete_thought
tool. Hard-deletes a thought by UUID with a pre-flight fetch so callers
see a clear not-found outcome rather than a silent success.

Deploys as its own Supabase Edge Function — the core server/index.ts is
untouched. README documents an optional audit hook for installs that
also use the thought_audit schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the integration Contribution: MCP extension or capture source label Apr 23, 2026
Rewords the step 5 verification from a bullet list into a short
numbered sequence (capture → delete → delete-again → table-editor
check) so the Verify section has explicit top-level numbered steps.
This matches the update-thought-mcp README's verification style and
makes the intended end-to-end happy-path + not-found path obvious to
a first-time follower of the guide.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration Contribution: MCP extension or capture source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant