open-brain-web-gateway
Provides OAuth-protected remote access to an existing Open Brain, forwarding approved tool calls from Gemini Spark and Perplexity web clients without altering the upstream system.
README
Open Brain web gateway
OAuth-protected remote MCP gateway for Tony's Gemini Spark and Perplexity web clients. It forwards approved calls to the existing vanilla Open Brain and never creates another brain.
Boundaries
- Open Brain is operational memory, not Continuity, COTA, Current-State Tracker, or owner-acceptance authority.
- No automatic chat capture. Capture tools are for explicit requests only.
- The vanilla Open Brain repository and Edge Function remain unchanged.
- Browser clients receive short-lived OAuth tokens, never the long-lived Open Brain access key.
- OAuth tokens are validated and then terminated at this gateway; they are not passed to the upstream Open Brain.
Components
open-brain-web-gateway: OAuth-protected Streamable HTTP MCP relay with client/user allowlists, exact and summary aliases, and authoritative post-write receipts.docs/: GitHub Pages email-link sign-in and OAuth consent UI, plus privacy and terms pages.open-brain-oauth-ui: deployable source retained as a fallback for a future custom Supabase domain; the default Supabase Functions domain intentionally rewrites HTML to plain text.
Required live configuration
- Supabase OAuth 2.1 Server enabled with authorization path
/oauth/consent. - Auth Site URL:
https://derivedbetter.github.io/open-brain-oauth-ui. - Authorization path:
/oauth/consent/and redirect allowlist includeshttps://derivedbetter.github.io/open-brain-oauth-ui/**. - Two pre-registered confidential clients: Gemini Spark and Perplexity.
- Edge secrets:
OPEN_BRAIN_ALLOWED_EMAILS=<approved-email>OPEN_BRAIN_OAUTH_CLIENT_IDS=<gemini-client-id>,<perplexity-client-id>- optional
OPEN_BRAIN_OAUTH_AUDIENCES=authenticated,<gateway-url> - existing
MCP_ACCESS_KEYremains server-side.
Dynamic client registration stays disabled for the pilot.
Validation
npm test
npx -y supabase@latest functions deploy open-brain-oauth-ui --project-ref zoptbgumxukgpkgbtnpz --no-verify-jwt
npx -y supabase@latest functions deploy open-brain-web-gateway --project-ref zoptbgumxukgpkgbtnpz --no-verify-jwt
Test discovery and unauthenticated failure before connecting a client:
GET /functions/v1/open-brain-web-gateway/.well-known/oauth-protected-resourcereturns protected-resource metadata.- unauthenticated
POST /functions/v1/open-brain-web-gatewayreturns401and an OAuthWWW-Authenticatechallenge. - invalid user, client, issuer, audience, and expired tokens fail closed without an upstream call.
Rollback
Revoke the affected OAuth client, disable the connector in Gemini or Perplexity, disable Supabase OAuth Server if no clients remain, and delete only the two gateway Edge Functions. Existing Open Brain data and the ChatGPT, Codex, and agy integrations remain unchanged.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.