MindSync MCP
Local-first MCP server for multi-agent memory sync and focus conflict detection, enabling multiple coding agents to share a session registry and receive conflict warnings when focuses overlap.
README
MindSync MCP
Local-first Model Context Protocol server for multi-agent memory sync and focus conflict detection.
Use it when several coding agents (Claude Code, Codex, Cursor, Gemini CLI, Grok, custom agents, …) share one developer machine and need:
- A shared session/focus registry (who is editing what)
- Conflict warnings when focuses overlap
- Optional durable fact sync to your remote host over SSH (offline queue when remote is down)
No cloud account. No hard-coded hosts or home directories.
Features
| Tool | Purpose |
|---|---|
get_sync_context |
Load local state + compiled truth (optional remote pull) |
update_focus |
Per-agent focus/project/branch (+ optional paths); conflict warnings |
queue_durable_fact |
Write fact remotely, or queue offline if unreachable / unconfigured |
sync_offline_facts |
Flush offline queue; consolidate + pull truth |
pull_truth |
Windows-safe SCP pull of compiled-truth markdown |
health |
Paths, queue depth, remote reachability |
Design principles:
- Offline-first — local tools always work; remote is opt-in and best-effort.
- Locked local state — exclusive lockfiles around state/queue writes.
- Safe remote writes — identifier allowlists + base64 text transport over SSH.
- No false-positive conflicts — same project alone is not a conflict; token/path overlap is.
- Generic by default — zero personal paths in code; configure via env.
Install
git clone https://github.com/adityarya24/mindsync-mcp.git
cd mindsync-mcp
python -m pip install -e ".[dev]"
Quick start (local only)
No env vars required. State lives under ~/.mindsync.
MCP client config
After pip install -e .:
{
"mcpServers": {
"mindsync": {
"command": "mindsync"
}
}
}
Or run the module path explicitly:
{
"mcpServers": {
"mindsync": {
"command": "python",
"args": ["-m", "mindsync.server"]
}
}
}
(Windows: use your venv’s python.exe if agents don’t see the same PATH.)
Optional remote sync
Remote features stay disabled until both are set:
export MINDSYNC_SSH_HOST=my-server # SSH config Host or user@host
export MINDSYNC_REMOTE_ROOT=/opt/mindsync # directory on that host
See .env.example for the full list and examples/remote/ for sample server-side scripts (mindsync_fact.py, mindsync_consolidate.py).
| Env var | Default | Meaning |
|---|---|---|
MINDSYNC_HOME |
~/.mindsync |
Local data root |
MINDSYNC_SSH_HOST |
(empty) | SSH host; empty disables remote |
MINDSYNC_REMOTE_ROOT |
(empty) | Remote project root; empty disables remote |
MINDSYNC_REMOTE_ENV_FILE |
config/mindsync.env |
Optional file sourced on remote before commands |
MINDSYNC_REMOTE_WRITE_SCRIPT |
tools/mindsync_fact.py |
Relative to remote root |
MINDSYNC_REMOTE_CONSOLIDATE_SCRIPT |
tools/mindsync_consolidate.py |
Relative to remote root |
MINDSYNC_REMOTE_TRUTH_SUBDIR |
compiled-truth |
Markdown summaries directory |
MINDSYNC_SSH_TIMEOUT |
3 |
SSH connect timeout (seconds) |
MINDSYNC_FOCUS_STALE_SECS |
7200 |
Ignore older focus entries |
MINDSYNC_REMOTE_CACHE_TTL |
30 |
Cache TTL for online probe |
MINDSYNC_LOCK_TIMEOUT |
5 |
Local lock wait (seconds) |
SSH must be key-based / BatchMode-friendly (no interactive password prompts).
Local data layout
Under MINDSYNC_HOME (default ~/.mindsync):
local-state.json— active project + per-agent focus maplocal-audit.jsonl— append-only action logoffline_queue.jsonl— durable facts waiting for remotecompiled-truth/*.md— pulled remote summaries.locks/— exclusive lockfiles
Agent usage pattern
- Start:
get_sync_context(agent_name)(setrefresh_remote=truewhen remote is configured). - Work:
update_focus(agent_name, project, branch, focus, paths=[...]). - Milestone:
queue_durable_fact(agent_name, entity, attribute, text). - Reconnect:
sync_offline_facts(agent_name).
Layout
mindsync-mcp/
├── mindsync/
│ ├── server.py # FastMCP tools
│ ├── storage.py # JSON/JSONL + locks
│ ├── bridge.py # optional SSH/SCP
│ ├── conflict.py # focus overlap
│ └── config.py # env-based settings
├── examples/remote/ # sample remote hooks
├── tests/
├── .env.example
└── pyproject.toml
Develop / test
python -m pip install -e ".[dev]"
python -m pytest -q
python scripts/smoke_test.py
GitHub Actions runs the same suite on every push/PR to master
(Python 3.10 + 3.12, Ubuntu + Windows).
Security notes
- Treat tool arguments as untrusted: entity/attribute/agent must match a strict allowlist.
- Fact text is base64-transported to the remote host (no raw shell interpolation of free text).
- This server runs with your user privileges and can SSH only when you configure a host — wire it into trusted local agent clients only.
- Do not commit real
.envfiles or server secrets.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。