# context-sync

A local memory layer for a codebase: the agent keeps decisions, constraints and file structure across sessions. Handy when context vanishes on restart.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 189
- Author: Intina47
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Intina47/context-sync
- Updated: 2026-04-11
- HTML: https://affpapa.org/en/nevibecode/mcp/context-sync

## What it does

context-sync stores project context in a local database and serves it to the agent through a small MCP tool surface: `set_project`, `remember`, `recall`, `read_file`, `search`, `structure`, `git` and `notion`. Project identity and stack, active work, decisions and caveats live in the database rather than in chat history.

The workflow starts with `set_project` on an absolute path, then `recall` brings back what was stored, `structure` and `search` help you explore, and `remember` keeps anything that should outlive the current session. Inside a git repository `set_project` can install hooks for `post-commit`, `pre-push`, `post-merge` and `post-checkout`. They carry the `Context Sync Auto-Hook` marker, and existing hooks get backed up first.

The database sits at `~/.context-sync/data.db` and config at `~/.context-sync/config.json`. Point it elsewhere with `context-sync --db-path /absolute/path/to/db` or the `CONTEXT_SYNC_DB_PATH` variable. Auto-configuration only runs on a global install, so a local install means setting things up by hand from `docs/CONFIG.md`. Notion is opt-in through `context-sync-setup` and stays read-only.

## Requirements
- Needs: Node.js (commands run via npx)
- Works with: Notion

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add context-sync -- npx -y @context-sync/server
```

### Codex

**Platform CLI**
```bash
codex mcp add context-sync -- npx -y @context-sync/server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "context-sync": {
            "command": "npx",
            "args": [
                "-y",
                "@context-sync/server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "context-sync": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@context-sync/server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add context-sync npx -y @context-sync/server
```

## When to use it
- restore project context after restarting a session
- record a stack decision so it survives the chat
- locate a file in an unfamiliar codebase
- inspect git hotspots and file coupling
- pull a Notion page into a task

## Example prompts
- Call `set_project` with the project path, then run `recall`
- Remember that SQLite was chosen for local storage
- Show the project structure two levels deep

## Similar
- [saving-workspace-context](https://affpapa.org/en/nevibecode/skills/saving-workspace-context.md) — skill · 495 installs
- [notion-mcp](https://affpapa.org/en/nevibecode/skills/notion-mcp.md) — skill · 735 installs
- [notion-knowledge-capture](https://affpapa.org/en/nevibecode/skills/notion-knowledge-capture-2.md) — skill · 567 installs
- [notion-spec-to-implementation](https://affpapa.org/en/nevibecode/skills/notion-spec-to-implementation-2.md) — skill · 358 installs
- [deep-research](https://affpapa.org/en/nevibecode/skills/coreyhaines31-deep-research.md) — skill · 344 installs
- [pm](https://affpapa.org/en/nevibecode/skills/coreyhaines31-pm.md) — skill · 338 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
