{"id":47662629,"url":"https://github.com/n24q02m/better-code-review-graph","last_synced_at":"2026-06-07T13:01:05.104Z","repository":{"id":345742922,"uuid":"1187120099","full_name":"n24q02m/better-code-review-graph","owner":"n24q02m","description":"Knowledge graph for token-efficient code reviews — fixed search, qualified call resolution, dual-mode embedding (ONNX + multi-provider cloud)","archived":false,"fork":false,"pushed_at":"2026-04-27T03:18:17.000Z","size":5497,"stargazers_count":26,"open_issues_count":20,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-27T05:29:22.378Z","etag":null,"topics":["ai-agents","ai-coding","antigravity","claude","claude-code","code-review","codex","copilot","cursor","docker","gemini-cli","knowledge-graph","mcp","mcp-server","model-context-protocol","open-source","python","tree-sitter"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/better-code-review-graph/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n24q02m.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-20T11:11:32.000Z","updated_at":"2026-04-27T03:18:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/n24q02m/better-code-review-graph","commit_stats":null,"previous_names":["n24q02m/better-code-review-graph"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/n24q02m/better-code-review-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fbetter-code-review-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fbetter-code-review-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fbetter-code-review-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fbetter-code-review-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n24q02m","download_url":"https://codeload.github.com/n24q02m/better-code-review-graph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n24q02m%2Fbetter-code-review-graph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32476682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","ai-coding","antigravity","claude","claude-code","code-review","codex","copilot","cursor","docker","gemini-cli","knowledge-graph","mcp","mcp-server","model-context-protocol","open-source","python","tree-sitter"],"created_at":"2026-04-02T11:41:15.426Z","updated_at":"2026-06-07T13:01:05.094Z","avatar_url":"https://github.com/n24q02m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Better Code Review Graph\n\nmcp-name: io.github.n24q02m/better-code-review-graph\n\n**Knowledge graph for token-efficient code reviews -- fixed search, configurable embeddings, qualified call resolution.**\n\n\u003c!-- Badge Row 1: Status --\u003e\n[![CI](https://github.com/n24q02m/better-code-review-graph/actions/workflows/ci.yml/badge.svg)](https://github.com/n24q02m/better-code-review-graph/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/n24q02m/better-code-review-graph/graph/badge.svg)](https://codecov.io/gh/n24q02m/better-code-review-graph)\n[![PyPI](https://img.shields.io/pypi/v/better-code-review-graph?logo=pypi\u0026logoColor=white)](https://pypi.org/project/better-code-review-graph/)\n[![Docker](https://img.shields.io/docker/v/n24q02m/better-code-review-graph?label=docker\u0026logo=docker\u0026logoColor=white\u0026sort=semver)](https://hub.docker.com/r/n24q02m/better-code-review-graph)\n[![License: MIT](https://img.shields.io/github/license/n24q02m/better-code-review-graph)](LICENSE)\n\n\u003c!-- Badge Row 2: Tech --\u003e\n[![Python](https://img.shields.io/badge/Python_3.13-3776AB?logo=python\u0026logoColor=white)](#)\n[![MCP](https://img.shields.io/badge/MCP-000000?logo=anthropic\u0026logoColor=white)](#)\n[![semantic-release](https://img.shields.io/badge/semantic--release-e10079?logo=semantic-release\u0026logoColor=white)](https://github.com/python-semantic-release/python-semantic-release)\n[![Renovate](https://img.shields.io/badge/renovate-enabled-1A1F6C?logo=renovatebot\u0026logoColor=white)](https://developer.mend.io/)\n\n\u003c!-- BEGIN: AUTO-GENERATED-CROSS-PROMO --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cstrong\u003eSister projects from n24q02m\u003c/strong\u003e (click to expand)\u003c/summary\u003e\n\n| Project | Tagline | Tag |\n|---|---|---|\n| [better-code-review-graph](https://github.com/n24q02m/better-code-review-graph) | Knowledge graph for token-efficient code reviews -- fixed search, configurabl... | MCP |\n| [better-email-mcp](https://github.com/n24q02m/better-email-mcp) | IMAP/SMTP email server for AI agents -- 6 composite tools with multi-account ... | MCP |\n| [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) | Composite MCP server for Godot Engine -- 17 mega-tools for AI-assisted game d... | MCP |\n| [better-notion-mcp](https://github.com/n24q02m/better-notion-mcp) | Markdown-first Notion API server for AI agents -- 10 composite tools replacin... | MCP |\n| [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) | MCP server for Telegram with dual-mode support: Bot API (httpx) for quick bot... | MCP |\n| [claude-plugins](https://github.com/n24q02m/claude-plugins) | Full documentation: mcp.n24q02m.com — unified docs for all 8 servers + the mc... | Marketplace |\n| [imagine-mcp](https://github.com/n24q02m/imagine-mcp) | Production-grade MCP server for image and video understanding + generation ac... | MCP |\n| [jules-task-archiver](https://github.com/n24q02m/jules-task-archiver) | Chrome Extension for bulk operations on Jules tasks via batchexecute API -- a... | Tooling |\n| [mcp-core](https://github.com/n24q02m/mcp-core) | Unified MCP Streamable HTTP 2025-11-25 transport, OAuth 2.1 Authorization Ser... | MCP |\n| [mnemo-mcp](https://github.com/n24q02m/mnemo-mcp) | Persistent AI memory with hybrid search and embedded sync. Open, free, unlimi... | MCP |\n| [qwen3-embed](https://github.com/n24q02m/qwen3-embed) | Lightweight Qwen3 text embedding and reranking via ONNX Runtime and GGUF | Library |\n| [skret](https://github.com/n24q02m/skret) | Secrets without the server. | CLI |\n| [web-core](https://github.com/n24q02m/web-core) | Shared web infrastructure package for search, scraping, HTTP security, and st... | Library |\n| [wet-mcp](https://github.com/n24q02m/wet-mcp) | Open-source MCP Server for web search, content extraction, library docs \u0026 mul... | MCP |\n\n\u003c/details\u003e\n\u003c!-- END: AUTO-GENERATED-CROSS-PROMO --\u003e\n\n## Table of contents\n\n- [Features](#features)\n- [Status](#status)\n- [Documentation](#documentation)\n- [Tools](#tools)\n- [Security](#security)\n- [Build from Source](#build-from-source)\n- [Trust Model](#trust-model)\n- [License](#license)\n\n\n\n\u003c!-- Glama badge --\u003e\n\u003ca href=\"https://glama.ai/mcp/servers/n24q02m/better-code-review-graph\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/n24q02m/better-code-review-graph/badge\" alt=\"better-code-review-graph MCP server\" /\u003e\n\u003c/a\u003e\n\nFork of [code-review-graph](https://github.com/tirth8205/code-review-graph) with critical bug fixes, configurable embeddings, and production CI/CD. Parses your codebase with [Tree-sitter](https://tree-sitter.github.io/tree-sitter/), builds a structural graph of functions/classes/imports, and gives Claude (or any MCP client) precise context so it reads only what matters.\n\n## v2.0 migration (BREAKING)\n\nSee [BREAKING_CHANGES.md](BREAKING_CHANGES.md) for the full\nschema-change list, behavior-change summary, environment\nrequirements, and rollback procedure.\n\nThis release adds **temporal columns** (`valid_from_sha` /\n`valid_to_sha` on every node + edge) and an opt-in **security\nscanner**. The schema migration is auto-applied on first\n`GraphStore` open, and a backup of the pre-2.0 DB is saved to\n`\u003cgraph_db\u003e.pre-2.0.bak` so you can roll back if needed.\n\nTo downgrade and restore the pre-2.0 backup:\n\n```sh\nCRG_DOWNGRADE_TO_1_X=1 uv run better-code-review-graph\n```\n\nThe backup is created the first time alembic crosses the breaking\nboundary (revision `005_temporal_columns`); subsequent runs reuse\nthe existing backup file. After a downgrade the v2-state DB is\npreserved at `\u003cgraph_db\u003e.post-2.0.archived` so you can forward-roll\nagain later.\n\nWhat you get on v2.0+:\n\n- **Temporal queries** -- `query`/`search`/`impact` accept\n  `as_of=\u003csha\u003e` for snapshot semantics; `query(action=\"diff\",\n  from_sha=X, to_sha=Y)` returns `{added, removed, modified}`\n  buckets driven entirely by the temporal columns (no re-parse).\n  See `help(topic=\"query\")`.\n- **Refactor auditing** -- `review(action=\"delta\",\n  show_line_shifts=true, ...)` surfaces symbols whose `line_start`\n  moved between two commits.\n- **Security scanning** -- `security(action=\"scan\", ...)` runs a\n  regex-based Tier-1 scanner (5 rules) by default; pass\n  `engine=\"semgrep\"` (after `uv add 'better-code-review-graph[security]'`)\n  for the ~120-rule Tier-2 overlay. Findings persist on\n  `nodes.security_tags`; `report` re-emits the cache as JSON or\n  SARIF v2.1.0. See `help(topic=\"security\")`.\n\n## What's new in v1.6\n\n- **LLM-generated summaries** -- `graph(action=\"summarize\")` writes a one-paragraph docstring for each `Function` node via Gemini or OpenAI (cloud opt-in, no key = no-op). Run it after `graph(action=\"update\")` to lift semantic-search recall by ~15% on repos with terse function names.\n- **Graph export in 4 formats** -- `graph(action=\"export\", format=...)` emits `graphml` (Gephi/Cytoscape), `json-ld`, `dot` (Graphviz), or `cypher` (Neo4j replay). Inline by default; pass `output_path` to write to disk.\n- **Source text capture** -- `Function` nodes now persist their raw source so summaries can be regenerated whenever an edit changes the body. The cache key is `sha256(source_text):provider`; unchanged nodes cost zero LLM calls on re-run.\n- **Cost cap on summaries** -- `max_nodes` (default 500) caps LLM calls per invocation; pair with cron / `update` cadence for predictable spend.\n- **Phase 1 quality wins** (also new in this train): `query(action=\"spot_check\")` for random callsite snippets, `query(action=\"renamed_in_diff\")` for shifted callsites, dynamic-dispatch hints in `callers_of` results, a dedicated `recipes` help topic, and `embeddings_count` exposed in `graph(action=\"stats\")`.\n\nExample -- after pulling new functions in, refresh embeddings with summaries:\n```\ngraph(action=\"update\")\ngraph(action=\"summarize\", max_nodes=200)\ngraph(action=\"embed\")\n```\n\n## Features\n\n| Feature | code-review-graph | better-code-review-graph |\n|:--------|:------------------|:-------------------------|\n| Multi-word search | Broken (literal substring) | AND-logic word splitting |\n| callers_of/callees_of | Empty results (bare name targets) | Qualified name resolution + bare fallback |\n| Embedding | sentence-transformers + torch (1.1 GB) | qwen3-embed ONNX + cloud (200 MB), dual-mode |\n| Output size | Unbounded (500K+ chars) | Paginated (max_results, truncated flag) |\n| Tool design | 9 individual tools | 6 tools: graph + query + review + config + security + help |\n| Plugin hooks | Invalid PostEdit/PostGit | Valid PostToolUse |\n\n## Status\n\n\u003e **2026-05-02 -- Architecture stabilization update**\n\u003e\n\u003e Past months saw significant churn around credential handling and the daemon-bridge auto-spawn pattern. This caused multi-process races, browser tab spam, and inconsistent setup UX across plugins. **As of v\u003cauto\u003e, the architecture is stable**: 2 clean modes (stdio + HTTP), no daemon-bridge layer, no auto-spawn from stdio.\n\u003e\n\u003e Apologies for the instability period. If you encountered issues with prior versions, please update to v\u003cauto\u003e+ and follow the current [Setup guide](https://mcp.n24q02m.com/servers/better-code-review-graph/setup/) -- most prior workarounds are no longer needed.\n\u003e\n\u003e **Related plugins from the same author**:\n\u003e - [wet-mcp](https://github.com/n24q02m/wet-mcp) -- Web search + content extraction\n\u003e - [mnemo-mcp](https://github.com/n24q02m/mnemo-mcp) -- Persistent AI memory\n\u003e - [imagine-mcp](https://github.com/n24q02m/imagine-mcp) -- Image/video understanding + generation\n\u003e - [better-notion-mcp](https://github.com/n24q02m/better-notion-mcp) -- Notion API\n\u003e - [better-email-mcp](https://github.com/n24q02m/better-email-mcp) -- Email management\n\u003e - [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) -- Telegram\n\u003e - [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) -- Godot Engine\n\u003e\n\u003e All plugins share the same architecture -- install once, learn pattern transfers.\n\n## Documentation\n\nFull docs at **[mcp.n24q02m.com/servers/better-code-review-graph/](https://mcp.n24q02m.com/servers/better-code-review-graph/)**:\n\n- [Setup](https://mcp.n24q02m.com/servers/better-code-review-graph/setup/) -- install methods for Claude Code, Codex, Gemini CLI, Cursor, Windsurf, mcp.json\n- [Modes overview](https://mcp.n24q02m.com/get-started/modes-overview/) -- stdio / local-relay / remote-relay / remote-oauth\n- [Multi-user setup](https://mcp.n24q02m.com/get-started/multi-user/) -- per-JWT-sub credential model\n\n**Install with AI agent** -- paste this to your AI coding agent:\n\n\u003e Install MCP server `better-code-review-graph` following the steps at\n\u003e https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/better-code-review-graph/setup-with-agent.md\n\n## Tools\n\n### `graph` -- Graph lifecycle\n\nActions: `build` | `update` | `stats` | `embed` | `export` | `summarize`\n\n| Action | Description |\n|:-------|:------------|\n| `build` | Full or incremental graph build. Set `full_rebuild=true` to re-parse all files. |\n| `update` | Alias for `build` with `full_rebuild=false` (incremental). |\n| `stats` | Graph size, languages, node/edge breakdown, embedding count. |\n| `embed` | Compute vector embeddings for semantic search. Dual-mode: local ONNX or cloud. |\n| `export` | Export graph in `graphml` / `json-ld` / `dot` / `cypher`. Inline or to `output_path`. |\n| `summarize` | LLM-generated one-paragraph docstrings for `Function` nodes (Gemini or OpenAI, cloud opt-in). Cost-capped via `max_nodes`. |\n\n### `query` -- Graph queries\n\nActions: `query` | `search` | `impact` | `large_functions`\n\n| Action | Description |\n|:-------|:------------|\n| `query` | Predefined pattern queries: `callers_of`, `callees_of`, `imports_of`, `importers_of`, `children_of`, `tests_for`, `inheritors_of`, `file_summary`. |\n| `search` | Search code entities by name/keyword or semantic similarity. |\n| `impact` | Blast radius of changed files. Auto-detects from git diff. Paginated with `max_results`. |\n| `large_functions` | Find functions/classes exceeding a line-count threshold. |\n\n### `review` -- Code review context\n\nToken-optimized review context with structural summary, source snippets, and review guidance. Auto-detects changed files from git diff.\n\n### `config` -- Server configuration and credential setup\n\nActions: `status` | `set` | `cache_clear` | `setup_status` | `setup_start` | `setup_skip` | `setup_reset` | `setup_complete`\n\n| Action | Description |\n|:-------|:------------|\n| `status` | Server info: version, graph path, node/edge counts, embedding backend. |\n| `set` | Update runtime settings (e.g., `log_level`). |\n| `cache_clear` | Remove all computed embeddings. |\n| `setup_status` | Show current credential state and setup URL. |\n| `setup_start` | Start relay setup to configure API keys via browser. |\n| `setup_skip` | Set local mode (skip relay permanently, use ONNX only). |\n| `setup_reset` | Clear credentials and reset state. |\n| `setup_complete` | Re-resolve credentials from environment variables. |\n\n### `security` -- Security scanning\n\nActions: `scan` | `report` | `suppress` | `rule_list`\n\n| Action | Description |\n|:-------|:------------|\n| `scan` | Run a security scan (`engine='heuristic'` default, or `'semgrep'`). Findings persist on `nodes.security_tags`. |\n| `report` | Re-emit cached findings as JSON (`format='json'`) or SARIF v2.1.0 (`format='sarif'`). |\n| `suppress` | Suppress a finding by `rule_id` (or `remove=true` to un-suppress). |\n| `rule_list` | List available rules for an engine. |\n\n### `help` -- Full documentation\n\nTopics: `graph` | `query` | `review` | `config` | `recipes`\n\nReturns complete documentation for each tool. Use when the compressed descriptions above are insufficient.\n\n## Security\n\n- **Graceful fallbacks** -- Cloud embedding failure falls back to local ONNX\n- **Error handling** -- Tools return error strings with fix suggestions, never crash\n- **Read-only mount** -- Docker mode mounts repo as `:ro` (read-only)\n\n## Build from Source\n\n```bash\ngit clone https://github.com/n24q02m/better-code-review-graph\ncd better-code-review-graph\nuv sync --group dev\nuv run pytest\nuv run better-code-review-graph\n```\n\n**Requirements:** Python 3.13, [uv](https://docs.astral.sh/uv/)\n\n## Trust Model\n\nThis plugin implements **TC-Local** (machine-bound, single trust principal). See [mcp-core/docs/TRUST-MODEL.md](https://github.com/n24q02m/mcp-core/blob/main/docs/TRUST-MODEL.md) for full classification.\n\n| Mode | Storage | Encryption | Who can read your data? |\n|---|---|---|---|\n| stdio (default) | `~/.better-code-review-graph-mcp/config.json` | AES-GCM, machine-bound key | Only your OS user (file perm 0600) |\n| HTTP self-host | Same as stdio | Same | Only you (admin = user) |\n\n## License\n\nMIT -- See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn24q02m%2Fbetter-code-review-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn24q02m%2Fbetter-code-review-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn24q02m%2Fbetter-code-review-graph/lists"}