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 產生的概覽

讓 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 用於作用域路由。僅支援桌面端。
安裝前請注意
此伺服器會寫入知識庫:vault_write、vault_patch 與 vault_commit 會建立、修改並提交檔案,且呼叫被取消時磁碟可能已被變更。OPENROUTER_API_KEY 是密鑰,可能產生付費用量,說明中稱上限約為每月 1 美元。守護行程模式處於安全暫停狀態,不應部署在不受信任的多使用者主機上;切勿把其 bearer 權杖列印或複製到日誌或 shell 歷史中。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Hive Vault,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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.

MetricWithout HiveWith Hive
Context loaded per session~800 lines (static)~50 lines (on demand)
Token cost for context100% every session0.6% for five project-context queries (real vault, 493K tokens)
Knowledge retained between sessions0%100% (in vault)

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.

bash
# Minimal — uses default vault path ~/Projects/knowledgeclaude mcp add -s user hive -- uvx --upgrade hive-vault
# With a custom vault pathclaude mcp add -s user hive -e VAULT_PATH=$HOME/path/to/vault -- uvx --upgrade hive-vault
# Gemini CLIgemini mcp add -s user -e VAULT_PATH=$HOME/path/to/vault hive-vault uvx -- --upgrade hive-vault

Default vault path: ~/Projects/knowledge. Override with VAULT_PATH (or HIVE_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_research is optional — without it, vault tools still operate but the scope routing is flat.
  • Recommended

    • git initialised inside the vault. Without it, vault_write / vault_patch still write to disk; they just skip the per-write commit (and vault_commit reports 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 /v1 endpoint as the worker for delegate_task / capture_lesson, set with HIVE_WORKER_BASE_URL, HIVE_WORKER_API_KEY and HIVE_WORKER_MODEL.
    • A backup git remote (e.g. private GitHub repo) so vault history survives a disk loss.

Recommended configuration

Per ADR-006 (commit policy), the recommended pairing for write-heavy flows is:

  1. Install and enable the obsidian-git plugin in your vault.
  2. Set its auto-commit interval to 5 or 10 minutes.
  3. Call vault_write(..., commit=False) and vault_patch(..., commit=False) for all bulk operations.
  4. 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.

bash
uv tool install --upgrade hive-vault   # >= 1.32.0hive service install                   # supervise hive serve (systemd --user / Task Scheduler)hive service status                    # exit 0 only if the listener proves the daemon's certificate

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:

bash
# Linux / macOSuv tool upgrade hive-vault
# Windows (the version is optional; omitted selects the latest PyPI release)hive self-upgrade [version]

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

ToolWhat it does
vault_queryLoad project context, tasks, roadmap, lessons — or any file by path
vault_searchFull-text search with metadata filters, regex, ranked results, recent changes, lesson-usage ranking (rank_by)
vault_listBrowse projects and files with glob filtering
vault_askOptional semantic Q&A with source citations; disabled until an embeddings backend is configured ([semantic] extra)
vault_healthServer identity (version, vault path, backends), health metrics, drift detection, usage stats, opt-in runtime block
vault_writeCreate, append, or replace vault files. commit=False defers the git commit for batching
vault_patchSurgical find-and-replace. commit=False defers the git commit for batching
vault_commitFlush pending commit=False writes into one git commit
vault_deleteDelete one file, committed synchronously so it stays recoverable from git history
capture_lessonCapture lessons inline / batch-extract from text / look up existing lessons by keyword (find=)
session_briefingTasks + lessons + git log + health in one call
delegate_taskRoute tasks to cheaper models or summarize vault files
worker_statusWhether the worker is configured and reachable, its model, and usage

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.

bash
# Surface the top-ranked lessons matching a keywordcapture_lesson(project="hive", find="multi-process")
# Search lessons ranked by usage signal (not BM25)vault_search(query="timeout", rank_by="reinforcements")    # most-reinforced firstvault_search(query="timeout", rank_by="confidence")        # highest decayed confidencevault_search(query="timeout", rank_by="hybrid")            # α=0.7 BM25 + 0.3 confidence

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

MCP Host (Claude Code, Gemini CLI, Codex CLI, Cursor, ...)    └── hive-vault (MCP server, stdio)            ├── Vault Tools (9) ── Obsidian vault (Markdown + YAML frontmatter)            ├── Session Tools (1) ── Adaptive context assembly            └── Worker Tools (3) ── one OpenAI-compatible endpoint, no internal fallback

Documentation

Full documentation at mlorentedev.github.io/hive:

Project-bound knowledge (docs-as-code) lives in docs/:

Contributing

See CONTRIBUTING.md for setup and PR workflow.

bash
git clone https://github.com/mlorentedev/hive.git && cd hivemake install   # create venv + install depsmake check     # lint + typecheck + test (478 tests, 90% coverage)

License

MIT

來源:README.md,提交 0429df9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.12.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分