Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dashboards/open-brain-dashboard/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Copy this file to `.env.local` for local development.
# SvelteKit only picks up env changes after restarting `npm run dev`.
#
# Tip: symlink from the repo root so all dashboards share one file:
# ln -s ../../.env.local dashboards/open-brain-dashboard/.env.local
#
# Preferred (server-only, does not expose key in browser):
MCP_URL=https://your-project.supabase.co/functions/v1/open-brain-mcp
MCP_KEY=your-access-key
Expand Down
6 changes: 6 additions & 0 deletions extensions/family-calendar/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
6 changes: 6 additions & 0 deletions extensions/home-maintenance/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
6 changes: 6 additions & 0 deletions extensions/household-knowledge/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
6 changes: 6 additions & 0 deletions extensions/job-hunt/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
6 changes: 6 additions & 0 deletions extensions/meal-planning/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
6 changes: 6 additions & 0 deletions extensions/professional-crm/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are set automatically by Supabase when you deploy an Edge Function.
# You only need to set MCP_ACCESS_KEY manually.

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
MCP_ACCESS_KEY=your-mcp-access-key
24 changes: 18 additions & 6 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,27 @@ server.registerTool(
extractMetadata(content),
]);

const { error } = await supabase.from("thoughts").insert({
content,
embedding,
metadata: { ...metadata, source: "mcp" },
const { data: upsertResult, error: upsertError } = await supabase.rpc("upsert_thought", {
p_content: content,
p_payload: { metadata: { ...metadata, source: "mcp" } },
});

if (error) {
if (upsertError) {
return {
content: [{ type: "text" as const, text: `Failed to capture: ${upsertError.message}` }],
isError: true,
};
}

const thoughtId = upsertResult?.id;
const { error: embError } = await supabase
.from("thoughts")
.update({ embedding })
.eq("id", thoughtId);

if (embError) {
return {
content: [{ type: "text" as const, text: `Failed to capture: ${error.message}` }],
content: [{ type: "text" as const, text: `Failed to save embedding: ${embError.message}` }],
isError: true,
};
}
Expand Down
Loading