Context Brain
Uses Google Cloud Storage as a storage backend for silos, with a versioned bucket and operator tooling to pull, verify, sync, and mirror wiki pages.
Mirrors a silo to an Obsidian vault, keeping markdown pages and [[links]] browsable in Obsidian with dry-run and safe deletion checks.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Multi-user AI context brain
A shared, AI-maintained knowledge base that any MCP-capable assistant (Claude, ChatGPT, Claude Code) can read and write, with per-person privacy enforced by the server. It applies Andrej Karpathy's "LLM wiki" idea: instead of re-explaining yourself to every chat, the assistant compiles what it learns into small, linked markdown pages and keeps them current, so every session starts with the context it needs.
Your own silo: private notes, session logs, tasks and decisions. Only you can read it.
A
sharedsilo: reviewed team knowledge (how-tos, references, role portals). Everyone reads; editors write.Role silos (default
finance,hr,ops): readable only with the matching role from your identity provider.Plain markdown with Obsidian-style
[[links]]: readable without the AI, diffable, portable between vendors.
New here? Read docs/concepts.md first (5 minutes): the pattern, silos, the personal/work "two brains" model, recall-first habits and session capture.
Status: extracted from a live deployment (a multi-user work brain behind Microsoft Entra ID, signed in from Claude, plus a single-user personal brain of a few thousand pages on the same engine). ChatGPT as a client is not yet verified. See docs/roadmap.md.
What is in here
Path | What |
| The MCP server: access policy, silo router, Entra gate, wiki engine, storage, records, dates, employee wiki |
| Scrubber, lint, sync between a folder and the bucket (push/pull/verify/vault), operator CLI |
| Builds a silo folder from reviewed pages through the engine |
| Public-release gate: blocks private identifiers and real email addresses |
| Retrieval regression check (hit@k, MRR) |
| A fictional "Example Co" shared silo: role portals, getting-started tutorial, connector how-to, onboarding interview, silo reference |
| Starter page per employee section (tutorial, how-to, reference, explanation, app, dashboard, role) |
| Claude Code slash commands: |
| A thin skill that runs the onboarding interview stored in the shared silo |
| Cloud Run + Cloud Storage runbook and the Entra/connector setup with lessons learned |
| Concepts, session capture, document intake, roadmap |
| About 260 tests, including every access-deny path and adversarial-input timing |
Related MCP server: Cortex
Quick start: run it locally (10 minutes, no cloud)
Needs Python 3.11+ and git. Running the server and the tests does not need anything else. Contributors also need
gitleaks (e.g. brew install gitleaks, or a release binary on your
PATH): the pre-commit checklist in CONTRIBUTING.md runs it, so install it before your first commit.
git clone https://github.com/kdnye/multiuser-ai-context-brain && cd multiuser-ai-context-brain
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements-mcp.txt pytest ruff
python -m pytest # all green before you change anything
python -m tools.seed --src examples/seed/shared --dest local-silos/shared # a local shared silo to play withConnect it to Claude Code: start claude in this folder with the virtual environment active (so python is the
venv's), and approve the project's MCP server when asked. .mcp.json starts the server over stdio as the dev user
you@example.com with the shared-editor role, silos under local-silos/. The server writes one short access line
to stderr per access decision; that is the audit log, not an error.
Then try:
Use the context brain: what should I read to get started? Then run my brain onboarding.
Or run it by hand (any MCP client that speaks stdio):
BRAIN_DEV_EMAIL=you@example.com BRAIN_DEV_ROLES=shared-editor python -m mcp_server.serverYour private silo appears as local-silos/users/<guid>/; open local-silos/ in Obsidian to browse the pages.
Run it for a team (hosted)
The tested setup is Google Cloud Run + a versioned Cloud Storage bucket + Microsoft Entra ID, and costs very little
at team scale (one small instance). That is the one stack this repo has been run on, not the only possible one. The engine
itself does not depend on Google or Microsoft: storage is a backend in mcp_server/store.py and sign-in is the gate in
mcp_server/entra.py. Moving to another bucket service or identity provider means writing a replacement for those
two modules and changing the hosted-app wiring in mcp_server/server.py, which today requires BRAIN_STORE=gcs and
the Entra settings. Local stdio mode needs neither. Follow deploy/README.md and
deploy/connectors.md. Staff then follow the seeded how-to
how-to/connect-the-brain-to-claude-and-chatgpt.
Configuration
Every variable the code reads. The hosted service refuses to start if a required one is missing.
Variable | Mode | Required | Meaning |
| both | no |
|
| http | yes | The service's public base URL, e.g. |
| http | yes | Your Entra tenant id |
| http | yes | Comma list: the API registration's client id and/or its App ID URI |
| http | no | Scopes advertised in discovery. Default |
| http | yes | Comma list of email domains allowed to sign in, e.g. |
| both | http: yes |
|
| http | yes | Cloud Storage bucket; silos live under |
| stdio | no | Folder for local silos (default |
| stdio | yes for stdio | The local dev user. Never set on http (the service refuses to start) |
| stdio | no | Comma list of roles for the dev user, e.g. |
| both | no | Comma list of role-gated silos (default |
| both | no | The role that may write |
| both | no | Display name in the server instructions (default |
| both | no | MCP server name (default |
| both | no | Page limit per silo (default 5000). A new page past it is refused; edits still work |
| both | no | Size limit per silo, in characters of page text (default 40,000,000). A cached page costs about 10x its size in memory, so size this to the instance (a 512 MiB instance holds roughly 40 MB) |
| http | no | An app role every token must carry (for example |
| tools | no | An OAuth access token for the operator CLI ( |
| http | no | Listen port (default 8080; Cloud Run sets it) |
Roles are identity-provider app roles: shared-editor plus one per role silo. A role grants read/write on its own
silo only.
Use it (day to day)
Ask: "What do we know about X?" The assistant calls
wiki_contextfirst and citessilo:path.Save a session: "save this session" (or
/ingestin Claude Code). See docs/session-capture.md.Dates: "What was I working on last Tuesday?" uses
wiki_timeline.Tasks: session tasks become records; "mark the fee-rules task done" uses
wiki_task_update.Share: write a page in your own silo, then ask a shared editor to publish it.
Maintain it
When | Do |
Every change |
|
Search change |
|
Monthly | Pull each silo you administer and lint it: |
Before a secret expires | Rotate the AI client's OAuth secret in Entra and re-enter it in the product (deploy/connectors.md) |
Backup / restore | The bucket is versioned; |
Mirroring a silo to Obsidian |
|
Upgrading | It is pinned below 2.0 on purpose (2.0 renamed FastMCP); test before raising the pin |
Keeping your organisation's identifiers out of a fork: list them, one per line, in the git-ignored
.release-denylist (names, domains, project ids, people). The committed tools/release_denylist.sha256 is only for
long, unguessable phrases: a short term's hash can be reversed by guessing. Details: python -m tools.release_check --help.
Contributing
See CONTRIBUTING.md. Security reports: SECURITY.md. Design: ARCHITECTURE.md. Rules: STANDARDS.md. AI assistants working in this repo start at CLAUDE.md.
License
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
- JustOnceOAuthai.justonce
Persistent memory for AI assistants — one shared, OAuth-secured vault for every MCP client.
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
shared AI-context layer for teams — persistent memory your agents search and update over MCP
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to read and write into a self-hosted personal knowledge base built from imported chats, documents, and notes, with a knowledge graph and AI-powered enrichment.1MIT
- AlicenseNot gradedqualityBmaintenanceA dynamic, governed memory layer for Markdown notes that serves knowledge to AI clients and humans through a secure MCP server, with scoped access, git-audited changes, and optional LLM-powered semantic search.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to capture, share, and recall team knowledge with role-based access control, source attribution, and shared skills over MCP.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables people and AI assistants to share one persistent Markdown-in-Git memory, so any MCP client can load current context, save sessions and decisions, search notes, and work from a team's real knowledge across machines.1 npmAGPL 3.0