mcpbrain
A local-first personal knowledge daemon that syncs Gmail, Drive, and Calendar into a SQLite store for search and context retrieval via Claude Desktop over MCP.
README
mcpbrain
mcpbrain is a local-first personal knowledge daemon. It syncs your Gmail and Drive (and Calendar, if you grant it) into a SQLite store on your own machine, embeds the text for search, and serves it to Claude Desktop over MCP. You then ask Claude things like "search my brain for the campus budget", "what's the context on this person", or "who's connected to this project", and it answers from your own mail and docs, including the relationships between the people and projects it finds.
Everything stays on your laptop. Nothing is sent anywhere unless you turn on the optional encrypted backup, or you query Claude Desktop (in which case Claude Desktop sends your query to Anthropic, same as any other Claude chat).
Maintainers: see
docs/ARCHITECTURE.mdfor the system overview (daemon, MCP connector, distribution topology),docs/DISTRIBUTION.mdfor the update channel, anddocs/RELEASE-RUNBOOK.mdfor release steps.
Install
Three commands:
git clone <repo-url>
cd mcp-ops-brain
./install/setup.sh
On macOS, double-click install/setup.command instead of the last line. On Windows, run install/setup.ps1 in PowerShell.
Each installer does the same things:
- Installs
uvif it isn't already on the machine. - Installs the
mcpbrainCLI as auvtool. - Warms the embedding model (the first sync downloads a small ONNX model into your cache).
- Registers a login agent so the daemon starts when you log in (launchd on macOS, a systemd user service on Linux, a scheduled task on Windows).
- Registers mcpbrain with Claude Desktop and opens a browser wizard to connect your Google account.
In the wizard you sign in with your own Google account and grant read-only access to Gmail, Drive, and (optionally) Calendar. You don't create a Google Cloud project; mcpbrain ships a shared OAuth client (see the maintainer notes below). Because the app isn't through Google's verification yet, the browser shows "Google hasn't verified this app". Click Advanced, then continue. The token is written to your local data directory and the daemon picks it up.
After the wizard, fully quit and reopen Claude Desktop. The brain_search, brain_read, brain_context, and brain_graph tools are then available in any chat.
Updating
mcpbrain update
This pulls the latest commits (fast-forward only, so it aborts cleanly if you have local changes), reinstalls the CLI, and restarts the login agent so the new version takes effect. If the pull can't fast-forward it stops without touching your install and tells you how to resolve it.
What runs at login
The login agent starts the mcpbrain daemon in the background. The daemon runs a loop: it syncs new mail and docs into the local store, embeds them for search, and (if you've set a Gemini key) extracts the entity/relationship graph that powers brain_context and brain_graph. Run only one daemon at a time; it holds a single-writer lock on the store. Claude Desktop opens the store read-only, so it's safe alongside the daemon.
A second, optional login agent runs a menu-bar tray (mcpbrain tray). It shows whether the daemon is running or paused and how many items are indexed, and gives you Pause/Resume, Open setup, and Quit. The tray is a status-and-control client that talks to the daemon over the loopback control API; it does not own the daemon, so quitting the icon closes the menu bar item only and leaves syncing running. It comes back at your next login, or run mcpbrain tray to relaunch it.
What leaves your machine
Two things, and only these:
- The encrypted backup, if you enable it. Backup is off by default. When configured, it snapshots the derived store, encrypts it with an org-held escrow key, and uploads it to a per-user folder on a Shared Drive. The backup contains your synced mail and doc text, encrypted; only a holder of the escrow key can decrypt it.
- Whatever Claude Desktop sends to Anthropic when you query. That's the normal Claude Desktop data path, not something mcpbrain adds.
The sync, the store, the embeddings, and the knowledge graph all stay local.
Trust model
This is an unsigned, clone-and-run tool shared from a private repo with invited collaborators. There's no notarised binary and no app-store review between you and the code. You were invited because someone trusts you with it; you read the repo, decide to trust it, and run it. If that isn't acceptable for your machine, don't run it.
For the maintainer: provision the shared OAuth client
Done once by the maintainer, not by each user. It creates the one OAuth client the app embeds.
- In the Google Cloud Console, create or pick a project.
- OAuth consent screen: User type External. Add the app name, your support and developer email, and the scopes
gmail.readonly,calendar.readonly,drive.readonly. Save. Leave it in Testing (with test users) or publish it to "In production" unverified. - Credentials → Create credentials → OAuth client ID → Application type: Desktop app. Download the JSON.
- Put it at
mcpbrain/google_oauth_client.json(the bundled path; it's gitignored so the real client isn't committed). A desktop client's secret is non-confidential by Google's design because the flow uses PKCE, so bundling it with the app is the standard, accepted practice.
Until this file exists, the auth step raises a clear error (or falls back to a user-supplied client secret).
Verification and the user cap
The app is shared privately with invited collaborators, who sign in as Google "test users" on the unverified consent screen. That model needs no verification and no security assessment:
- An unverified app allows about 100 test users, and each one sees the "unverified app → Advanced → Continue" warning. A collaborator set sits well inside that.
- It costs nothing.
Verification only matters if you later open the app to the general public. Because Gmail and Drive read are restricted scopes, public verification also requires an annual third-party CASA security assessment, which is a real recurring cost, so it's a deliberate business decision rather than a code change. Narrowing Drive to the non-restricted drive.file scope would avoid the Drive assessment, but it loses access to your existing Drive files, so it isn't suitable here.
Licence
See LICENSE. The licence is a placeholder (MIT) pending confirmation.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。