{"id":"04df3073-7e51-41f4-9eeb-1427c4705a14","slug":"brain-kit-mcp","kind":"mcp","name":"brain-kit-mcp","summary":"Open-source MCP memory server. pgvector + Supabase. Companion to dashbuilds.dev/brain-kit.","owner":"resourcehub40-create","repoUrl":"https://github.com/resourcehub40-create/brain-kit-mcp","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-04-29T21:06:03.000Z","addedAt":"2026-10-21T04:30:57.331Z","logoUrl":"https://avatars.githubusercontent.com/u/265293539?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["memory-knowledge","databases","cloud-infra"],"tags":["ai","claude","embeddings","memory","pgvector","semantic-search","supabase"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T17:19:05.127Z","sample":false,"url":"https://conduits.dev/tools/brain-kit-mcp","language":"TypeScript","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# Brain Kit MCP\n\nan open-source MCP memory server. pgvector, supabase, runs for like $0/mo if you're frugal.\n\ngives your AI tools (Claude, Cursor, Windsurf, ChatGPT, whatever's hot this week) a persistent semantic memory so you stop re-explaining your life every session.\n\nself-host this for free, or grab the [polished kit](https://dashbuilds.dev/brain-kit) if you'd rather not spend a saturday wiring it up.\n\n```\nAI client (claude / cursor / chatgpt / etc)\n        │\n        │ MCP over HTTP\n        ▼\nSupabase Edge Function (this repo)\n        │\n        ├─→ Postgres + pgvector  (semantic search)\n        └─→ OpenRouter           (embeddings + metadata)\n```\n\n## what's in here\n\n- `supabase/functions/brain-mcp/index.ts` — the actual mcp server. 4 tools: `search_thoughts`, `list_thoughts`, `thought_stats`, `capture_thought`. plus a REST endpoint for webhook capture cause sometimes you just want to curl something.\n- `supabase/migrations/20260307_init.sql` — `thoughts` table, hnsw vector index, `match_thoughts()` rpc, RLS.\n- `.env.example` — env vars. fill them in.\n- `examples/claude-code.md` — connect it to claude code. that's the only client guide in here, on purpose (see below).\n\nno setup script, no bookmarklet, no ios shortcut, no other client guides. this is the engine. you bring the rest.\n\n## quick start (manual, mildly painful)\n\nyou'll need [supabase cli](https://supabase.com/docs/guides/cli), an [openrouter](https://openrouter.ai) key, and ~30 min where you don't get distracted.\n\n```bash\n# 1. clone, fill env\ngit clone https://github.com/resourcehub40-create/brain-kit-mcp.git\ncd brain-kit-mcp\ncp .env.example .env\n# edit .env: SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, OPENROUTER_API_KEY, MCP_ACCESS_KEY\n# generate the access key with: openssl rand -hex 32\n\n# 2. make a supabase project at supabase.com/dashboard, link it\nsupabase link --project-ref YOUR_PROJECT_REF\n\n# 3. push the schema\nsupabase db push\n\n# 4. push secrets to the edge function\nsupabase secrets set --env-file .env\n\n# 5. deploy\nsupabase functions deploy brain-mcp --no-verify-jwt\n\n# 6. connect a client. see examples/claude-code.md\n```\n\nif any of that broke, congrats, you've earned the right to consider the $29 version.\n\n## ok but i want the version that just works → [Brain Kit, $29](https://dashbuilds.dev/brain-kit)\n\nthis repo is the engine. the [Brain Kit](https://dashbuilds.dev/brain-kit) is the engine plus the rest of the car.\n\n| what | this repo (free) | Brain Kit ($29) |\n|---|---|---|\n| the mcp server | yep | yep |\n| the postgres schema | yep | yep |\n| connect to claude code | yep | yep |\n| **one-command `./setup.sh` deploy** | nope | yep |\n| **browser bookmarklet** (capture any page in 1 click) | nope | yep |\n| **ios shortcut** (capture from your phone in 3 sec) | nope | yep |\n| **configs for claude desktop, chatgpt, cursor, windsurf** | nope | yep |\n| **slack + zapier integration guide** | nope | yep |\n| **REST/webhook integration guide** | nope | yep |\n| **updates as new clients show up** | nope | yep |\n\nself-hosting is great if you have the time. if you don't, $29 is cheaper than the saturday afternoon you'd otherwise lose to \"wait why isn't claude desktop seeing the server.\"\n\n## the tools\n\n### `search_thoughts`\nsemantic search. \"what did i decide about the database\" finds the right capture even if the word \"database\" isn't in it.\n\n### `list_thoughts`\nbrowse with filters: `type`, `topic`, `person`, `days`.\n\n### `thought_stats`\ntotals, type breakdown, top topics, people mentioned. for when you want to feel productive without doing anyhting.\n\n### `capture_thought`\nsave a thought. it auto-generates an embedding and pulls out metadata (topics, people, action items, dates, type). no tagging required.\n\neach tool is also reachable over HTTP at `https://YOUR_PROJECT.supabase.co/functions/v1/brain-mcp` with header `x-brain-key: YOUR_ACCESS_KEY`.\n\nREST capture endpoint, in case you wanna curl from a script:\n\n```bash\ncurl -X POST \"https://YOUR_PROJECT.supabase.co/functions/v1/brain-mcp?action=capture\" \\\n  -H \"x-brain-key: YOUR_ACCESS_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"content\": \"remember to refactor the auth flow next sprint\"}'\n```\n\n## cost\n\n| thing | cost |\n|---|---|\n| supabase free tier (db + edge fn) | $0 |\n| openrouter embeddings (`text-embedding-3-small`) | ~$0.02 / 1M tokens |\n| openrouter metadata (`gpt-4o-mini`) | ~$0.15 / 1M input tokens |\n| **realistic monthly** | **like $0.10–0.30** |\n\nheads up: supabase free-tier projects pause after 7 days of inactivity. either use it regularly, upgrade to pro ($25/mo), or run a tiny keepalive cron (the [Brain Kit](https://dashbuilds.dev/brain-kit) has one).\n\n## architecture-ish notes\n\n- **embeddings: 1536 dim** via openai's `text-embedding-3-small` through openrouter. swap models in `index.ts` around line 25, just remmber to update `vector(1536)` in the migration if you change dimensions.\n- **vector index: hnsw** with cosine distance. hnsw beats ivfflat at this scale (sub-100k rows) for both query speed and not having to rebuild after every insert.\n- **single-user by default.** RLS is service-role-only. for team setups, add supabase auth and per-user policies on `thoughts.user_id`. fair warning, you're on your own there.\n- **privacy**: everything runs in your supabase project. embedding/metadata calls go to openrouter, which has zero data retention.\n\n## license\n\nMIT. go nuts.\n\n## related\n\n- 🧠 [Brain Kit ($29)](https://dashbuilds.dev/brain-kit) — the polished version, with all the capture channels and client configs i didn't put in this repo\n- 📝 [how i actually built and use this](https://dashbuilds.dev/blog/i-turned-my-brain-into-a-postgres-database)\n- 🔧 [free pg_cron sql builder](https://dashbuilds.dev/tools/pg-cron-builder) (also mine)\n- 📡 [free supabase auth-trigger generator](https://dashbuilds.dev/tools/supabase-auth-trigger) (also mine, sorry)\n"}