[integrations] Thought management — update and delete tools#55
Conversation
|
Saw your Discord post — impressive work across all of these. I'm going to personally review each one. Not today, but they're on my list. |
justfinethanku
left a comment
There was a problem hiding this comment.
Review of PR #55: Thought Management Tools
✅ What's Good
Strong concept and execution:
- Fills a real gap in the Open Brain ecosystem — the core server has create (capture) and read (search), but this completes the CRUD loop with update and delete
- Well-structured code following the existing OB1 patterns (Hono + MCP SDK + Supabase client)
- Two deployment options (add to core vs standalone) show good understanding of user needs
- Clean TypeScript implementation with proper error handling
- Automatic re-embedding and re-classification on update is a thoughtful touch
Good documentation:
- README is clear and well-organized with proper sections
- Troubleshooting section included
- Code examples are complete and copy-paste ready
- Both deployment paths are documented
Metadata compliant:
- All required fields present
- Valid JSON structure
- Appropriate tags and difficulty level
⚠️ Issues That Need Addressing
1. Extensions are Curated — Requires Maintainer Approval
Per CONTRIBUTING.md and extensions/README.md, the extensions/ directory is curated, not open for direct community contributions:
Extensions are curated — discuss with maintainers before submitting. Propose a new extension.
This contribution should either:
- Option A: Be moved to
integrations/(which is open for community contributions and fits the pattern — this is an MCP extension) - Option B: Go through the extension proposal process first with maintainers
The distinction matters because extensions form a progressive learning path (currently 6 builds: household-knowledge → home-maintenance → family-calendar → meal-planning → professional-crm → job-hunt). This contribution doesn't fit that pedagogical sequence.
2. Missing Required Extension Fields in metadata.json
If this stays as an extension, the metadata.json is missing required extension-specific fields:
learning_order— integer position in the extension learning path (1-6)requires_primitives— array of primitive dependencies (can be empty[]if none)
Per the metadata schema:
"learning_order": {
"type": "integer",
"minimum": 1,
"description": "Position in the extension learning path (1-6). Extensions only."
}3. Missing SQL Files
Per automated review rule #6:
extensions/have both SQL and code files
Extensions are expected to include database schema changes (table creation, indexes, RLS policies, etc.). This contribution only has code files. If this is truly meant to work with the existing thoughts table without schema changes, that's another indicator it should be in integrations/ rather than extensions/.
4. Remote MCP Pattern Requirement
The README shows both options using local implementation patterns, but per CONTRIBUTING.md rule #14:
Extensions and integrations must use remote MCP via Supabase Edge Functions. No
claude_desktop_config.json, no local Node.js stdio servers.
The Option B deployment should be clearer about deploying to Supabase Edge Functions and connecting via Claude Desktop's custom connectors UI (Settings → Connectors → Add custom connector → paste URL). See docs/01-getting-started.md Step 7 for the correct pattern.
The Edge Function code itself looks correct, but the deployment instructions should explicitly state:
- Deploy to Supabase:
supabase functions deploy thought-management - Set secrets:
supabase secrets set OPENROUTER_API_KEY=... MCP_ACCESS_KEY=... - Connect in Claude Desktop via custom connector with the deployed URL
5. GRANT Step Missing
Per the CONTRIBUTING.md requirements:
GRANT step — Every extension that creates tables MUST include a GRANT step. Supabase no longer auto-grants CRUD permissions to
service_roleon new projects
While this doesn't create new tables, if it were to become an extension with schema changes, it would need explicit GRANT statements.
📋 Required Changes
- Decide on category: Either move to
integrations/thought-management/or go through the extension proposal process with maintainers - If staying as extension: Add
learning_orderandrequires_primitivesto metadata.json - If staying as extension: Add database schema files (or explain why none are needed)
- Update deployment instructions for Option B to clarify the remote MCP deployment pattern
- Update metadata.json category if moving to integrations
💡 Recommendation
Move this to integrations/ — it's a perfect fit:
- Extends the MCP server with new tools (which is what integrations do)
- Doesn't require new database tables (integrations can work with existing schema)
- Doesn't need to fit into the progressive learning path
- Still valuable and well-implemented
Then update:
- Folder path:
integrations/thought-management/ - metadata.json:
"category": "integrations" - PR title:
[integrations] Thought management — update and delete tools - Remove learning_order from metadata (not needed for integrations)
Verdict
Verdict: Significant changes needed
The contribution is technically sound and well-documented, but it's in the wrong category. Extensions are curated and require maintainer approval + fit into the learning path. This would be an excellent integrations/ contribution and could be merged quickly with that change. If the author wants it as an extension, they need to go through the proposal process first.
Great work on the implementation, @alanshurafa! The code quality and documentation are solid. Just needs to land in the right part of the repo. Happy to see this merged once the category is corrected.
Add update_thought and delete_thought MCP tools as a remote Edge Function. Moved from extensions/ to integrations/ per maintainer review — extensions are curated and require approval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d23ffee to
e043420
Compare
|
@claude review this PR |
|
I'll analyze this and get back to you. |
|
@claude review this PR |
|
Claude finished @matthallett1's task in 1m 55s —— View job PR Review: [integrations] Thought Management Tools
First, the good news: The main issue @justfinethanku flagged in their earlier review — wrong category — has been addressed. The contribution is now correctly under Here's my focused review on things that require judgment: Alignment and ValueThis fills a genuine gap. The core MCP server is append-only (capture + search); there's no way for an AI client to correct or remove thoughts as a second brain grows. The choice to package it as a standalone integration (rather than modifying the core server) is correct per contribution guidelines. Issues That Need Addressing1. Missing
|
matthallett1
left a comment
There was a problem hiding this comment.
The concept is solid — update/delete with automatic re-embedding fills a real gap. But Codex review (gpt-5.4) found 3 critical issues that need to be addressed:
P1: Auth fails open when MCP_ACCESS_KEY is unset. At index.ts:89, if the function is deployed without MCP_ACCESS_KEY configured, a request that omits x-brain-key passes the check because undefined !== undefined is false. This makes the delete endpoint publicly writable. Fix: check that MCP_ACCESS_KEY is defined before comparing, and reject all requests if it's not set.
P1: Shared MCP transport across sessions. StreamableHTTPTransport is sessionful (mcp-session-id), but the current code creates one instance at module scope. Concurrent clients will collide. The other MCP servers in this repo (e.g., server/index.ts, the extensions) create the transport inside the request handler. Match that pattern.
P1: Missing Accept header workaround for Claude Desktop. The handler forwards requests straight to StreamableHTTPTransport without the Accept-header patch used in server/index.ts and the extensions. Claude Desktop will get a 406 on the initial POST, meaning the advertised primary client can't connect at all.
Also: the automated Claude review flagged the missing supabase secrets set step in the README and unhandled errors in getEmbedding — both worth fixing too.
The design is right. These are implementation issues that can be fixed by following the patterns already established in the core server and extensions.
|
Closing this PR as part of the OB1 Alpha Milestone consolidation. This feature is being rebuilt as one of 12 clean, gate-compliant PRs that together form the alpha upgrade path. The consolidated PRs will be submitted once verified on the fork. See the full plan for details. |
|
Closing as part of the OB1 Alpha Milestone consolidation. This feature is being rebuilt as one of 12 clean, gate-compliant PRs that together form the alpha upgrade path. The consolidated PRs will be submitted once verified on the fork. |

Summary
update_thoughtanddelete_thoughtMCP tools for managing existing thoughtsWhy
The core server has capture (write) and search (read), but no way for AI clients to edit or remove thoughts. As your second brain grows, you need to maintain it — fix errors, remove outdated info, reclassify. This closes the CRUD loop.
Design Decision
Packaged as an extension (not a core server modification) to respect the contribution guidelines. Users opt in by adding the tools to their server or deploying the standalone function.
Test plan
🤖 Generated with Claude Code