Brain Memory
ai.brainmemory由 brainmemory.ai 發布官方發布者v0.5.1更新於 Nov 7, 2026
Persistent memory for AI agents: one brain shared across Claude, Cursor, Codex and more.
概覽
遠端 MCP 伺服器,為 AI 助理提供持久、具評分的記憶大腦,可在 Claude、Cursor、Codex 等用戶端之間共用。
- 可以做什麼
- 依查詢召回經大腦引擎評分的記憶
- 查看記憶數量、最後更新時間,以及帳戶中哪個大腦正在使用
- 把明確提供的內容存成新記憶,並將其固定到或移出常駐層
- 封存記憶,並審核待驗證的記憶(核准或拒絕)
- 切換連接器所服務的帳戶大腦
- 適用情境
- 適合希望助理跨工作階段、跨不同 MCP 用戶端記住事實、筆記或決定的情境,不必每次對話都從頭開始。也適合已在 Brain Cloud 維護大腦、想在 Claude 網頁版、桌面版或行動版使用同一批記憶的使用者。
- 執行需求
- 透過 streamable HTTP 存取的遠端端點,不需在本機安裝套件。使用 OAuth 2.1 並以 Google(Firebase)帳號登入,大腦必須屬於同一個帳號。帳號需在 Brain Cloud 中已有大腦,否則會建立一個空白大腦。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Brain Memory,將其新增到工作區。
- 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/ai.brainmemory%2Fbrain/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。
{
"mcpServers": {
"brain-memory": {
"type": "http",
"url": "https://mcp.brainmemory.ai/mcp"
}
}
}README
brain-connector
The Brain Memory Claude connector — a remote MCP server that exposes the brain's
scored recall to Claude (web / desktop / iOS / Cowork). Built with the official
@modelcontextprotocol/sdk per Anthropic's
build-mcp-server guidance. Design rationale lives in
brain-cloud/docs/connector-architecture.md.
It lives in this repo (not the npm package — excluded from package.json files, like
website/) so it reuses the real recall engine in ../src directly. One brain, one
engine, two faces.
Status: 🟢 LIVE IN PRODUCTION — Phase 1 + 2 (read + write)
Deployed at https://mcp.brainmemory.ai/mcp (Node service on the VPS beside brain-cloud;
systemd + nginx + certbot — see deploy/). Added at claude.ai and verified on Claude web +
iPhone. Tools: brain_recall, brain_status (read) + brain_memorize, brain_pin,
brain_unpin, brain_forget, brain_verify (write — writes sync back to brain-cloud; hosts gate
them behind confirmation) + brain_use (switch between the account's brains).
Two things to know in production:
- One brain ↔ one Google account — the connector serves the brain of whatever Firebase (Google) identity signs in, so the brain must be pushed to that brain-cloud account. See Identity & accounts below for how the connector now surfaces a wrong / empty / multi-brain account instead of silently serving a phantom brain.
- Sessions renew silently for ~a month — access tokens live 1 h, but the token endpoint issues
rotating refresh tokens (OAuth 2.1: single-use, family-revoked on reuse) with a sliding
30-day window (
CONNECTOR_REFRESH_TTL_MS), so an active user never sees the login page. Each refresh also renews the Firebase credential server-side (securetoken API, from the refresh token captured at login) — so sync-back and TTL re-pulls keep working far past the old ~1 h Firebase ID-token window. Grants + the DCR client registry persist underCONNECTOR_STATE_DIR(systemdStateDirectory; Firebase refresh tokens encrypted at rest viaCONNECTOR_STATE_KEY, our tokens stored hashed), so deploys/restarts no longer log users out. Local CLI memories (brain cloud push) reach an active session automatically via a TTL re-pull (CONNECTOR_REPULL_TTL_MS, default 120s) — it re-pulls only when the cloud checksum changed and never over an unsynced local write.
npm test typechecks and proves the whole path end-to-end in one server — the
complete OAuth 2.1 handshake through to real scored recall (token request is form-urlencoded,
matching real clients):
How recall stays identical to the CLI
The engine bridge (src/engine.ts) runs the repo's bin/recall.js with BRAIN_DIR
pointed at the authenticated user's brain working copy — so the connector's scoring is
byte-for-byte the CLI's, with zero reimplementation. (BRAIN_DIR is the same override
the CLI ships.)
Run / test
Tools
Writes reuse the deterministic CLIs (memorize.js / pin.js / unpin.js / forget.js) and then
syncBack() to brain-cloud.
Identity & accounts
One brain ↔ one Google account. The connector has no idea which laptop you're on — it serves the
brain belonging to whatever Firebase (Google) identity completes the sign-in. The verified uid maps
deterministically to a brain user (resolveBrainUserId), and that user's canonical brain is pulled
from brain-cloud: the brain the user chose with brain_use, or else the account's oldest. So the
rule is simple: connect with the same Google account your CLI's brain cloud syncs to, and use
the same brain (brain cloud brains shows which one the CLI is linked to).
To keep that rule from failing silently, ensureUserBrain returns an identity signal that the
tools surface to you:
This is guidance, not enforcement — a genuinely new user with no brain yet still gets a usable
empty brain. Account-linking (letting one Google identity span several brains at once) is
deliberately deferred; choosing one brain at a time is brain_use.
Auth
Two layers — both real now:
- OAuth 2.1 between Claude and the connector (
src/oauth.ts): authorize / token / register / metadata, PKCE S256, RFC 8707 audience binding, RFC 9207iss. Tokens mint intosrc/auth.ts's store; the/mcpguard validates them (incl. audience). - Who is the human (
src/firebase.ts):/authorizebounces the user through Firebase login (the same project brain-cloud uses). The connector verifies the ID token server-side and secret-free — RS256 against Google's public certs, checkingaud/iss/exp— so it needs only the public project config, no service-account key. The verifieduidmaps to the brain user, then the OAuth code is minted.
If FIREBASE_* env is not set, /authorize falls back to a fixed dev user
(STUB:FIREBASE) so the headless test runs without a browser.
See the Firebase login work (demo)
Signing in through /authorize shows the branded consent/login page and, on success, resolves
your verified firebase_uid → brain_user_id → brain_dir — which is how the connector picks
whose brain to serve. (localhost is an authorized Firebase domain by default, so popup sign-in
works locally.)
Per-user store (src/store.ts)
ensureUserBrain({ userId, brainDir, idToken }) populates the user's brain working copy from a
pluggable provider, then the engine recalls over it. Providers (via CONNECTOR_STORE, else
inferred):
brain-cloud(production) — pulls the user's{brainID}.tar.gzfromBRAIN_CLOUD_API_URL(defaulthttps://api.brainmemory.ai) using their Firebase ID token (brain-cloud's middleware accepts it directly), thentar xzfintobrainDir. Refreshed at each login.local(dev) — symlinksbrainDir→$DEV_LOCAL_BRAIN(your live~/.brain), so your machine serves your real brain through the connector.none— assume pre-provisioned (tests).
Always graceful: if the brain is still missing, it empty-inits a valid (recall-safe) brain.
The brain-cloud provider speaks the store contract, so it works
against any store that implements it, including a self-hosted
brain-store. Sync-back is conditional (If-Match): if another
device pushed first, the connector discards its working copy, starts again from the store's
brain, re-applies the write and pushes again, so nobody's memories are overwritten.
Identity providers (src/identity.ts)
Who is logging in, and what the connector presents to the store for them, sits behind one
interface. Select with CONNECTOR_IDP:
-
firebase(the default whenFIREBASE_*is set) — Google sign-in. The store credential is the Firebase ID token, renewed from the Firebase refresh token. -
static— for a self-hosted store. The sign-in page takes the token the store's operator issued (brain-store user add); the store decides who the user is. RequiresBRAIN_CLOUD_API_URLto be set explicitly, so a token can never be sent to the hosted default by accident. Rotating or removing the user at the store ends their sessions at the next silent renewal. -
oidc— for a self-hosted store that accepts your organisation's OpenID Connect issuer (Entra, Google Workspace, Keycloak, Okta)./authorizesends the browser to the issuer (authorization code + PKCE + nonce) and the issuer returns it to/oidc/callback. The ID token is the store credential, renewed from the issuer's refresh token. NeedsOIDC_ISSUER,OIDC_CLIENT_IDand an explicitBRAIN_CLOUD_API_URL. Token verification is the store's own (store/lib/oidc.js), so the two can never disagree about what a valid token is. An issuer outage answers503and keeps the login; a revocation ends it.
With no provider configured the connector refuses to start in production. When the reverse
proxy is not on loopback (another container, say), name it with CONNECTOR_TRUST_PROXY, for
example uniquelocal; true is refused.
Next
- Account-linking — let one user span several brains at once (recall across them), rather than serving one chosen brain at a time. See Identity & accounts.
- Directory submission — remaining manual steps (test account, MCPB packaging, launch post); see
the submission checklist in
brain-cloud/docs/connector-architecture.md§7.
來源:connector/README.md,提交 0bc6371
工具
0版本歷史
2- v0.5.1最新Nov 7, 2026
- v0.4.0Oct 13, 2026
評分
已滿足適用檢查項的 85%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分