Knowerage
Knowerage — AI分析網羅率管理
レガシーコードの分析網羅率と鮮度を追跡するローカルファーストのMCPサーバー。
ソース: github.com/MTimma/knowerage
クイックスタート
要件: Node.js 18以上 — npx が PATH に含まれている必要があります(Node.jsに含まれるnpmに同梱されています)。
Related MCP server: Atlas
MCPサーバーの設定
MCPホストがサーバー定義を期待する場所にKnowerageを登録します(例えば、一部のクライアントは .cursor/mcp.json や .vscode/mcp.json を使用します。その他は環境変数やUIを使用します。ホストのドキュメントに従ってください)。同じサーバーエントリ形式を使用してください:
{
"mcpServers": {
"knowerage": {
"command": "npx",
"args": ["@mtimma/knowerage"],
"env": {
"KNOWERAGE_WORKSPACE_ROOT": "${workspaceFolder}",
"KNOWERAGE_AUTO_FULL_RECONCILE": "true"
}
}
}
}ホストが ${workspaceFolder} 変数を展開しない場合は、プロジェクトのルートパスに置き換えてください。
KNOWERAGE_AUTO_FULL_RECONCILE はオプションです。未設定、空、または真偽値として真でない場合、ファイル監視はデフォルトで オフ になります。有効にするには 1、true、yes、または on(トリミングされ、大文字小文字を区別しない)を設定します。オン の場合、サーバーは knowerage/ を監視し、短いデバウンスの後にファイルシステムの変更に対して knowerage_reconcile_all を実行します。これは、すべてのMCPツール呼び出しの後に完全な照合を実行するのとは異なります。knowerage/ 配下のファイル変更にのみ反応します。registry.json へのレジストリ書き込みは監視対象外となるため、保存時にループすることはありません。
Knowerageの使い方
MCPサーバーの設定後、通常の文章でアシスタントと対話します。ツール名を覚える必要はありません。
コードの分析またはドキュメント化
対象となるファイル、クラス、または動作を指定します。例:
Knowerageを使って、
main.javaの論理アルゴリズムワークフローを分析して。ETLサービスにおけるデータエンティティの照合とバージョン管理ロジックを分析して。
アシスタントは knowerage/analysis/ 配下にMarkdownを作成または更新し、knowerage/registry.json に網羅率を記録します(以下の 仕組み を参照)。
網羅率とギャップ(同じプロジェクト、後のチャットや別のエージェント)
ツリー内に分析が既に存在する場合、以下のように尋ねることができます:
コードの何パーセントが分析でカバーされていますか?
このコードベースのどの部分がまだ分析されていませんか?
Knowerageは、リポジトリについて曖昧な推測をするのではなく、レジストリと網羅率ヘルパー(概要、ファイルごとのステータス、古いリストなど)から回答します。
代替アプローチ
npm経由でインストール
npx @mtimma/knowerageまたはソースからビルド
cargo build --release
./target/release/knowerage-mcp仕組み
AIエージェントが、ソースファイルとカバーされた行範囲を宣言するYAMLフロントマターを含む分析
.mdファイルを作成しますレジストリ (
knowerage/registry.json) が、鮮度を保つためにSHA-256ハッシュを使用して分析レコードを追跡しますMCPツールが作成、照合、クエリ、エクスポート操作を公開します
エージェントが「Xを分析して」と言う → 自動的に完全なワークフローが実行されます(作成 → 照合 → 記録)
レジストリファイルの形式 (knowerage/registry.json)
ディスク上の形式は、キーが分析パス(文字列)である JSONオブジェクト です。各値は1つの レコード です(contracts/contracts.md を参照)。2つのレコードを含む完全なサンプルは 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分析 .md ファイルのフロントマターは、registry.json 内ではなく、contractsドキュメント(メタデータスキーマ)で個別に指定されます。
MCPツール
ツール | 目的 |
| 分析ドキュメントの作成/更新 |
| フロントマターの解析と検証 |
| 1つの分析レコードの照合 |
| 完全な再スキャン/再構築 |
| 分析済み範囲と未分析範囲の比較 |
| 古い/問題のあるレコードのリスト |
| 完全なレジストリスナップショット( |
| ツリー/グループ化された網羅率 |
| スナップショットのエクスポート (JSON/YAML/TXT/HTML) |
| 選択した分析のチャンクエクスポート ( |
プロジェクト構造
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ドキュメント
ユーザーオンボーディング — セットアップ、設定、一般的な使用方法
INSTRUCTIONS.md — MCPエージェントの指示
コントラクト — スキーマとAPIコントラクト(レジストリ + フロントマター)
レジストリJSONの例 —
registry.jsonのサンプル内容
セキュリティ
すべてのパスはワークスペースルートに対して検証済み
パストラバーサル (
..) は拒否レジストリの原子的な書き込み(クラッシュセーフ)
分析ファイルやレポートに機密情報は含まれません
SHA-256ハッシュベースの鮮度管理(git pull後も維持)
ライセンス
MIT — copyright Martins Timma.
このプロジェクトの一部は、生成AIコーディングアシスタントを使用して作成または洗練されました。設計、セキュリティに敏感な動作、およびリリースについては人間によるレビューが適用されます。
Available Tools
11 toolsknowerage_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
Scored across 11 tools
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.
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.
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.
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
MCP Server for an Agent Task Marketplace
MCP server for querying Forkast documentation
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseBqualityNot gradedmaintenanceMCP server for collecting code from files and directories into a single markdown document.28MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server for querying multi-repo engineering documentation artifacts from a SQLite corpus.5 npmAGPL 3.0
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.MIT
- FlicenseNot gradedqualityDmaintenanceLocal 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-