context-hub
The server exposes a minimal MCP tool set for querying a local-first context hub: searching context, reading stable references, and inspecting the manifest, with additional lifecycle and safety operations described in the README.
Search: Query context entries by text, filter by
project_idandkinds(constraint, decision, fact, preference, status), setlimit, and paginate withcursor.Read: Retrieve a specific context item by stable
ref, optionally withinclude_historyandmax_charstruncation.Manifest: Inspect public projects, source types, source counts, and source summaries.
Responses include a
context_hubinvocation marker with status, transport, request ID, and project/source metadata.Transports: Works over MCP STDIO (ChatGPT Desktop) and Streamable HTTP with Bearer auth; non-loopback binds require explicit confirmation and TLS/reverse proxy.
Project/lifecycle operations (from README): initialize projects, register/list projects, stable reference pagination, explicit writes, diagnostics, rebuild derived SQLite FTS5 index after deletion, and backup/restore to a new directory.
Safety/validation: Throttled sync, read-only status, single-step safe repairs, synthetic evaluation, real-import preflight, worker guard records, and default-off telemetry.
Import gate: Real memory import remains disabled; dry-run import planning and approval do not auto-register sources.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@context-hub search my context files for the latest API design"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Context Hub v0.2
本仓库按 Context Hub v1.1 规格交付本地优先的 v0.2 实现:以 JSONL/Markdown 为事实源, SQLite FTS5 为可重建索引,并通过 MCP STDIO 与 Streamable HTTP 暴露最小工具面。 日常 Loop 提供有节流的同步、只读状态、单步安全修复、合成评测、真实导入预检和外接 worker 保护记录。
首轮开发和验收只使用仓库内测试生成的合成数据,不导入任何既有记忆或个人资料。
当前代码已经用官方 Python MCP SDK 完成本地真实 STDIO、Streamable HTTP 握手、
tools/list 和 context_get 调用。ChatGPT Desktop 可直接注册本地 STDIO 服务;
ChatGPT Web 或远程客户端使用带 Bearer 认证的 HTTPS MCP URL。非回环监听默认拒绝,
必须显式确认公网绑定并配置认证与 TLS(或位于可信 TLS 反向代理之后)。产品侧状态、
纯合成验收入口和人工确认边界记录在
docs/chatgpt-client-status.md。
快速验证
.\.venv\Scripts\python.exe -m pip install -r requirements.lock
.\.venv\Scripts\python.exe -m pip install -e . --no-deps
pwsh -NoLogo -NoProfile -File .\scripts\run_runbook_smoke.ps1
.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests -v
.\.venv\Scripts\python.exe -X utf8 scripts\run_loop_acceptance.py --output .context-hub-test-data\loop-acceptance-report.json
.\.venv\Scripts\python.exe -X utf8 scripts\run_multiproject_acceptance.py --output .context-hub-test-data\multiproject-report.json
.\.venv\Scripts\python.exe -X utf8 scripts\run_acceptance.py --output .context-hub-test-data\acceptance-report.json
.\.venv\Scripts\python.exe -X utf8 scripts\verify_desktop_stdio.py --command .\.venv\Scripts\context-hub-mcp.exe --data-dir .\.context-hub-test-data\chatgpt-http-e2e\data --query chatgpt-http-e2e-7f3a91 --project-id desktop-e2e --expected-marker chatgpt-http-e2e-7f3a91 --runs 5PowerShell 冒烟脚本逐条调用手册公开的 CLI,验证初始化、项目注册、清单、检索、稳定 引用分页、显式写入、诊断、删除派生索引后重建,以及备份后恢复到新目录。它只创建 唯一的合成测试目录,结束后删除该目录并保留忽略的 JSON 报告。
多项目验收会在单个临时目录内生成 3 个彼此隔离的项目,验证固定 Top-3 检索集、
项目与类型过滤、分页哈希、源文件变更/删除、历史版本、无损重建,以及本地真实
STDIO 的 manifest → search → read。脚本不读取现有 Context Hub 数据或既有记忆。
Loop 验收在一个临时目录中覆盖两项目隔离、同步节流、单步备份、合成评测、导入计划
快照、1,000,000 token 边界、输出截断元数据、备份恢复和默认关闭遥测。真实记忆导入
闸门目前保持关闭;import-plan --dry-run 和 approve-import 都不会自动注册来源。
安装、只读启动、显式写入、备份恢复和客户端验收步骤见 RUNBOOK.md。
Pi / DeepSeek 的 1,000,000 token 任务上限、截断、重试与墙钟保护实测见
docs/worker-guard-validation.md。
Available Tools
1 toolcontext_getB
Search, read a stable ref, or inspect the public manifest. Responses include a context_hub invocation marker and source summary.
Inputs: op (required), ref, kinds, limit, +5 more. Returns: op, items, content, projects, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only a single tool, there is no possibility of confusing it with another tool. The tool's description clearly covers its purpose without overlapping with anything else.
The lone tool 'context_get' follows a clear snake_case convention with a verb_noun pattern. While there is no set to compare against, the name is consistent with common MCP naming practices.
Having only one tool for a context hub is severely under-scoped. The description implies multiple capabilities (search, read, inspect manifest) that would typically be split into separate tools, making the single tool feel like a catch-all.
The tool covers read-only operations but lacks any management, listing, or mutation capabilities. For a context hub, one would expect at least tools to create or update contexts, or to list available contexts, which are missing here.
Maintenance
Related MCP Connectors
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Linked markdown notes as memory for AI apps: search, read, save and link notes over MCP.
Your personal library, readable by AI agents: durable snapshots, hybrid search, 46 MCP tools.
Personal context for every AI: search, read, and write back to your private Markdown library.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server for indexing and searching research materials (papers, notes, logs, READMEs) using SQLite FTS, with tools for memory management and evidence retrieval.MIT
- AlicenseAqualityBmaintenanceIndexes local Markdown/text files into a SQLite database with vector embeddings and provides MCP tools for semantic search without cloud dependencies.31AGPL 3.0
- AlicenseCqualityAmaintenanceLocal-first MCP server that turns project documentation and source code into durable, evidence-backed context for AI agents, with bounded retrieval and explicit gap reporting.8256 npmApache 2.0
- AlicenseNot gradedqualityAmaintenanceA local-first MCP server that indexes Markdown/Obsidian folders and lets AI clients retrieve cited local context through MCP.MIT