Shared brain for a team
A shared brain is one Neuroplex brain served over HTTP from a VM or a container, so a whole team connects to the same, always-fresh knowledge graph instead of each person building and syncing their own. The server speaks MCP Streamable HTTP at /mcp, is read-only by default, and requires a Bearer token.
teammates' AI assistants ──HTTPS + Bearer token──▶ reverse proxy ──▶ neuroplex serve --http ──▶ /data/brain └─ auto-sync: git fetch source, rescan, commit/push brain1. Try it locally
Section titled “1. Try it locally”export NEUROPLEX_TOKEN=$(openssl rand -hex 32)neuroplex serve --brain ./shop-brain --http --port 3333 # token read from NEUROPLEX_TOKEN (or --token)curl http://127.0.0.1:3333/healthclaude mcp add --transport http shop http://127.0.0.1:3333/mcp --header "Authorization: Bearer $NEUROPLEX_TOKEN"| Flag | Default | Meaning |
|---|---|---|
--http |
off (stdio) | Serve over Streamable HTTP instead of stdio. |
--host |
127.0.0.1 |
Interface to bind. Anything other than loopback requires a token. |
--port |
3333 |
Port. |
--token / NEUROPLEX_TOKEN |
none | Bearer token clients must send. Required; an explicitly empty token disables auth (only sensible on loopback). |
--allow-write |
off | Also expose the enrichment tools (pending_tasks, submit_task), so assistants can write knowledge into the brain. |
Endpoints: POST /mcp (MCP, stateless), GET /health (no auth; returns project name, indexed commit and version only).
2. Run it with Docker
Section titled “2. Run it with Docker”The image lives in docker/. It installs Neuroplex from npm, runs as a non-root user and keeps the brain in /data/brain.
To build from the repository’s source instead of an npm release (e.g. to try unreleased changes), put a package tarball next to the Dockerfile first; it takes precedence over NEUROPLEX_VERSION:
(cd packages/npm && npm ci && npm run build && npm pack --pack-destination ../../docker)Mounted folders (a brain, or local repositories used as BRAIN_REPO/SOURCE_REPO) are often owned by a different user than the container’s; the entrypoint marks them as safe for git, so this works out of the box.
docker build -t neuroplex --build-arg NEUROPLEX_VERSION=latest docker/
docker run -d --name neuroplex-helpdesk -p 127.0.0.1:3333:3333 \ -v neuroplex-data:/data \ -e BRAIN_REPO=https://github.com/acme/helpdesk-brain.git \ -e SOURCE_REPO=https://github.com/acme/helpdesk.git \ -e GIT_TOKEN=ghp_xxx \ -e AUTO_SYNC=true -e AUTO_PUSH=true \ -e NEUROPLEX_TOKEN=$(openssl rand -hex 32) \ neuroplexdocker-compose.yml, with Caddy terminating HTTPS:
services: neuroplex: build: ./docker restart: unless-stopped volumes: [neuroplex-data:/data] env_file: .env # NEUROPLEX_TOKEN, GIT_TOKEN: keep secrets out of the compose file environment: BRAIN_REPO: https://github.com/acme/helpdesk-brain.git SOURCE_REPO: https://github.com/acme/helpdesk.git SOURCE_BRANCH: main AUTO_SYNC: "true" SYNC_INTERVAL_MINUTES: "5" AUTO_PUSH: "true" caddy: image: caddy:2 restart: unless-stopped ports: ["443:443", "80:80"] command: caddy reverse-proxy --from brain.acme.com --to neuroplex:3333 volumes: [caddy-data:/data]volumes: neuroplex-data: caddy-data:Environment variables
Section titled “Environment variables”| Variable | Default | Meaning |
|---|---|---|
NEUROPLEX_TOKEN |
required | Bearer token clients must send. |
NEUROPLEX_ALLOW_NO_AUTH |
false |
true starts without a token. Only on an isolated private network. |
NEUROPLEX_ALLOW_WRITE |
false |
true exposes pending_tasks and submit_task (assistants write into the brain). |
BRAIN_REPO |
none | Git URL of the brain repository. Cloned into /data/brain on first start, git pull --ff-only afterwards. Omit it if you mount a brain at /data/brain. |
GIT_TOKEN |
none | Token for private HTTPS repositories (brain and source). Given to git through a credential helper that reads the environment; never written to disk. |
GIT_USERNAME |
x-access-token |
Username paired with GIT_TOKEN (GitHub accepts the default; GitLab uses oauth2). |
SOURCE_REPO |
from neuroplex.json |
Sets source.remote: the code repository auto-sync follows. |
SOURCE_BRANCH |
from neuroplex.json |
Sets source.branch. |
AUTO_SYNC |
from neuroplex.json |
true/false: sets sync.autoSync. |
SYNC_INTERVAL_MINUTES |
from neuroplex.json (5) |
Sets sync.intervalMinutes. |
AUTO_PUSH |
from neuroplex.json |
true pushes brain commits back to BRAIN_REPO (needs write access). |
NEUROPLEX_GIT_NAME / NEUROPLEX_GIT_EMAIL |
Neuroplex Bot / neuroplex-bot@users.noreply.github.com |
Author of brain commits. |
PORT |
3333 |
Port inside the container. |
3. Connect each teammate
Section titled “3. Connect each teammate”Claude Code:
claude mcp add --transport http neuroplex-helpdesk https://brain.acme.com/mcp \ --header "Authorization: Bearer <token>"Or commit a project .mcp.json and let each person keep the token in their environment:
{ "mcpServers": { "neuroplex-helpdesk": { "type": "http", "url": "https://brain.acme.com/mcp", "headers": { "Authorization": "Bearer ${NEUROPLEX_TOKEN}" } } }}Any other MCP client that supports Streamable HTTP and custom headers works the same way.
4. Keeping it fresh
Section titled “4. Keeping it fresh”With AUTO_SYNC=true and a SOURCE_REPO, the server checks the tracked branch every SYNC_INTERVAL_MINUTES, rescans what changed, marks affected AI summaries stale and reloads the graph live: no restart, no client reconnect (see Keep it fresh). With AUTO_PUSH=true those brain commits go back to BRAIN_REPO, so local copies of the brain stay in step too. Without auto-sync, update the brain repository however you like and restart the container (it pulls on start), or mount the brain folder and rescan it; the server reloads changed files on the next request.
5. Security
Section titled “5. Security”The brain describes your internal architecture, module names and code paths. Treat it like source code.
- Always use a token. Generate a long random one (
openssl rand -hex 32). The server refuses to listen on a non-local interface without one, compares it in constant time and never logs it. - Use HTTPS. The server speaks plain HTTP; put it behind a reverse proxy (Caddy, nginx, a cloud load balancer) that terminates TLS, and publish the container port on
127.0.0.1only. - Keep it private. Prefer a VPN, a private network or an identity-aware proxy over exposing it to the internet.
- Read-only by default. Only enable
NEUROPLEX_ALLOW_WRITEwhen you want assistants to write enrichment into the shared brain, and giveGIT_TOKENthe smallest scope that works (read-only unlessAUTO_PUSHis on). - Rotate tokens when someone leaves or a token leaks: change
NEUROPLEX_TOKENand restart. Everyone shares one token, so rotation affects the whole team. - No secrets in the brain. Scans store structure and AI summaries, not file contents, but notes are free text: never put credentials or customer data in them.
6. Troubleshooting
Section titled “6. Troubleshooting”| Symptom | Check |
|---|---|
401 Unauthorized |
The client must send Authorization: Bearer <token> exactly matching NEUROPLEX_TOKEN. In .mcp.json, make sure the env var is set where the client runs. |
405 Method not allowed on GET /mcp |
Expected: the server is stateless and only accepts POST. Use a client with Streamable HTTP support. |
| Container exits at start | Read docker logs: missing NEUROPLEX_TOKEN, no brain at /data/brain and no BRAIN_REPO, or a clone failing because GIT_TOKEN is missing or lacks access. |
| Is it up? | curl https://brain.acme.com/health returns {"ok":true,"project":…,"indexedCommit":…,"version":…}. indexedCommit tells you how fresh the brain is. |
| Brain not updating | neuroplex status --brain /data/brain inside the container (docker exec) shows the last sync and its error; check SOURCE_REPO access. |