# mlorentedev/hive [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/mlorentedev/hive  
**GitHub Stars:** 10  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mlorentedev-hive

## Description
On-demand Obsidian vault access via MCP. Adaptive context loading (67-82% token savings), full-text and ranked search, health checks, auto git commit, and worker delegation to cheaper models. 10 tools, works with any MCP client.

## Tools
Capabilities this server exposes over MCP:

- **vault_list** — List vault projects, or files within a project.

When called without arguments, lists all available projects.
When called with a project, lists files in that project directory.
- **vault_query** — Read content from a vault project — use instead of direct filesystem access.
- **vault_search** — Search the vault: full-text, ranked, or recent changes.

Default mode: flat full-text search across all vault files.
Ranked mode (ranked=True): results scored by relevance.
Recent mode (since_days>0): files changed in the last N days.
rank_by mode (rank_by != 'bm25'): lessons-only, ranked by usage.
- **session_briefing** — Call at the start of every new session to load project context.

Without a project, returns the available project list with a usage
hint — discoverability parity with vault_health() and worker_status().
With a project, assembles active tasks, recent lessons, git activity,
and project health into a single response (replaces 3-4 manual calls).
- **vault_write** — Write to the vault: append, replace a section, or create a new file.

Modes:
- append/replace: Update a project section. Requires section.
- create: Create a new file. Requires path, relative to the project
  directory. Frontmatter is generated (doc_type defaults to "note")
  unless content opens with its own block, which is kept as is.
  Inferred automatically when you pass a path with no section, so
  operation may be omitted.
- **vault_patch** — Surgical find-and-replace in a vault file with auto git commit.

Supports single or multi-replacement. For a single replacement, provide
``find`` and ``replace``. For multiple replacements, provide ``patches``
— a list of ``{"find": "...", "replace": "..."}`` dicts applied in
sequence. Do not mix both modes.

Each ``find`` value must appear exactly once in the file (after prior
patches in the list have been applied). If any patch fails validation,
no changes are written.

Uses 3-pass cascading match: exact → body-only → whitespace-normalized.
- **vault_commit** — Commit every unstaged and untracked change in the vault, in one commit.

Companion to ``vault_write(commit=False)`` and
``vault_patch(commit=False)``: callers that opt out of per-write
commits batch many writes and then flush with a single
``vault_commit`` call.

It also sweeps edits made outside hive. A path that already has a
staged change is left out and named in the result: it belongs to
whoever staged it, often another session sharing the vault. Commit
one deliberately with ``git commit -- <path>``.

Returns the new commit SHA on success, a clean-tree notice when
there is nothing to commit, or a human-readable error.
- **vault_delete** — Delete a single file from the vault (destructive; recoverable via git).

Removes one file and, by default, commits the deletion so it stays
recoverable from git history (``git revert`` / ``git show``). Files
only — directories are rejected. A non-existent path is an error,
unless ``idempotency_key`` is set (then a retry against an already-gone
file is a no-op success).
- **vault_health** — Return vault health metrics, validation, and optional usage analytics.

Always emits the ``## server`` identity block (version, python,
vault path, backend presence, started_at) at the top.

Without parameters, returns a health summary for all projects.
When checks are specified, runs drift detection (frontmatter, stale, links).
When include_usage is True, appends tool usage analytics.
When include_runtime is True, appends runtime metadata (uptime, tools, budget).
- **capture_lesson** — Capture lessons: inline / batch write, or lookup by keyword.

Inline mode (default): provide title, context, problem, solution.
Batch mode: provide text to extract lessons automatically via worker.
Lookup mode: provide ``find`` to surface top-ranked existing
lessons whose heading matches the keyword.
- **delegate_task** — Offload work to a cheaper model or summarize vault files.

When project is provided, reads a vault file. Small files (≤50 lines)
are returned directly. Large files are auto-delegated to a worker for
summarization — falls back to raw content if workers are unavailable.
- **worker_status** — Show worker health: configuration, reachability, model, and usage.

HIVE-384 reshaped this tool, and the reshape is the point rather than a
side effect. The old output led with a dollar budget and reported two
providers by *configuration*: it said "Ollama: offline / OpenRouter: no
API key" for an unknown length of time while every caller treated the
worker as a working capability. A status surface that cannot distinguish
"configured" from "answers" is how a dead backend stays invisible.

