Skip to content

Commit 2d3a834

Browse files
authored
Merge pull request #81 from NateBJones-Projects/contrib/matthallett/env-examples
[docs] Add .env.example files to extensions and dashboard
2 parents aabe6dc + 1f3289a commit 2d3a834

8 files changed

Lines changed: 57 additions & 6 deletions

File tree

dashboards/open-brain-dashboard/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Copy this file to `.env.local` for local development.
33
# SvelteKit only picks up env changes after restarting `npm run dev`.
44
#
5+
# Tip: symlink from the repo root so all dashboards share one file:
6+
# ln -s ../../.env.local dashboards/open-brain-dashboard/.env.local
7+
#
58
# Preferred (server-only, does not expose key in browser):
69
MCP_URL=https://your-project.supabase.co/functions/v1/open-brain-mcp
710
MCP_KEY=your-access-key
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key

extensions/job-hunt/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# These are set automatically by Supabase when you deploy an Edge Function.
2+
# You only need to set MCP_ACCESS_KEY manually.
3+
4+
SUPABASE_URL=https://your-project.supabase.co
5+
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
6+
MCP_ACCESS_KEY=your-mcp-access-key

server/index.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,27 @@ server.registerTool(
316316
extractMetadata(content),
317317
]);
318318

319-
const { error } = await supabase.from("thoughts").insert({
320-
content,
321-
embedding,
322-
metadata: { ...metadata, source: "mcp" },
319+
const { data: upsertResult, error: upsertError } = await supabase.rpc("upsert_thought", {
320+
p_content: content,
321+
p_payload: { metadata: { ...metadata, source: "mcp" } },
323322
});
324323

325-
if (error) {
324+
if (upsertError) {
325+
return {
326+
content: [{ type: "text" as const, text: `Failed to capture: ${upsertError.message}` }],
327+
isError: true,
328+
};
329+
}
330+
331+
const thoughtId = upsertResult?.id;
332+
const { error: embError } = await supabase
333+
.from("thoughts")
334+
.update({ embedding })
335+
.eq("id", thoughtId);
336+
337+
if (embError) {
326338
return {
327-
content: [{ type: "text" as const, text: `Failed to capture: ${error.message}` }],
339+
content: [{ type: "text" as const, text: `Failed to save embedding: ${embError.message}` }],
328340
isError: true,
329341
};
330342
}

0 commit comments

Comments
 (0)