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 AI
One Python MCP server for multi-agent teams: shared memory, focus conflict detection, an in-process event bus, and CLI agent dispatch (Codex, Claude, Gemini, Cursor, Aider, Grok).
| Layer | What it does |
|---|---|
| Core | Local-first focus registry + optional durable facts over SSH |
| Bus | Typed events (job.*, focus.changed, memory.updated, …) with monotonic seq |
| Dispatch | Spawn headless CLI agents, track jobs, cancel process trees |
No cloud account required. Remote sync is opt-in. Zero hard-coded hosts or personal paths.
Rename (v1.1.0): PyPI package and GitHub repo are now
mindsync-ai
(older installs usedmindsync-mcp). Import path and CLI stay the same:
import mindsync·mindsync.
Install
pip install mindsync-ai
Requires Python 3.10+.
From source:
git clone https://github.com/adityarya24/mindsync-ai.git
cd mindsync-ai
python -m pip install -e ".[dev]"
MCP client config
{
"mcpServers": {
"mindsync": {
"command": "mindsync"
}
}
}
Or:
{
"mcpServers": {
"mindsync": {
"command": "python",
"args": ["-m", "mindsync.server"]
}
}
}
(Windows: point at your venv’s python.exe if agents don’t share PATH.)
Tools (13)
Core memory / focus
| Tool | Purpose |
|---|---|
get_sync_context |
Local state + compiled truth (optional remote pull) |
update_focus |
Per-agent focus/project/branch/paths; conflict warnings → emits focus.changed |
queue_durable_fact |
Remote write or offline queue → emits memory.updated |
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 |
Event bus
| Tool | Purpose |
|---|---|
publish_event |
Publish a typed event with payload |
poll_events |
Poll events since a sequence number |
subscribe_events |
Subscribe an agent to event types |
Agent dispatch
| Tool | Purpose |
|---|---|
delegate_task |
Run a CLI agent (foreground or background) |
job_status |
Job status + PID reconciliation |
job_result |
Read job result file |
job_cancel |
Cancel running job and kill its process tree |
Dispatch also auto-emits job.started, job.completed, and job.failed on the bus.
CLI (dispatch)
mindsync-dispatch agents
mindsync-dispatch run codex "summarize README" --background
mindsync-dispatch status
mindsync-dispatch result <job-id>
mindsync-dispatch cancel <job-id>
Jobs live under ~/.claude/agent-dispatch/jobs/ (override with AGENT_DISPATCH_HOME).
Custom agents: ~/.claude/agent-dispatch/agents.json.
Built-in presets: codex, claude, gemini, cursor, aider, grok.
Quick start (local only)
No env vars required for core + bus + dispatch. State lives under ~/.mindsync.
- Start:
get_sync_context(agent_name) - Work:
update_focus(agent_name, project, branch, focus, paths=[...]) - Milestone:
queue_durable_fact(agent_name, entity, attribute, text) - Delegate:
delegate_task(agent="codex", prompt="...", background=True) - Reconnect:
sync_offline_facts(agent_name)when remote is configured
Optional remote sync
Remote stays 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 and examples/remote/.
| 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 |
MINDSYNC_REMOTE_ENV_FILE |
config/mindsync.env |
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) |
MINDSYNC_LOCK_STALE_SECS |
60 |
Steal lock after holder stops renewing |
SSH must be key-based / BatchMode-friendly.
Two machines (VPS + laptop)
Run MindSync AI on each machine for local focus/state. Share durable facts via one always-on host:
- VPS: deploy
examples/remote/scripts under e.g./opt/mindsync. - Laptop: set
MINDSYNC_SSH_HOST+MINDSYNC_REMOTE_ROOTto that VPS. - VPS itself: leave remote vars empty — it is the store.
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 remoteevents.jsonl— event bus logsubscriptions.json— event subscriptionscompiled-truth/*.md— pulled remote summaries.locks/— exclusive lockfiles
Layout
mindsync-ai/ # GitHub repo
├── mindsync/
│ ├── server.py # FastMCP tools (core + bus + dispatch)
│ ├── storage.py # JSON/JSONL + locks
│ ├── bridge.py # optional SSH/SCP
│ ├── conflict.py # focus overlap
│ ├── config.py # env-based settings
│ ├── bus/ # Event bus engine
│ └── dispatch/ # Agent dispatch (presets, runner, CLI)
├── examples/remote/
├── tests/
└── pyproject.toml # PyPI: mindsync-ai
Develop / test
python -m pip install -e ".[dev]"
python -m pytest -q
python scripts/smoke_test.py
CI runs on every push/PR to master (Python 3.10 / 3.12 / 3.13 × Ubuntu + Windows).
Design principles
- Offline-first — local tools always work; remote is opt-in.
- Locked local state — exclusive locks around state/queue/events.
- Safe remote writes — identifier allowlists + base64 text over SSH.
- No false-positive conflicts — same project alone is not a conflict.
- Generic by default — zero personal paths in code.
- Safe dispatch — model tokens validated; Windows
.cmd/.batarg-mode prompts blocked.
Security notes
- Runs with the privileges of the executing user. Wire only into trusted local agents.
- Pulled remote truth is treated as untrusted (filename/UTF-8 validation, atomic swap).
- Local store defaults to Unix
0700dirs /0600files where the OS allows. - SSH errors are scrubbed before return to clients.
Full details: SECURITY.md.
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 模型以安全和受控的方式获取实时的网络信息。