BrainHub MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@BrainHub MCPupload my latest sessions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BrainHub MCP
BrainHub MCP 是一个本地 Node.js/TypeScript stdio MCP 服务。它只读取 Claude Code、Codex CLI 和 Grok Build 的顶层会话,过滤系统提示、推理、工具参数/结果与子代理内容,在本地脱敏后将规范化快照写入 Google Drive,并提供混合语义搜索、画像拉取和状态查询。
原生会话文件始终只读,不会删除或改写。Gemini CLI 暂未接入。
功能
upload_sessions:全量回填或增量上传,图片按 SHA-256 去重并转为 WebP。search_sessions:依次检索cards、sessions、inbox,结合关键词和本地 E5 向量排序。get_portrait:始终读取 Drive 最新画像,并尝试刷新本地portrait.md。pull_portrait:覆盖写入portrait.md和weekly-latest.md,返回本期 Diff。hub_status:汇总 Drive 配额、inbox 积压、蒸馏状态、容量和本地适配器/调度状态。
安装与验证
要求 Node.js 22+ 和 pnpm。
pnpm install
pnpm test
pnpm typecheck
pnpm lint
pnpm build
pnpm link --global先运行不接触 Google Drive 的真实扫描:
brain-mcp upload --backfill --dry-run --jsondry-run 不需要 OAuth 或 Drive 根目录,不写状态数据库、不下载向量模型,也不修改客户端和系统调度配置。输出只有数量、字节估算和警告,不包含消息正文。
部署门
完成 dry-run 审阅后,才执行 live 初始化:
brain-mcp config init
brain-mcp auth login
brain-mcp auth status --json
brain-mcp upload --backfill --json
brain-mcp clients install --allclients install 在成功注册 MCP 客户端后,会自动安装每天一次的会话上传任务;默认时间为本地 02:00,也可以通过配置或 BRAINHUB_SCHEDULE_AT 修改。正常安装不需要再执行单独的 scheduler 命令。只有明确不希望启用后台上传时才使用 --no-scheduler。
auth login 会打开 Google 账号选择页。用户在浏览器中选中的账号会成为当前配置的 BrainHub 账号;命令随后读取该账号的 Drive 身份并创建或复用它自己的 brain-hub 根目录。重新运行该命令即可切换账号。OAuth token 不会出现在命令输出或 TOML 中。
OAuth client JSON 只标识 BrainHub 应用,不决定最终使用哪个 Google 账号。其他电脑或其他用户应独立安装、运行 auth login 并选择自己的账号,不能复制他人的 refresh token 或 root_folder_id。如果 OAuth consent screen 仍处于 Testing,Google Cloud 项目还必须允许该账号作为 test user;正式供外部用户使用前,需要按 Google 对完整 Drive scope 的要求完成发布/验证。
历史会话很多时,可先完成 Drive 回填而不等待搜索索引:
BRAINHUB_UPLOAD_CONCURRENCY=32 brain-mcp upload --backfill --skip-index --json--skip-index 只跳过本轮索引刷新,不影响会话和图片上传;结果会包含 INDEX_SKIPPED warning。默认并发由 upload.concurrency 控制,环境变量 BRAINHUB_UPLOAD_CONCURRENCY 可只覆盖当前命令。
Claude Desktop 是显式可选项:
brain-mcp clients install claude --desktop调度器的状态检查、修复安装和卸载仍可通过 brain-mcp scheduler status|install|uninstall 单独完成。
本仓库实现阶段不会自动执行上述 live 命令。
本地磁盘
默认使用量化 Xenova/multilingual-e5-small,模型缓存约 118 MB,首次 live 搜索索引同步时下载一次。384 维向量对象存入 Drive,本地不保留向量数据库或会话正文;本地长期数据只有模型缓存及一个仅含哈希、水位、设备 ID 和错误码的 SQLite 文件。
缓存位置:
macOS:
~/Library/Caches/BrainHub/modelsLinux:
${XDG_CACHE_HOME:-~/.cache}/brain-mcp/models
查看或清理:
brain-mcp search model status --json
brain-mcp search model clear --json详细配置、隐私边界和每日调度行为见 docs/configuration.md。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/qianh/ai-session-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server