Skip to main content

MindSync AI

CI PyPI version Python versions

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 used mindsync-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.

  1. Start: get_sync_context(agent_name)
  2. Work: update_focus(agent_name, project, branch, focus, paths=[...])
  3. Milestone: queue_durable_fact(agent_name, entity, attribute, text)
  4. Delegate: delegate_task(agent="codex", prompt="...", background=True)
  5. 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:

  1. VPS: deploy examples/remote/ scripts under e.g. /opt/mindsync.
  2. Laptop: set MINDSYNC_SSH_HOST + MINDSYNC_REMOTE_ROOT to that VPS.
  3. 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 map
  • local-audit.jsonl — append-only action log
  • offline_queue.jsonl — durable facts waiting for remote
  • events.jsonl — event bus log
  • subscriptions.json — event subscriptions
  • compiled-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

  1. Offline-first — local tools always work; remote is opt-in.
  2. Locked local state — exclusive locks around state/queue/events.
  3. Safe remote writes — identifier allowlists + base64 text over SSH.
  4. No false-positive conflicts — same project alone is not a conflict.
  5. Generic by default — zero personal paths in code.
  6. Safe dispatch — model tokens validated; Windows .cmd/.bat arg-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 0700 dirs / 0600 files where the OS allows.
  • SSH errors are scrubbed before return to clients.

Full details: SECURITY.md.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mindsync_ai-1.2.0.tar.gz (57.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mindsync_ai-1.2.0-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file mindsync_ai-1.2.0.tar.gz.

File metadata

  • Download URL: mindsync_ai-1.2.0.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mindsync_ai-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9a61e1b4748ee7851dd6a374f0c1684815ecefefbf393b0f55a24667bbfa0cfd
MD5 a2becfed83db8a82e4e917671cd0bd2c
BLAKE2b-256 4403d5655272668438f966676e8a15559008a2c3f3c8cd2fac07ec19060baf7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mindsync_ai-1.2.0.tar.gz:

Publisher: release.yml on adityarya24/mindsync-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mindsync_ai-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: mindsync_ai-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mindsync_ai-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de05d2a08952389e7c361d83da6a980519e66355c29cf6cfc0d8078984cd2541
MD5 245990b977006750cc94c5df13d9dc31
BLAKE2b-256 4edee5d8d9beb812452b4ca4208efed120cb95c70a433fc1d9c95cb13dd65fb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mindsync_ai-1.2.0-py3-none-any.whl:

Publisher: release.yml on adityarya24/mindsync-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.9.0

2 files

1.8.1

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

This release

1.2.0 This release

2 files

1.1.1

2 files

1.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page