# @vulhdev/knowledge-base [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/vulhdev/knowledge-base  
**GitHub Stars:** 4  
**npm Downloads (last month):** 626  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/vulhdev-knowledge-base

## Description
MCP server for persistent document storage with full-text search

## Tools
Capabilities this server exposes over MCP:

- **create_content** — Creates a document. Auto-creates the workspace and feature if they don't exist.
- **get_content** — Fetches a single document by its numeric ID. Returns all fields including `title` and `has_code_refs: boolean` — a zero-cost signal indicating whether any code refs are attached, so Claude can decide whether to call `get_code_refs` without fetching the data first.
- **list_contents** — Lists documents in a workspace, with optional filters for feature and/or type. Returns `title` on every row.
- **search_semantic** — Semantic (vector) search using a local ONNX embedding model combined with BM25 full-text search via Reciprocal Rank Fusion. Returns a `SearchPage` object — finds relevant content even when exact words don't match. Supports any natural language including Vietnamese.
- **update_content** — Updates the body (and optionally the type and title) of an existing document by ID. Omitting `title` preserves the existing value.
- **delete_content** — Permanently deletes a document by its numeric ID. Returns the deleted document.
- **create_version** — Creates a new version of an existing document. The new row gets `version_number = prev_max + 1` and `is_latest = 1`; the previous latest row is set to `is_latest = 0`. Features and content links are copied to the new version; code refs are not.
- **list_versions** — Returns all versions in a chain sorted by `version_number ASC`. Safe to call with any version ID in the chain — always resolves to the root and returns the full list.
- **attach_code_ref** — Links a git commit to a plan (or any document) at task granularity. Call this after each task commit so that resuming a plan in a new session immediately shows which tasks are done.
- **get_code_refs** — Returns all commits linked to a document, ordered by `created_at` ascending. Use when resuming a plan to see which tasks already have commits and which don't.
- **link_content** — Links two existing documents as parent → child. Use this after both documents already exist.
- **derive_content** — Creates a new document and links it to a parent in a single atomic step. Inherits the parent's workspace and feature.
- **open_for_review** — Creates a review session for a document and returns the GUI URL. The user opens the URL, selects text, adds inline comments, and clicks "Commit Review".
- **wait_for_review** — Long-polls SQLite every 500 ms until the user commits the review or the timeout expires.
- **get_pending_review** — Fetches the most recently committed review for a document, including all comments with their `resolved_at` state.
- **list_contents_with_pending_review** — Lists all documents that have at least one committed (unprocessed) review. Used by `/knowledge-base-review` when `content_id` is not in context. Returns an empty array when nothing is pending.
- **resolve_comment** — Marks a single review comment as resolved after Claude has processed it. Sets `resolved_at` in the database — the GUI immediately shows the comment with a green "✓ Resolved" badge.
- **resolve_review** — Marks an entire review as `resolved` after all comments have been processed. Only succeeds when the review is in `committed` state.
- **get_lineage** — Returns the full ancestry chain for a document — all ancestors (nearest → oldest) and all descendants (BFS order, nearest first).

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

```json
"mcpServers": {
  "knowledge-base": {
    "command": "npx",
    "args": ["-y","@vulhdev/knowledge-base"]
  }
}
```

## Documentation

## What @vulhdev/knowledge-base does

@vulhdev/knowledge-base gives MCP clients a persistent knowledge base for ideas, specifications, plans, feature documentation, digests, and other documents. Content is arranged in a three-level hierarchy: workspace, feature, and document. The database is stored locally in SQLite, so saved material remains available across Claude Code sessions without requiring a hosted service.

Documents can be created, read, listed, updated, and permanently deleted. Titles are optional but appear in list and search results. The server also models relationships between documents: `link_content` connects existing records, `derive_content` creates a child document while inheriting the parent workspace and feature, and `get_lineage` returns both ancestors and descendants.

## How it works

Semantic search combines vector similarity from a local ONNX embedding model with BM25 full-text search through Reciprocal Rank Fusion. It supports natural-language queries, including Vietnamese and other languages covered by the multilingual model. Title matches receive additional weight, recent documents receive a limited recency boost, and results can be paged with an offset.

Content versions are separate records in a version chain. `create_version` creates the next version and marks the previous latest record as no longer current; `list_versions` returns the complete chain in ascending order. Standard listing and semantic search operations expose only the latest version.

Plans or other documents can be associated with git commits at task granularity. Review sessions use the local GUI: Claude opens a document review URL, a user selects text and comments, and MCP tools wait for the committed review before comments and review status are resolved.

## Setup and configuration

The package requires Node.js 22.5 or later. Install it as a Claude Code plugin with the marketplace commands, or register the MCP server directly:

```bash
claude mcp add knowledge-base -- npx -y @vulhdev/knowledge-base
```

On first use, it creates `~/.claude/knowledge-base/settings.json` and stores the database at `~/.claude/knowledge-base/knowledge-base.db`. Running `npx @vulhdev/knowledge-base init` can associate a project with a workspace, download the roughly 120 MB embedding model, and install the bundled Claude Code skills and agents globally or in the current project.

Native compilation may require C++ build tools for `better-sqlite3`. Prebuilt binaries cover common platforms; if startup reports a native addon error, install the platform's build tools and run `npm rebuild better-sqlite3`.

The optional browser interface starts with `npx @vulhdev/knowledge-base gui` and listens on port 57891 by default. Its port can be changed with `PORT`.

## Tools and capabilities

- Create, retrieve, list, update, and delete documents.
- Search content with hybrid semantic and full-text ranking.
- Create and inspect document version chains.
- Link documents, derive child documents, and inspect lineage.
- Attach git commits to document tasks and retrieve commit coverage.
- Open reviews, wait for committed feedback, list pending reviews, and resolve comments or complete reviews.
- Use Claude Code skills for creation, search, import, export, exploration, digests, documentation analysis, review, feedback resolution, and version diffs.
- Inspect tool failures captured in the GUI's Errors view.

## Limitations and notes

Semantic search depends on the locally downloaded embedding model. The database and model are local files, and the server uses SQLite rather than an external service. Deleting a document is permanent. Code references are not copied when a new document version is created, although features and content links are copied. The bundled skills and agents are specifically intended for Claude Code.

_Full upstream README: https://allmcps.com/mcp/vulhdev-knowledge-base/readme_

