Skip to content

[recipes] Add local-brain-no-mcp recipe + ob1-local-http skill#304

Open
dhanjit wants to merge 1 commit into
NateBJones-Projects:mainfrom
dhanjit:contrib/dhanjit/local-brain-no-mcp
Open

[recipes] Add local-brain-no-mcp recipe + ob1-local-http skill#304
dhanjit wants to merge 1 commit into
NateBJones-Projects:mainfrom
dhanjit:contrib/dhanjit/local-brain-no-mcp

Conversation

@dhanjit
Copy link
Copy Markdown

@dhanjit dhanjit commented May 15, 2026

Summary

Adds a new recipe, local-brain-no-mcp, and its companion skill ob1-local-http — a self-hosted Open Brain for environments that can't use the canonical cloud + MCP setup.

All 16 files land under new paths only (recipes/local-brain-no-mcp/, skills/ob1-local-http/). No existing OB1 file is touched — zero risk to current functionality.

What it is

A single-LAN-host Open Brain:

  • Official Supabase docker-compose stack (Kong, PostgREST, GoTrue, Realtime, Storage, Studio, Edge runtime), unmodified
  • An Ollama sidecar for local embedding generation — dev hosts never need Ollama installed
  • Postgres 15 + pgvector with a thoughts table that mirrors the canonical OB1 schema exactly, plus match_thoughts() / upsert_thought() RPCs with the same signatures as cloud
  • Three Edge Functions through Kong: POST /capture, POST /search, GET /list
  • The companion ob1-local-http skill, which lets Claude Code (or any skill-aware tool) capture/search against the local brain over plain HTTPS with curl

Why — and a deliberate divergence to flag for review

This recipe is intentionally for constrained environments:

  • No third-party cloud reachable — the host can only talk to LAN hosts; Supabase Cloud is off the table.
  • MCP disabled in Claude Code — corporate policy / locked-down builds block MCP entirely, so the canonical MCP-based capture/search tools can't run.

Because of constraint #2, the recipe deliberately diverges from CLAUDE.md's rule that "MCP servers must be remote Supabase Edge Functions": it still uses Edge Functions, but exposes them as plain HTTPS endpoints rather than over MCP, since the network won't pass MCP. The recipe's README calls this out explicitly and tells users with no such constraints to use canonical cloud OB1 instead. Flagging it here so the divergence is a conscious review decision, not a surprise.

Scope

  • 16 new files, 1164 insertions, all additive
  • Recipe: metadata.json v0.1.0, difficulty advanced, ~45 min setup
  • Skill: metadata.json v0.1.0, difficulty beginner, ~5 min
  • No secrets; .env.example provided; setup generates keys locally via openssl

Test plan

  • On a Linux host: recipes/local-brain-no-mcp/setup.sh brings up the stack (Docker 24+ / Compose v2.20+)
  • POST /functions/v1/capture stores a thought; POST /functions/v1/search returns it by similarity; GET /functions/v1/list shows recents
  • Supabase Studio reachable at http://<brain-host>:3000
  • From a dev host: ob1-local-http skill captures + searches via curl against BRAIN_URL

Notes

Submitted as v0.1.0 — happy to iterate on placement, naming, or the MCP-divergence framing per maintainer preference.

Self-hosted Open Brain stack designed for office networks that block both
third-party cloud services and Claude Code's MCP feature. Deploys the
official supabase/supabase docker stack on one LAN host alongside an Ollama
sidecar; dev hosts capture and search thoughts via curl through a companion
skill, with no MCP transport involved.

- recipes/local-brain-no-mcp/: docker-compose overlay (uses Compose 'include'
  to merge with the official Supabase stack), setup.sh that clones supabase,
  generates HS256 JWTs via Python stdlib only, symlinks Edge Functions and
  installs SQL init scripts. Three Edge Functions (capture, search, list)
  embed server-side via Ollama; thoughts schema mirrors the canonical OB1
  shape with a configurable EMBED_DIM (default 768, one-way-door per
  volume).

- skills/ob1-local-http/: SKILL.md instructs Claude Code to translate
  capture/search/browse intents into authenticated curl calls against
  $BRAIN_URL using $BRAIN_ANON_KEY. Pure HTTP, no MCP.

Documented as a deliberate exception to CLAUDE.md's "MCP must be remote
Edge Functions" rule -- the rule exists for environments where MCP is
available; this recipe targets ones where it isn't.

Validations passed locally without a docker daemon:
- shell syntax (bash -n), JSON syntax + schema, YAML syntax
- tsc --noEmit clean on all Edge Function TypeScript
- JWT generator produces verifiable HS256 tokens
- psql variable substitution renders vector(768) correctly
- gate rules 9, 10, 14 self-checks all pass

Full end-to-end smoke test (docker compose up + capture + search) deferred
to first run on the target office host -- sandbox has no docker daemon.

https://claude.ai/code/session_011MriKPoc9f2XP6drqtdaBg
@github-actions github-actions Bot added recipe Contribution: step-by-step recipe skill Contribution: reusable AI client skill or prompt pack labels May 15, 2026
@alanshurafa alanshurafa added area: recipes Review area: recipes review: ready-for-maintainer Community reviewer recommends maintainer review alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role labels May 20, 2026
@alanshurafa
Copy link
Copy Markdown
Collaborator

Thanks for the contribution. This is a substantial, well-organized recipe — 16 files all under new paths (recipes/local-brain-no-mcp/, skills/ob1-local-http/), nothing existing touched, so it is zero-risk to current functionality. The docker-compose stack plus an Ollama sidecar for local embeddings is a coherent self-hosted setup.

One thing for the maintainer, more positioning than code: this offers a deliberately no-MCP, local-HTTP architecture, which diverges from OB1's stated "one database, one MCP protocol" thesis. recipes/ is open for community contributions, so it fits the category, but whether OB1 wants to host a no-MCP local alternative is worth a conscious call — the underlying use case (environments that cannot use cloud + MCP) is legitimate. Recommend maintainer review.

— Alan (community reviewer; non-binding)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role area: recipes Review area: recipes recipe Contribution: step-by-step recipe review: ready-for-maintainer Community reviewer recommends maintainer review skill Contribution: reusable AI client skill or prompt pack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants