Skip to main content
Glama

Knowerage — Verwaltung der KI-Analyseabdeckung

Ein Local-First MCP-Server, der die Abdeckung und Aktualität von Legacy-Code-Analysen verfolgt.

Quelle: github.com/MTimma/knowerage

Schnellstart

Voraussetzungen: Node.js 18 oder neuer — npx muss in Ihrem PATH vorhanden sein (es wird mit npm geliefert, das in Node enthalten ist).

Related MCP server: Atlas

MCP-Server-Konfiguration

Registrieren Sie Knowerage dort, wo Ihr MCP-Host Serverdefinitionen erwartet (einige Clients verwenden beispielsweise .cursor/mcp.json oder .vscode/mcp.json; andere nutzen Umgebungsvariablen oder eine Benutzeroberfläche – folgen Sie der Dokumentation Ihres Hosts). Verwenden Sie das gleiche Format für den Servereintrag:

{
  "mcpServers": {
    "knowerage": {
      "command": "npx",
      "args": ["@mtimma/knowerage"],
      "env": {
        "KNOWERAGE_WORKSPACE_ROOT": "${workspaceFolder}",
        "KNOWERAGE_AUTO_FULL_RECONCILE": "true"
      }
    }
  }
}

Ersetzen Sie ${workspaceFolder} durch Ihr Projektstammverzeichnis, falls Ihr Host diese Variable nicht auflöst.

KNOWERAGE_AUTO_FULL_RECONCILE ist optional: Wenn es nicht gesetzt, leer oder kein wahrheitsgemäßer Wert ist, ist der Datei-Watcher standardmäßig aus. Setzen Sie es auf 1, true, yes oder on (getrimmt, unabhängig von Groß-/Kleinschreibung), um es zu aktivieren. Wenn es an ist, überwacht der Server knowerage/ und führt nach einer kurzen Entprellung bei Dateisystemänderungen knowerage_reconcile_all aus. Das ist nicht dasselbe wie ein vollständiger Abgleich nach jedem MCP-Tool-Aufruf – es reagiert nur auf Dateiänderungen unter knowerage/. Schreibvorgänge der Registrierung in registry.json werden vom Watcher ignoriert, damit Speichervorgänge keine Endlosschleifen verursachen.

Verwendung von Knowerage

Nachdem der MCP-Server konfiguriert ist, sprechen Sie in normalen Sätzen mit Ihrem Assistenten. Sie müssen sich keine Tool-Namen merken.

Code analysieren oder dokumentieren

Verweisen Sie auf Dateien, Klassen oder Verhalten, die Sie interessieren. Zum Beispiel:

  • Analysiere mit Knowerage den logischen Algorithmus-Workflow in main.java.

  • Analysiere die Logik zur Datenentitätsabgleichung und Versionierung im ETL-Service.

Der Assistent erstellt oder aktualisiert Markdown-Dateien unter knowerage/analysis/ und protokolliert die Abdeckung in knowerage/registry.json (siehe Funktionsweise unten).

Abdeckung und Lücken (gleiches Projekt, späterer Chat oder anderer Agent)

Wenn Sie bereits Analysen im Baum haben, können Sie fragen:

  • Wie viel Prozent des Codes ist durch unsere Analyse abgedeckt?

  • Welcher Teil dieser Codebasis ist noch nicht analysiert?

Knowerage beantwortet dies basierend auf der Registrierung und den Abdeckungs-Hilfsprogrammen (z. B. Übersicht, Status pro Datei und Listen veralteter Einträge) – nicht durch vage Vermutungen über das Repository.

Alternative Ansätze

Installation via npm

npx @mtimma/knowerage

Oder aus dem Quellcode bauen

cargo build --release
./target/release/knowerage-mcp

Funktionsweise

  1. Der KI-Agent erstellt Analyse-.md-Dateien mit YAML-Frontmatter, das die Quelldatei und die abgedeckten Zeilenbereiche deklariert.

  2. Die Registrierung (knowerage/registry.json) verfolgt Analyse-Datensätze mit SHA-256-Hashes für die Aktualität.

  3. MCP-Tools stellen Operationen zum Erstellen, Abgleichen, Abfragen und Exportieren bereit.

  4. Der Agent sagt "analysiere X" → der vollständige Workflow läuft automatisch ab (erstellen → abgleichen → protokollieren).

Format der Registrierungsdatei (knowerage/registry.json)

Das Format auf der Festplatte ist ein JSON-Objekt, dessen Schlüssel Analysepfade (Strings) sind. Jeder Wert ist ein Datensatz (siehe contracts/contracts.md). Ein vollständiges Beispiel mit zwei Datensätzen finden Sie unter examples/registry.sample.json.

flowchart TB
  subgraph file["knowerage/registry.json"]
    O["Top-level JSON object"]
    O --> K["Each key: analysis markdown path, e.g. knowerage/analysis/.../topic.md"]
    K --> V["Value: one RegistryRecord"]
  end

  subgraph rec["RegistryRecord fields"]
    ap["analysis_path · source_path"]
    cr["covered_ranges: [[start,end], ...]"]
    h["analysis_hash · source_hash (sha256:… )"]
    t["record_created_at · record_updated_at (ISO 8601)"]
    st["status: fresh | stale_doc | stale_src | missing_src | dangling_doc"]
  end

  V --> rec

Das Frontmatter für Analyse-.md-Dateien wird separat im Contracts-Dokument (Metadaten-Schema) spezifiziert, nicht innerhalb der registry.json.

MCP-Tools

Tool

Zweck

knowerage_create_or_update_doc

Analysedokument erstellen/aktualisieren

knowerage_parse_doc_metadata

Frontmatter parsen und validieren

knowerage_reconcile_record

Einen Analysedatensatz abgleichen

knowerage_reconcile_all

Vollständiger Scan/Neuaufbau

knowerage_get_file_status

Analysierte vs. fehlende Bereiche

knowerage_list_stale

Veraltete/problematische Datensätze auflisten

knowerage_list_registry

Vollständiger Registrierungs-Snapshot (gleiches Format wie registry.json, sortierte Schlüssel)

knowerage_get_tree

Baum/gruppierte Abdeckung

registry_export_report

Snapshot exportieren (JSON/YAML/TXT/HTML)

knowerage_generate_bundle

Chunked-Export ausgewählter Analysen (toc*.md, combined*.md, manifest.json)

Projektstruktur

