Context Sync
Context Sync
基于 MCP 的 AI 编码工具本地优先项目内存。
Context Sync 为代理提供了一个代码库的持久内存层:
项目标识和技术栈
当前工作、决策、约束和注意事项
结构化文件探索
Git 感知上下文
可选的只读 Notion 查询

功能概述
Context Sync 专为会话连续性而构建。它不再依赖模型去记忆之前的对话,而是存储重要的项目上下文,并通过一套小型 MCP 工具接口使其可检索。
当前核心工具包括:
set_projectrememberrecallread_filesearchstructuregitnotion
Related MCP server: Doclea MCP
安装
全局安装:
npm install -g @context-sync/server自动配置会在全局安装期间运行。安装后,请重启您的 AI 工具。
如果您选择本地安装而非全局安装,自动配置将不会运行。请使用 docs/CONFIG.md 中的手动配置指南。
验证
检查 context-sync 是否出现在您的 MCP 工具列表中:
Claude Desktop:打开工具列表
Cursor:打开工具列表
VS Code / Copilot Chat Agent 模式:检查工具
Continue.dev:打开 Continue 面板
Codex CLI:
codex mcp listClaude Code:
claude mcp list
如果自动配置失败,请参考 docs/TROUBLESHOOTING.md 和 docs/CONFIG.md。
可选的 Notion 设置
如果您需要 Notion 集成,请运行设置向导:
context-sync-setup或者:
npx context-sync-setupNotion 支持在工具层面被刻意设计为只读:
notion({ action: "search", query: "..." })notion({ action: "read", pageId: "..." })
首次使用工作流
在开始每个新会话时,请先设置项目:
1. set_project({ path: "/absolute/path/to/project" })
2. recall()
3. structure({ depth: 2 })
4. read_file({ path: "src/index.ts" })
5. remember({ type: "decision", content: "Use SQLite for local storage" })推荐模式:
每个项目/会话开始时执行一次
set_project使用
recall恢复上下文使用
structure和search进行探索使用
read_file进行重点检查当有内容需要跨会话保留时使用
remember
Git 集成
当您在 Git 仓库中运行 set_project 时,Context Sync 可以安装钩子以自动捕获上下文。
已安装的钩子:
post-commitpre-pushpost-mergepost-checkout
钩子会被标记为 Context Sync Auto-Hook,且现有的钩子会先进行备份。
git 工具支持:
statuscontexthotspotscouplingblameanalysis
数据与配置
默认位置:
数据库:
~/.context-sync/data.db配置:
~/.context-sync/config.json安装状态:
~/.context-sync/install-status.json
自定义数据库选项:
CLI:
context-sync --db-path /absolute/path/to/db环境变量:
CONTEXT_SYNC_DB_PATH
有关存储详情,请参阅 docs/DATA.md。
支持的平台
Claude Desktop
Cursor
VS Code + GitHub Copilot
Continue.dev
Zed
Windsurf
Codeium
TabNine
Codex CLI
Claude Code
Antigravity
文档
This server cannot be deployed
Maintenance
Related MCP Connectors
AI memory layer — one shared, persistent memory across every AI tool you connect.
Shared project memory that keeps teammates and AI agents aligned across sessions.
Shared memory for coding agents. Stop re-explaining your codebase every session.
- EngramOAuthtools.engram
Memory for AI agent teams across tools, sessions, repositories, and teammates.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides AI assistants with persistent memory of your project architecture, development history, and technical decisions, allowing them to give context-aware coding help without needing repeated explanations.1661 npm2MIT

Doclea MCPofficial
AlicenseNot gradedqualityCmaintenanceProvides persistent memory for AI coding assistants, storing and retrieving architectural decisions, patterns, and solutions across sessions using semantic search, while also offering git integration for commit messages and code expertise mapping.MIT- AlicenseNot gradedqualityCmaintenanceUniversal AI memory layer that provides cross-client, cross-repo context management with semantic search, automatic code indexing, and session management. Enables persistent developer memory across projects with typed memories, graph-based relationships, and RAG-powered retrieval.5MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to maintain persistent, cross-session memory of codebase architecture, naming conventions, and decisions through MCP tools. Eliminates repetitive project re-explanation by automatically injecting stored context into every session with local-first SQLite storage and optional team sharing capabilities.4MIT