So reachability is **probed, not inferred**, and reported separately
from configuration. The dollar figures are gone: NaN bills in credits and
exposes no per-request cost, so they would read zero forever, and a
gauge that always says the same thing looks like a working gauge.
- **vault_ask** — Ask a natural-language question; get a source-cited synthesized answer
(semantic retrieval / RAG) or relevant vault sections when no synthesis
model is configured.

OPTIONAL — disabled by default. Requires the `[semantic]` extra plus an
embeddings backend (`HIVE_EMBED_BASE_URL`); until then it returns a
short how-to-enable message and never errors. Set `HIVE_SYNTH_MODEL` to
enable LLM synthesis on top of retrieval. For keyword / regex lookups
use `vault_search` instead.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "hive": {
    "command": "uvx",
    "args": ["--upgrade","hive-vault"]
  }
}
```

## Documentation

## What mlorentedev/hive does

mlorentedev/hive gives an AI assistant MCP access to an Obsidian vault stored as Markdown files. It supports project discovery, file reads, full-text and relevance-ranked search, recent-change queries, context briefings, structured lesson capture, and controlled file updates. The vault remains the persistent source of project context between assistant sessions.

The server is suited to coding workflows where an agent needs to recover active tasks, recent lessons, Git activity, or project health without loading every file. Its tools can also create files, update sections, apply exact patches, remove files, and commit changes. Write and patch operations can either commit individually or defer commits for later batching.

## How it works

`vault_list` discovers projects and files, while `vault_query` reads content through the server rather than requiring direct filesystem access. `vault_search` handles flat full-text search by default and can return relevance-ranked results, recently changed files, or lesson results ranked by usage. `session_briefing` combines project context into one response for the beginning of a session.

Git is used as the recovery layer when initialized inside the vault. `vault_patch` validates each replacement and applies multiple patches in sequence only when their match conditions succeed. `vault_delete` removes files rather than directories and normally commits the deletion, allowing recovery through Git history. `vault_commit` collects pending and external unstaged changes into one commit while leaving already staged paths alone.

`delegate_task` reads a vault file directly when it is small and can send larger files to a configured worker for summarization. `capture_lesson` supports inline entry, batch extraction through a worker, and keyword lookup. `vault_ask` provides semantic retrieval with source-cited synthesis when its optional embedding and synthesis backends are enabled; otherwise, keyword and regular-expression lookups belong in `vault_search`.

## Setup and configuration

The baseline requires Python 3.12 or newer and a directory containing Markdown files. Install and run it with `uvx --upgrade hive-vault`; a vault is not needed for the process to start. Vault operations use `~/Projects/knowledge` by default, or a custom path supplied through `VAULT_PATH` or `HIVE_VAULT_PATH`.

A Git repository inside the vault enables per-write commits, deletion recovery, and `vault_commit`. For bulk changes, calls can use `commit=False` and finish with one explicit `vault_commit`. An Obsidian installation is useful for manual editing, and the obsidian-git plugin can handle periodic commits.

Worker delegation and automated lesson extraction accept an OpenAI-compatible `/v1` endpoint configured with `HIVE_WORKER_BASE_URL`, `HIVE_WORKER_API_KEY`, and `HIVE_WORKER_MODEL`. Semantic Q&A requires the `semantic` extra and an embeddings endpoint configured with `HIVE_EMBED_BASE_URL`; `HIVE_SYNTH_MODEL` adds language-model synthesis to retrieved material.

## Limitations and notes

The recommended vault organization is optional. Without the expected project directories, vault tools still operate with flat scope routing. Without Git, writes continue to reach disk but per-write commits are skipped.

Daemon mode provides a long-lived local owner for the vault, but it should not be deployed on untrusted multi-user hosts while the documented security hold remains unresolved. Canceled calls can leave a disk mutation completed before the cancellation acknowledgement arrives; verify state with `vault_query` instead of assuming rollback. Semantic Q&A is disabled until its optional dependencies and backend are configured.

_Full upstream README: https://allmcps.com/mcp/mlorentedev-hive/readme_

