Skip to main content

Knowledge graph for token-efficient code reviews — fixed search, configurable embeddings, qualified call resolution

Project description

Better Code Review Graph

mcp-name: io.github.n24q02m/better-code-review-graph

Knowledge graph for token-efficient code reviews -- fixed search, configurable embeddings, qualified call resolution.

CI codecov PyPI Docker License: MIT

Python MCP semantic-release Renovate

better-code-review-graph MCP server

Fork of code-review-graph with critical bug fixes, configurable embeddings, and production CI/CD. Parses your codebase with 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.

Features

Feature code-review-graph better-code-review-graph
Multi-word search Broken (literal substring) AND-logic word splitting
callers_of/callees_of Empty results (bare name targets) Qualified name resolution + bare fallback
Embedding sentence-transformers + torch (1.1 GB) qwen3-embed ONNX + cloud (200 MB), dual-mode
Output size Unbounded (500K+ chars) Paginated (max_results, truncated flag)
Tool design 9 individual tools 6 tools: graph + query + review + config + setup + help
Plugin hooks Invalid PostEdit/PostGit Valid PostToolUse

Setup

With AI Agent -- copy and send this to your AI agent:

Please set up better-code-review-graph for me. Follow this guide: https://raw.githubusercontent.com/n24q02m/better-code-review-graph/main/docs/setup-with-agent.md

Manual Setup -- follow docs/setup-manual.md

Tools

graph -- Graph lifecycle

Actions: build | update | stats | embed

Action Description
build Full or incremental graph build. Set full_rebuild=true to re-parse all files.
update Alias for build with full_rebuild=false (incremental).
stats Graph size, languages, node/edge breakdown, embedding count.
embed Compute vector embeddings for semantic search. Dual-mode: local ONNX or cloud.

query -- Graph queries

Actions: query | search | impact | large_functions

Action Description
query Predefined pattern queries: callers_of, callees_of, imports_of, importers_of, children_of, tests_for, inheritors_of, file_summary.
search Search code entities by name/keyword or semantic similarity.
impact Blast radius of changed files. Auto-detects from git diff. Paginated with max_results.
large_functions Find functions/classes exceeding a line-count threshold.

review -- Code review context

Token-optimized review context with structural summary, source snippets, and review guidance. Auto-detects changed files from git diff.

config -- Server configuration

Actions: status | set | cache_clear

Action Description
status Server info: version, graph path, node/edge counts, embedding backend.
set Update runtime settings (e.g., log_level).
cache_clear Remove all computed embeddings.

setup -- Credential setup

Actions: status | start | skip | reset | complete

Action Description
status Show current credential state and setup URL.
start Start relay setup to configure API keys via browser.
skip Set local mode (skip relay permanently, use ONNX only).
reset Clear credentials and reset state.
complete Re-resolve credentials from environment variables.

help -- Full documentation

Topics: graph | query | review | config

Returns complete documentation for each tool. Use when the compressed descriptions above are insufficient.

Security

  • Graceful fallbacks -- Cloud embedding failure falls back to local ONNX
  • Error handling -- Tools return error strings with fix suggestions, never crash
  • Read-only mount -- Docker mode mounts repo as :ro (read-only)

Build from Source

git clone https://github.com/n24q02m/better-code-review-graph
cd better-code-review-graph
uv sync --group dev
uv run pytest
uv run better-code-review-graph

Requirements: Python 3.13, uv

License

MIT -- See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better_code_review_graph-3.9.1.tar.gz (211.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

better_code_review_graph-3.9.1-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file better_code_review_graph-3.9.1.tar.gz.

File metadata

  • Download URL: better_code_review_graph-3.9.1.tar.gz
  • Upload date:
  • Size: 211.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for better_code_review_graph-3.9.1.tar.gz
Algorithm Hash digest
SHA256 ddfed42df73a93fb91c2fd95c26257d59a633076515335ed3679dd03aa9914b4
MD5 18525efc798d857be470dabce6a81bf0
BLAKE2b-256 5241a505d5557073d6a32686378426a98218c05364e62ad0bb152c7d1ae55948

See more details on using hashes here.

File details

Details for the file better_code_review_graph-3.9.1-py3-none-any.whl.

File metadata

  • Download URL: better_code_review_graph-3.9.1-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for better_code_review_graph-3.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc79c0c4d67e278a775d156bdd4fc32d0c5af60088c39fa20691c0c67c019fdd
MD5 d0276deb4200155906dd9864b3117a8a
BLAKE2b-256 ad2bc75367f57196fbbb5f05ad7677b93b94be2634fa309f91ad5bd7e136a983

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page