knowerage/                  # Created per-project
├── analysis/              # Analysis markdown files
│   └── **/*.md
└── registry.json          # Coverage registry

src/                       # Rust MCP server
├── main.rs
├── lib.rs
├── types.rs
├── parser.rs
├── registry.rs
├── mcp.rs
├── security.rs
└── export.rs

Dokumentation

Sicherheit

  • Alle Pfade werden gegen das Arbeitsverzeichnis validiert

  • Pfad-Traversal (..) wird abgelehnt

  • Atomare Schreibvorgänge für die Registrierung (absturzsicher)

  • Keine Geheimnisse in Analysedateien oder Berichten

  • SHA-256-Hash-basierte Aktualitätsprüfung (übersteht git pull)

Lizenz

MIT — Copyright Martins Timma.

Teile dieses Projekts wurden mit generativen KI-Coding-Assistenten geschrieben oder verfeinert. Menschliche Überprüfung gilt für Design, sicherheitsrelevantes Verhalten und Releases.

Available Tools

11 tools
knowerage_coverage_overviewA

Batch coverage overview for all source files. Returns per-source coverage percentage, analyzed/missing ranges, range attribution, stale records, and project-wide file/line totals. Uses fresh records only for coverage calculation. Optional extensions filter applies to sources, stale list, and project scan.

Inputs: extensions.

knowerage_create_or_update_docA

PRIMARY tool for persisting legacy/source code analysis: create or update an analysis markdown file under knowerage/analysis/ with YAML frontmatter (source path, covered line ranges, dates). Use this whenever the user asks to analyze, document, or explain a source file and Knowerage is in the tool list—do not use generic file-write tools alone for knowerage analysis paths, or the registry will not stay consistent. Follow with knowerage_reconcile_record on the same analysis_path.

Inputs: analysis_path (required), content (required), covered_lines (required), source_path (required).

knowerage_generate_bundleA

Export selected analysis markdown files into chunked NotebookLM-style bundles under output_dir: writes toc.md + combined.md for part 1, toc_N.md + combined_N.md for further parts when size limits require splitting, plus manifest.json (files, errors, part metadata). Every analysis_paths entry is validated under the workspace (no traversal). Per-file and per-part size limits apply (see contracts).

Inputs: analysis_paths (required), output_dir (required).

knowerage_get_file_statusA

Per-source coverage: total lines, analyzed vs missing ranges, and which analysis paths claim them. Prefer this over guessing from open files when answering 'what is documented for this source?' while Knowerage is enabled.

Inputs: source_path (required).

knowerage_get_treeC

Get a tree view of analysis records grouped by directory

Inputs: group_by, root.

knowerage_list_registryA

Return the full analysis coverage registry in one structured JSON response. USE THIS when you need an inventory of which source files are documented, where the analysis markdown lives, which line ranges are claimed, and freshness (fresh/stale_doc/stale_src/missing_src/dangling_doc). The records object is the same shape as the entire knowerage/registry.json file (sorted keys for stable reading). Call early when planning documentation work, finding gaps, or mapping analysis paths to sources—instead of opening registry.json by hand. Optional filters: analysis_path_prefix narrows by analysis key; statuses limits to given status values (same strings as in each record). After reconcile_record/reconcile_all, call again if you need the latest snapshot.

Inputs: analysis_path_prefix, statuses.

knowerage_list_staleB

List registry records filtered by staleness status

Inputs: statuses.

knowerage_parse_doc_metadataB

Parse YAML frontmatter from an analysis markdown file

Inputs: analysis_path (required).

knowerage_reconcile_allA

Rescan all analysis markdown files matching the glob and rebuild registry entries. Use after git pull, bulk edits, or when the registry may be empty or out of date; prefer reconcile_record when only one file changed.

Inputs: analysis_glob.

knowerage_reconcile_recordA

MANDATORY after every create_or_update_doc (or manual edit) to one analysis file: reconciles that analysis into knowerage/registry.json (hashes, covered_ranges, freshness). Call immediately after writing analysis content so coverage is recorded; skipping this leaves the registry wrong or stale.

Inputs: analysis_path (required).

registry_export_reportB

Export the registry as a report file in json, yaml, txt, or html format

Inputs: format (required), output_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct operation: coverage overview per batch, per-source status, registry listing with filters, doc creation/update, reconciliation, bundle generation, tree view, metadata parsing, stale listing, and export. Even overlapping tools like list_registry and list_stale are clearly differentiated by filters and purpose.

    Naming Consistency3/5

    All tools use the 'knowerage_' prefix except for 'registry_export_report', which breaks the pattern. Within the prefixed group, naming follows a consistent verb_noun style (e.g., get_file_status, create_or_update_doc, reconcile_record). The one outlier lowers the score.

    Tool Count5/5

    With 11 tools, the server covers the core operations of a documentation coverage system (CRUD-like, reconciliation, reporting, exploration) without being excessive. Each tool serves a clear purpose and none feel redundant.

    Completeness4/5

    The tool surface covers creation/update, reconciliation (single and bulk), listing, coverage overview, bundle generation, metadata parsing, and export. Missing a direct delete tool for docs, but the create_or_update tool may handle updates. Overall, agents can perform most tasks without dead ends.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Local MCP server that indexes documentation from URLs/files into a vector database, enabling coding agents to search and use up-to-date library and API documentation.
      1
      -