contextkeeper

io.github.TheRealDataBoss由 GitHub 账号 TheRealDataBoss 发布v0.2.7更新于 Oct 24, 2026

Zero model drift between AI agents. Session continuity for Claude, GPT, Gemini, and any LLM.

概览

AI 生成的概览

一个本地 MCP 服务器兼命令行工具,保存共享的项目上下文、会话、任务和决策,让不同 AI 代理在交接时保持一致。

可以做什么
初始化并同步项目上下文:生成状态向量、约定和任务,扫描仓库更新状态,查看自上次同步以来的变更,并校验上下文文件、执行数据库结构迁移或导出为 JSON/Markdown。为任意 AI 代理生成可直接粘贴的简报,并管理代理会话及代理之间的交接。跟踪项目任务和架构决策。提供带 API 密钥认证的本地 REST API,并支持多代理并发协调模式。通过约 10 个 MCP 工具与 Claude Code 原生集成。
适用场景
适合在同一个代码库上使用多个 AI 助手或模型、希望会话之间保持连续性时使用,也适合把项目状态、任务和决策集中存放,供任意代理读取简报。
运行要求
作为本地 stdio 进程运行,通过 pip 从 PyPI 安装,需要 Python。MCP 服务器以 Python 模块方式启动,并在桌面客户端配置中设置。存储默认使用文件,可选 SQLite 或 PostgreSQL 后端;PostgreSQL 需要数据库连接地址。REST API 服务器为可选项,使用 API 密钥。
安装前请注意
它会扫描你的仓库并在本地保存项目上下文、任务和决策,向外部代理分享简报前请先检查其中内容。REST API 由通过 auth 命令创建和撤销的 API 密钥保护,请妥善保管。使用 PostgreSQL 后端需要包含凭据的数据库连接地址。

安装

在 SourceWeft 中

  1. 打开 控制台中的 contextkeeper,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

contextkeeper

[PyPI] [Python 3.10+] [License: MIT] [MCP Native]

Zero model drift between AI agents.


Install

bash
pip install contextkeeper

Quickstart

bash
contextkeeper initcontextkeeper sync --agent claudecontextkeeper bootstrap --clipboard# paste into any AI — full context restored

CLI Reference

CommandDescription
initScaffold project context — state vector, conventions, tasks
syncScan repo and update state vector with current project state
bootstrapGenerate paste-ready briefing for any AI agent
statusShow tracked projects and their current state
doctorValidate context files for consistency and missing fields
migrateRun database schema migrations
exportExport project context to JSON/Markdown
diffShow what changed since last sync
serveStart the REST API server (FastAPI + Uvicorn)
sessionsList and manage agent sessions
tasksList and manage project tasks
decisionsList and manage architectural decisions
authCreate and revoke API keys (ck_ prefix, SHA-256 stored)

Python SDK

python
from contextkeeper import ContextKeeperClient
client = ContextKeeperClient()
# Sessionssession = client.create_session(agent="claude", project="myproject")client.end_session(session.id, summary="Implemented auth module")
# Tasks & decisionsclient.create_task(project="myproject", title="Add rate limiting")client.create_decision(project="myproject", title="Use PostgreSQL", rationale="Need JSONB")
# Handoffhandoff = client.create_handoff(from_session=s1.id, to_agent="gpt-4")

MCP Server

10 tools — native Claude Code integration via Model Context Protocol.

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "contextkeeper": {      "command": "python",      "args": ["-m", "contextkeeper.mcp"]    }  }}

Backends

bash
# File (default) — zero configcontextkeeper init
# SQLitecontextkeeper init --backend sqlite
# PostgreSQLcontextkeeper init --backend postgres --db-url postgresql://user:pass@localhost/ck

REST API

14 endpoints + 3 auth endpoints. FastAPI with OpenAPI spec.

bash
contextkeeper serve --port 8420# → http://localhost:8420/docs   (Swagger UI)# → http://localhost:8420/openapi.json

Auth header: Authorization: Bearer ck_your_api_key

Multi-Agent Coordination

Three modes for concurrent agent access:

  • sequential — one agent at a time (default)
  • lock-based — pessimistic locking per resource
  • merge — optimistic merge with conflict resolution

Links

License

MIT © TheRealDataBoss

来源:packages/python/README.md,提交 a7ffe60

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.7最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分