@opencodehub/mcp
OpenCodeHub — stdio MCP server exposing code-graph + group tools
Versions
0.5.0latest0.4.50.4.40.4.30.4.2+ show 5 moreshow less
0.3.20.3.10.3.00.2.00.1.0Tools 26
detect_changes Parse the repo's git diff for the requested scope (unstaged, staged, all, or compared to a ref) and map every changed line back to indexed symbols. Lists the affected processes so agents can spot flows impacted by a commit before pushing.
list_findings_delta Diff the latest scan (`.codehub/scan.sarif`) against the frozen baseline (`.codehub/baseline.sarif` by default) and return findings bucketed into new / fixed / unchanged / updated, keyed on `partialFingerprints['opencodehub/v1']`. Read-only: reads SARIF files, writes nothing.
list_dead_code Classify every callable / type in the indexed graph as live, dead, or unreachable-export and return the non-live set. Also surfaces ghost communities — Leiden clusters whose every member is classified non-live.
risk_trends Classify each community's recent risk arc over persisted snapshots. Returns { trend: accelerating_risk | degrading | improving | stable, projectedRisk30d, currentRisk } per community plus an overall trend. Snapshots are populated by `codehub analyze`; if the history is empty this tool returns overallTrend='stable' and an empty map.
group_query Run BM25 against every repo in a named group and fuse the per-repo rankings with Reciprocal Rank Fusion (RRF, k=60). Useful when a concept spans client and server repos. Repos are visited in alphabetical order so ties are deterministic. Per-repo errors are reported in `per_repo[].error` and `warnings[]` — the fan-out never aborts on a single-repo failure.
tool_map Enumerate Tool nodes detected by the tools ingestion phase, optionally filtered by name substring. Returns name, file_path, description, and the parsed input schema (JSON-decoded when available, raw string when unparseable, null when unset). Read-only.
scan Spawn Semgrep + Betterleaks + OSV-Scanner (+ Bandit/Biome when the project profile supports them), merge their SARIF outputs, write `.codehub/scan.sarif`, and return a summary. Selected scanners default to the polyglot set filtered by ProjectProfile.languages. IMPORTANT: this tool has filesystem effects and spawns external processes.
shape_check For each Route matching the filter, walk ACCESSES edges from the consumer files that FETCH this route and compare accessed property names against Route.responseKeys. Returns MATCH / MISMATCH / PARTIAL per consumer. Read-only.
list_findings Enumerate static-analysis findings stored as Finding nodes, filtered by severity, scanner, rule id, or file path substring. Findings are populated by `codehub ingest-sarif` or `codehub scan`.
list_repos Enumerate every repo that has been indexed by codehub on this machine. Returns name, on-disk path, last-seen commit, index timestamp, and node/edge counts per repo. Call this before any repo-scoped tool when you do not already know the repo name.
context Resolve a symbol to its graph node and return categorised incoming/outgoing edges (calls, imports, accesses, has_method, has_property, extends, implements, method_overrides, method_implements), process participation, OpenAPI operation links for Route targets, and file location. Use `uid` for zero-ambiguity lookup, or narrow a common name with `file_path` and/or `kind`; when a name still matches more than one node the response is a candidate list for you to pick from. Set `include_content: true` to attach the indexed source (capped at 2000 characters). The response also carries a `confidenceBreakdown` (confirmed / heuristic / unknown) tallying the provenance tier of every edge surfaced — so callers can tell whether the neighbourhood is backed by an LSP oracle or by heuristics. When the `coverage` overlay phase ingested a report, an optional `coverage` field reports `{ percent (0–1), covered, source }` for the target (per-symbol when available, else inherited from its enclosing file). The field is OMITTED when no coverage was ingested — absent coverage is UNKNOWN, never 0%, so do not treat a missing `coverage` field as untested. Finally, a top-level `cochanges` field lists files often edited together with the target's enclosing file, ranked by lift. These come from the dedicated `cochanges` table (git history), are strictly a statistical signal, and MUST NOT be treated as static code dependencies.
impact Walk the graph from a target symbol and group dependents by traversal depth. Depth-1 nodes will definitely break if the target's contract changes; depth-2 very likely; depth-3+ transitive. Returns a risk band (LOW/MEDIUM/HIGH/CRITICAL) derived from impactedCount + process count, plus `byDepth` groups, `affected_processes`, `affected_modules`, and a `confidenceBreakdown` (confirmed / heuristic / unknown) tallying the provenance tier of every edge traversed — low-risk verdicts are only trustworthy when `heuristic` and `unknown` are small relative to `confirmed`. When the `coverage` overlay phase ingested a report and the target has direct dependents, an optional `untestedBlastRadius` field classifies the depth-1 dependents into `untested` (known coverage below the threshold), `tested`, and `unknownCoverage` (no coverage ingested) — so you can see which directly-impacted symbols will break silently. Dependents with no ingested coverage land in `unknownCoverage`, NEVER in `untested`: absent coverage is UNKNOWN, not 0%, so do not read a missing field or an empty `untested` list as fully untested. Ambiguous names return an INVALID_INPUT error with a candidate list so the caller can re-invoke with `target_uid`, `file_path`, or `kind`. A side-section `cochanges` field lists files historically co-edited with the target's enclosing file, ranked by lift. These come from git history, not the call graph, and MUST NOT be mixed into the impactedNodes list.
group_cross_repo_links Emit the sourced, alpha-sorted cross-repo link graph for a named group. Loads the persisted ContractRegistry from `group_sync` and emits a `CrossRepoLink[]` with `depends_on` (consumer → producer) and `consumer_of` (producer → consumer) relations per matched contract. The `codehub-document` skill embeds this array verbatim into `.docmeta.json` v2's `cross_repo_links[]` field during Phase E; the skill also renders the `## See also (other repos in group)` footer from it. If `group_sync` has not run, `links` is empty and the hint directs the caller to run it first.
group_status Report per-repo index freshness for every repo in a named group. Returns node/edge counts, last-indexed timestamp, last commit, and a best-effort staleness envelope so the agent can decide whether to re-analyze before querying.
group_sync Walk every repo in a named group, run HTTP / gRPC / topic contract extractors, and write `<home>/.codehub/groups/<name>/contracts.json`. Returns a summary of extracted contracts + cross-links. Use this before calling `group_contracts` when you want the registry to reflect the current working tree.
sql signature Return a class/interface declaration plus its method and property signatures with bodies elided (stub syntax per language). For a standalone function, returns a single signature. Saves tokens vs reading the whole file.
group_list Enumerate every cross-repo group defined under ~/.codehub/groups. Groups bundle already-indexed repos so an agent can run one query across a whole stack (web-client + api-server + shared libs). Returns each group's name, creation timestamp, optional description, and constituent repos.
group_contracts Two-part surface for cross-repo contract discovery. (1) Match unresolved FETCHES edges (consumer) against Route nodes (producer) across every repo in the group — this is the graph-derived HTTP surface. (2) When `group_sync` has written a contracts.json under `<home>/.codehub/groups/<name>/`, surface its cross-links with signature + file + line for HTTP, gRPC, and topic pairings. Use this to audit cross-repo coupling after a schema change in a shared API or proto.
owners Enumerate the ranked set of Contributors linked to a node via OWNED_BY edges. Source is git blame; emails are SHA-256 hashed by default (plain emails only when ingestion ran with --plain-emails).
pack_codebase Produce a snapshot of a registered repo. The default `pack` engine writes the deterministic
api_impact Score the blast radius of changing a Route's contract. Returns risk (LOW/MEDIUM/HIGH/CRITICAL) plus the consumer files, middleware handlers, shape mismatches, and affected Process flows for every matching Route. Read-only.
query change_pack Deterministic, diff-scoped context pack for a git range: the impacted upstream subgraph (retained, not collapsed), the 5-tier verdict, the affected tests, and o200k_base token-cost attribution (tokens saved vs. opening every impacted file blind). CI-oriented — read-only, no LLM, byte-deterministic with a content hash.
verdict Composite diff verdict: auto_merge | single_review | dual_review | expert_review | block. Aggregates blast radius, community boundaries, findings, orphan grade, fix-follow-feat density, and ownership into a single decision with confidence, reasoning chain, decision-boundary distance, recommended reviewers, GitHub labels, and a PR-comment markdown string. Exit codes: 0/1/2 mapped per PRD.
route_map Enumerate Route nodes filtered by url substring and/or method. For each route returns the static responseKeys (when detected), the HANDLES_ROUTE handlers (Files or Operations pointing at the route), and the FETCHES consumers (caller symbols). Read-only.
Permissions 4
network medium filesystem low shell high env_vars low