
Hive Vault
io.github.mlorentedev由 GitHub 账号 mlorentedev 发布v1.12.2更新于 Oct 24, 2026
On-demand Obsidian vault access for AI coding assistants — 17 tools, 5 resources, 4 prompts.
概览
让 AI 编程助手按需读写 Obsidian 或 Markdown 知识库,并提供搜索、经验记录与任务委派能力。
- 可以做什么
- Hive Vault 把助手连接到本地 Markdown 知识库,提供 17 个工具以及若干资源和提示词。知识库工具可查询项目背景、任务、路线图和经验记录,执行带元数据过滤和正则的全文搜索,按 glob 浏览文件,并创建、追加、替换或局部修改文件。会话与 worker 工具可汇总简报、记录经验并按强化程度排序,还能把任务委派给本地 Ollama 或 OpenRouter 模型。
- 适用场景
- 当助手需要在多次会话之间把项目知识保存在 Markdown 知识库中,而不是每次重新加载静态上下文时,适合使用。尤其适合已用 Obsidian 记录笔记、文档或经验,并希望助手按需读取和更新的开发者。
- 运行要求
- 以 stdio 方式在本地运行,通过 uvx 从 PyPI 包 hive-vault 安装,需要 Python 3.12 或更高版本。VAULT_PATH 指向 Markdown 目录(默认 ~/Projects/knowledge)。可选:HIVE_OLLAMA_ENDPOINT 用于本地 worker 委派,OPENROUTER_API_KEY 用于云端备用 worker,HIVE_VAULT_SCOPES 用于作用域路由。仅支持桌面端。
安装
在 SourceWeft 中
- 打开 控制台中的 Hive Vault,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
hive-vault
[CI] [codecov] [PyPI] [Python 3.12+] [Docs] [License: MIT]
[图片]Your AI coding assistant forgets everything between sessions. Hive fixes that.
Hive is an MCP server that connects your AI assistant to an Obsidian vault. Instead of loading everything upfront, it queries only what's needed — on demand.
Only the token-cost row is a measurement (5 project-context queries on a real 493K-token vault; method and numbers in the benchmarks). The line counts and the retention row describe how the two setups work; they are not measured.
Quick Start
Hive runs without a vault — vault tools return a friendly error until VAULT_PATH is set, so you can install first and configure later.
Default vault path:
~/Projects/knowledge. Override withVAULT_PATH(orHIVE_VAULT_PATH) as shown above.
For Codex CLI, GitHub Copilot, Cursor, Windsurf, and other clients, see Getting Started.
Then ask your assistant: "Use vault_list to see my vault"
Requirements
Hive degrades gracefully — every recommended or optional dependency reveals more capability without breaking the baseline.
-
Required
- Python 3.12+ (works on 3.13).
- A directory of markdown files. The vault structure used by
00_meta/10_projects/50_work/80_agents/05_researchis optional — without it, vault tools still operate but the scope routing is flat.
-
Recommended
gitinitialised inside the vault. Without it,vault_write/vault_patchstill write to disk; they just skip the per-write commit (andvault_commitreports the working tree as untracked).- The Obsidian desktop app to author the vault by hand.
- The obsidian-git plugin with auto-commit set to 5–10 minutes. Pair it with
vault_write(commit=False)/vault_patch(commit=False)to push the git workload off the synchronous tool path; see Recommended configuration below.
-
Optional
- Any OpenAI-compatible
/v1endpoint as the worker fordelegate_task/capture_lesson, set withHIVE_WORKER_BASE_URL,HIVE_WORKER_API_KEYandHIVE_WORKER_MODEL. - A backup git remote (e.g. private GitHub repo) so vault history survives a disk loss.
- Any OpenAI-compatible
Recommended configuration
Per ADR-006 (commit policy), the recommended pairing for write-heavy flows is:
- Install and enable the obsidian-git plugin in your vault.
- Set its auto-commit interval to 5 or 10 minutes.
- Call
vault_write(..., commit=False)andvault_patch(..., commit=False)for all bulk operations. - Optionally call
vault_commit(message="...")at the end of a session to force a checkpoint sooner than the obsidian-git tick.
vault_health reports a ## external_committer block when it detects obsidian-git in the vault. The commit=False durability contract is explicit: files are persisted to disk regardless; only the commit is deferred. A crash before the next flush loses the commit, not the content.
When a tool call is cancelled mid-flight (slow worker, client timeout), the server may have already mutated the disk before the cancel ack reaches the wire. vault_health surfaces a ## ghost_responses counter and emits a mcp.ghost_response.suppressed_after_cancel_ack WARNING for each event — verify state via vault_query rather than retrying, since the ErrorData ack does not imply rollback (ADR-007).
Daemon mode (optional)
The default uvx hive-vault runs a fresh server per session. Daemon mode
instead runs one long-lived hive serve that owns the vault, with each
stdio-only session connecting through hive client. The adapter starts without
importing the Hive server or FastMCP, then relays JSON-RPC to the daemon's stable
loopback endpoint. If the daemon or credential is unavailable, it fails
explicitly rather than starting a competing in-process owner.
The default endpoint is a deterministic per-user port in 49152..65535, so an
ordinary daemon restart does not invalidate client configuration. Override it
with HIVE_DAEMON_PORT in both the daemon and every client environment when
the derived port conflicts with another local service. hive serve --port
changes only the daemon's bind port; it does not reconfigure hive client or
hive delegate. Hive fails closed rather than silently moving to a different
port. The owner-only bearer token persists across ordinary restarts in the daemon state
directory. daemon.port remains diagnostic migration metadata, not client
discovery state. See ADR-022.
Security hold: Until #456 is resolved, do not deploy daemon mode on untrusted multi-user hosts. The endpoint serves TLS with a per-user certificate that Hive's clients pin, so an impostor on the fixed port fails the handshake before any bearer is sent; the hold stays until the Linux and Windows evidence, including the cross-user check, is recorded.
Run hive client from your MCP host. A host that can verify the daemon's
certificate may connect directly to
https://127.0.0.1:<derived-or-overridden-port>/mcp (for Node-based hosts,
NODE_EXTRA_CA_CERTS pointing at daemon.crt in the state directory); never
disable verification, and note that http:// no longer works. Never print or
copy the token into logs or shell history.
To install a newer release, use the platform-specific command:
On Windows, self-upgrade builds the release beside the running files and atomically switches
the managed runtime, avoiding in-use-file conflicts. Open a new terminal after the first managed
upgrade so its PATH change is available. Once supervised, the daemon detects the new installed
version, exits 75, and the supervisor restarts it into the new code. See the
daemon mode guide and the
activation runbook.
Tools
Plus 5 resources and 4 prompts for guided workflows.
Lesson reinforcement
Every read of a lesson via vault_query, vault_search, or capture_lesson(find=…) increments a counter and grows that lesson's confidence asymptotically toward 1.0. Validated lessons rank higher than one-shot captures over time.
Storage: SQLite side-table at HIVE_LESSON_DB_PATH (default ~/.local/share/hive/lesson_reinforcement.db). WAL mode + busy_timeout make it cross-process safe.
Architecture
Documentation
Full documentation at mlorentedev.github.io/hive:
- Getting Started — install for all MCP clients
- Configuration — all 19 environment variables
- Vault Structure — how to organize your vault
- Use Cases — real-world workflows
- Architecture — module map and design decisions
- Troubleshooting — common issues and fixes
Project-bound knowledge (docs-as-code) lives in docs/:
docs/adr/— Architecture Decision Recordsdocs/runbooks/— operational proceduresdocs/troubleshooting/— known issues and root-cause write-upsdocs/lessons.md— accumulated gotchas and post-mortems
Contributing
See CONTRIBUTING.md for setup and PR workflow.
License
来源:README.md,提交 0429df9
工具
0版本历史
1- v1.12.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分