Labsco
MTimma logo

Knowerage

β˜… 3

from MTimma

Local MCP that allows your agent to keep track of code analysis coverage

πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup
<div align="center"> <img src="docs/assets/icon.png" alt="Knowerage project icon" width="128" /> </div>

Knowerage β€” AI Analysis Coverage Management

Links: GitHub Β· Glama MCP listing Β· npm @mtimma/knowerage

Alternative approaches

Install via npm

Copy & paste β€” that's it
npx @mtimma/knowerage

Or build from source

Copy & paste β€” that's it
cargo build --release
./target/release/knowerage-mcp

How It Works

  1. AI agent creates analysis .md files with YAML frontmatter declaring source file and covered line ranges
  2. Registry (knowerage/registry.json) tracks analysis records with SHA-256 hashes for freshness
  3. MCP tools expose create, reconcile, query, and export operations
  4. Agent says "analyze X" β†’ full workflow runs automatically (create β†’ reconcile β†’ record)

Registry file shape (knowerage/registry.json)

The on-disk format is a JSON object whose keys are analysis paths (strings). Each value is one record (see contracts/contracts.md). A full sample with two records lives at examples/registry.sample.json.

Copy & paste β€” that's it
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

Frontmatter for analysis .md files is specified separately in the contracts doc (metadata schema), not inside registry.json.

MCP Tools

ToolPurpose
knowerage_create_or_update_docCreate/update analysis document
knowerage_parse_doc_metadataParse and validate frontmatter
knowerage_reconcile_recordReconcile one analysis record
knowerage_reconcile_allFull rescan/rebuild
knowerage_get_file_statusAnalyzed vs missing ranges
knowerage_list_staleList stale/problematic records
knowerage_list_registryFull registry snapshot (same shape as registry.json, sorted keys)
knowerage_get_treeTree/grouped coverage
registry_export_reportExport snapshot (JSON/YAML/TXT/HTML)
knowerage_generate_bundleChunked export of selected analyses (toc*.md, combined*.md, manifest.json)

Project Structure

Copy & paste β€” that's it
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

Documentation

Security

  • All paths validated against workspace root
  • Path traversal (..) rejected
  • Atomic writes for registry (crash-safe)
  • No secrets in analysis files or reports
  • SHA-256 hash-based freshness (survives git pull)

License

MIT β€” copyright Martins Timma.

Parts of this project were written or refined with generative AI coding assistants. Human review applies to design, security-sensitive behavior, and releases.