codegraphcontext 0.5.1__tar.gz → 0.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codegraphcontext-0.5.1/src/codegraphcontext.egg-info → codegraphcontext-0.5.3}/PKG-INFO +214 -22
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/README.md +196 -11
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/pyproject.toml +41 -11
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/api/app.py +6 -1
- codegraphcontext-0.5.3/src/codegraphcontext/api/auth.py +123 -0
- codegraphcontext-0.5.3/src/codegraphcontext/api/mcp_sse.py +105 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/api/router.py +9 -5
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/cli_helpers.py +236 -25
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/config_manager.py +159 -22
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/hook_manager.py +26 -4
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/main.py +286 -25
- codegraphcontext-0.5.3/src/codegraphcontext/cli/project_config.py +218 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/registry_commands.py +6 -6
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/setup_wizard.py +61 -56
- codegraphcontext-0.5.3/src/codegraphcontext/cli/simulator.py +343 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/bundle_registry.py +45 -6
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/cgc_bundle.py +102 -31
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/cgcignore.py +33 -12
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/database.py +5 -1
- codegraphcontext-0.5.1/src/codegraphcontext/core/database_kuzu.py → codegraphcontext-0.5.3/src/codegraphcontext/core/database_embedded_kuzu.py +156 -63
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/database_falkordb.py +141 -30
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/database_falkordb_remote.py +31 -11
- codegraphcontext-0.5.3/src/codegraphcontext/core/database_kuzu.py +41 -0
- codegraphcontext-0.5.3/src/codegraphcontext/core/database_ladybug.py +41 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/database_nornic.py +5 -1
- codegraphcontext-0.5.3/src/codegraphcontext/core/graph_query.py +45 -0
- codegraphcontext-0.5.3/src/codegraphcontext/core/simulator.py +589 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/watcher.py +165 -40
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/prompts.py +52 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/server.py +134 -18
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tool_definitions.py +171 -20
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/code_finder.py +55 -45
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/graph_builder.py +45 -12
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/handlers/analysis_handlers.py +28 -9
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/handlers/management_handlers.py +33 -7
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/handlers/query_handlers.py +10 -4
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/discovery.py +6 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/embeddings.py +71 -49
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/persistence/writer.py +116 -91
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/pipeline.py +108 -16
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/pre_scan.py +14 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/resolution/calls.py +54 -29
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +9 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/resolution/post_resolution.py +11 -20
- codegraphcontext-0.5.3/src/codegraphcontext/tools/indexing/schema.py +156 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/schema_contract.py +1 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/scip_pipeline.py +25 -10
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/vector_resolver.py +72 -57
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/c.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/cpp.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/css.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/dart.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/elisp.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/elixir.py +3 -3
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/go.py +3 -3
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/html.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/javascript.py +32 -27
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/lua.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/perl.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/python.py +80 -44
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/ruby.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/rust.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/typescript.py +31 -27
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/typescriptjsx.py +3 -3
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +22 -18
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +3 -3
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +2 -2
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +1 -1
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/report_generator.py +7 -7
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/scip_indexer.py +45 -3
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/system.py +13 -16
- codegraphcontext-0.5.3/src/codegraphcontext/tools/tree_sitter_parser.py +66 -0
- codegraphcontext-0.5.3/src/codegraphcontext/utils/cypher_ddl.py +80 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/cypher_readonly.py +5 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/debug_log.py +5 -0
- codegraphcontext-0.5.3/src/codegraphcontext/utils/gcf_encoder.py +58 -0
- codegraphcontext-0.5.3/src/codegraphcontext/utils/visualize_graph.py +462 -0
- codegraphcontext-0.5.3/src/codegraphcontext/viz/server.py +675 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3/src/codegraphcontext.egg-info}/PKG-INFO +214 -22
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext.egg-info/SOURCES.txt +10 -39
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext.egg-info/requires.txt +11 -10
- codegraphcontext-0.5.3/tests/test_mcp_sse.py +56 -0
- codegraphcontext-0.5.1/src/codegraphcontext/api/mcp_sse.py +0 -69
- codegraphcontext-0.5.1/src/codegraphcontext/core/database_ladybug.py +0 -1181
- codegraphcontext-0.5.1/src/codegraphcontext/tools/indexing/schema.py +0 -114
- codegraphcontext-0.5.1/src/codegraphcontext/tools/tree_sitter_parser.py +0 -121
- codegraphcontext-0.5.1/src/codegraphcontext/utils/visualize_graph.py +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/index-C-187lf0.js +0 -5587
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/index-fNAa6jgv.css +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/parser-pyodide.worker-BgsDfaad.js +0 -370
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/parser.worker-_nvrecvj.js +0 -233
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/cgcIcon.png +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/index.html +0 -32
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/logo-icon.svg +0 -85
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/logo.svg +0 -100
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/placeholder.svg +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/robots.txt +0 -14
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -1
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -4007
- codegraphcontext-0.5.1/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- codegraphcontext-0.5.1/src/codegraphcontext/viz/server.py +0 -342
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/LICENSE +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/MANIFEST.in +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/setup.cfg +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/api/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/api/schemas.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/stdlibs.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/datasources/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/datasources/cassandra_ingester.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/datasources/mysql_ingester.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/datasources/redis_ingester.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/persistence/utils.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/gradle.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/maven.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/mybatis.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/query_tool_languages/elisp_toolkit.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/tools/type_utils.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/git_utils.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/path_sandbox.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/tool_limits.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.5.1 → codegraphcontext-0.5.3}/tests/test_issue_806_fix.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -25,9 +25,14 @@ License: MIT License
|
|
|
25
25
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
26
|
SOFTWARE.
|
|
27
27
|
|
|
28
|
-
Project-URL: Homepage, https://github.com/
|
|
29
|
-
Project-URL: Bug Tracker, https://github.com/
|
|
28
|
+
Project-URL: Homepage, https://github.com/CodeGraphContext/CodeGraphContext
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/CodeGraphContext/CodeGraphContext/issues
|
|
30
30
|
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
31
36
|
Classifier: License :: OSI Approved :: MIT License
|
|
32
37
|
Classifier: Operating System :: OS Independent
|
|
33
38
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -43,9 +48,9 @@ Requires-Dist: typer>=0.9.0
|
|
|
43
48
|
Requires-Dist: rich>=13.7.0
|
|
44
49
|
Requires-Dist: inquirerpy>=0.3.4
|
|
45
50
|
Requires-Dist: python-dotenv>=1.0.0
|
|
46
|
-
Requires-Dist: tree-sitter<0.26.0,>=0.
|
|
47
|
-
Requires-Dist: tree-sitter-language-pack<
|
|
48
|
-
Requires-Dist: tree-sitter-c-sharp>=0.21.0
|
|
51
|
+
Requires-Dist: tree-sitter<0.26.0,>=0.24.0
|
|
52
|
+
Requires-Dist: tree-sitter-language-pack<2.0,>=1.6
|
|
53
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21.0
|
|
49
54
|
Requires-Dist: pyyaml
|
|
50
55
|
Requires-Dist: nbformat
|
|
51
56
|
Requires-Dist: nbconvert>=7.16.6
|
|
@@ -55,15 +60,15 @@ Requires-Dist: falkordb<1.6,>=1.0
|
|
|
55
60
|
Requires-Dist: falkordblite<0.10,>=0.7; sys_platform != "win32" and python_version >= "3.12"
|
|
56
61
|
Requires-Dist: requests>=2.28.0
|
|
57
62
|
Requires-Dist: protobuf<3.21,>=3.20
|
|
58
|
-
Requires-Dist: kuzu;
|
|
63
|
+
Requires-Dist: kuzu; python_version < "3.14" or sys_platform == "linux"
|
|
59
64
|
Requires-Dist: ladybug; sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10")
|
|
60
65
|
Requires-Dist: mcp>=1.0.0
|
|
61
66
|
Requires-Dist: fastapi>=0.100.0
|
|
62
67
|
Requires-Dist: uvicorn>=0.22.0
|
|
63
68
|
Provides-Extra: parsing
|
|
64
|
-
Requires-Dist: tree-sitter<0.26.0,>=0.
|
|
65
|
-
Requires-Dist: tree-sitter-language-pack<
|
|
66
|
-
Requires-Dist: tree-sitter-c-sharp>=0.21.0;
|
|
69
|
+
Requires-Dist: tree-sitter<0.26.0,>=0.24.0; extra == "parsing"
|
|
70
|
+
Requires-Dist: tree-sitter-language-pack<2.0,>=1.6; extra == "parsing"
|
|
71
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21.0; extra == "parsing"
|
|
67
72
|
Provides-Extra: falkordb-embedded
|
|
68
73
|
Requires-Dist: falkordblite<0.10,>=0.7; (sys_platform != "win32" and python_version >= "3.12") and extra == "falkordb-embedded"
|
|
69
74
|
Requires-Dist: falkordb<1.6,>=1.0; extra == "falkordb-embedded"
|
|
@@ -72,11 +77,13 @@ Provides-Extra: falkordb-remote
|
|
|
72
77
|
Requires-Dist: falkordb<1.6,>=1.0; extra == "falkordb-remote"
|
|
73
78
|
Requires-Dist: redis<6,>=5; extra == "falkordb-remote"
|
|
74
79
|
Provides-Extra: kuzu
|
|
75
|
-
Requires-Dist: kuzu; (
|
|
80
|
+
Requires-Dist: kuzu; (python_version < "3.14" or sys_platform == "linux") and extra == "kuzu"
|
|
76
81
|
Provides-Extra: ladybug
|
|
77
82
|
Requires-Dist: ladybug; (sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10")) and extra == "ladybug"
|
|
78
83
|
Provides-Extra: neo4j
|
|
79
84
|
Requires-Dist: neo4j>=5.15.0; extra == "neo4j"
|
|
85
|
+
Provides-Extra: gcf
|
|
86
|
+
Requires-Dist: gcf-python>=1.0.0; extra == "gcf"
|
|
80
87
|
Provides-Extra: dev
|
|
81
88
|
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
82
89
|
Requires-Dist: black>=23.11.0; extra == "dev"
|
|
@@ -102,7 +109,7 @@ Dynamic: license-file
|
|
|
102
109
|
- 🇯🇵 [日本語](docs/translations/README.ja.md)
|
|
103
110
|
- 🇪🇸 Español (Soon)
|
|
104
111
|
|
|
105
|
-
🌍 **Help translate CodeGraphContext to your language by raising an issue & PR on [GitHub Issues](https://github.com/
|
|
112
|
+
🌍 **Help translate CodeGraphContext to your language by raising an issue & PR on [GitHub Issues](https://github.com/CodeGraphContext/CodeGraphContext/issues)!**
|
|
106
113
|
|
|
107
114
|
<p align="center">
|
|
108
115
|
<br>
|
|
@@ -190,6 +197,43 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
190
197
|
|
|
191
198
|
---
|
|
192
199
|
|
|
200
|
+
## Why CodeGraphContext?
|
|
201
|
+
|
|
202
|
+
CodeGraphContext is built for the moment when plain text search stops being enough. It turns a repository into a graph of files, symbols, calls, inheritance, imports, and relationships so you can move from "where is this defined?" to "how does this actually connect?" without jumping between tools.
|
|
203
|
+
|
|
204
|
+
```mermaid
|
|
205
|
+
flowchart LR
|
|
206
|
+
A[Source code] --> B[Tree-sitter and SCIP indexers]
|
|
207
|
+
B --> C[Graph database]
|
|
208
|
+
C --> D[CLI queries]
|
|
209
|
+
C --> E[MCP server]
|
|
210
|
+
D --> F[Direct analysis]
|
|
211
|
+
E --> G[AI assistants with repo context]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Comparison at a glance
|
|
215
|
+
|
|
216
|
+
| Approach | Best for | Tradeoff |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| `grep` / file search | Exact string lookup | Misses relationships and code structure |
|
|
219
|
+
| RAG over code chunks | Natural-language retrieval | Can lose symbol-level precision |
|
|
220
|
+
| CodeGraphContext | Repository-wide reasoning | Requires an indexing step |
|
|
221
|
+
|
|
222
|
+
### Common use cases
|
|
223
|
+
|
|
224
|
+
- Trace call chains across files and packages.
|
|
225
|
+
- Understand class hierarchies, imports, and module boundaries.
|
|
226
|
+
- Find dead code, hotspots, and unexpected dependencies.
|
|
227
|
+
- Give an AI assistant the same structural context a maintainer would use.
|
|
228
|
+
|
|
229
|
+
### FAQ
|
|
230
|
+
|
|
231
|
+
- **Do I need a remote service?** No. CGC works locally with embedded backends or with external graph databases when you want them.
|
|
232
|
+
- **Is it only for one language?** No. It supports a broad mix of mainstream languages and keeps expanding.
|
|
233
|
+
- **Can I use it with an AI assistant?** Yes. That is one of the main reasons the MCP server exists.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
193
237
|
## Project Details
|
|
194
238
|
- **Version:** 0.5.1
|
|
195
239
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
@@ -227,6 +271,49 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
227
271
|
- **Flexible Database Backend:** FalkorDB Lite (Default), KuzuDB, LadybugDB, FalkorDB Remote, Nornic DB, or Neo4j (all platforms via Docker/native).
|
|
228
272
|
|
|
229
273
|
|
|
274
|
+
---
|
|
275
|
+
## Architecture Overview
|
|
276
|
+
|
|
277
|
+
CodeGraphContext transforms source code into a queryable knowledge graph that can be explored through the CLI or AI assistants via MCP.
|
|
278
|
+
|
|
279
|
+
```mermaid
|
|
280
|
+
flowchart TD
|
|
281
|
+
A[Code Repository] --> B[Tree-sitter / SCIP Indexing]
|
|
282
|
+
B --> C[Knowledge Graph]
|
|
283
|
+
C --> D[Graph Database]
|
|
284
|
+
D --> E[CLI Toolkit]
|
|
285
|
+
D --> F[MCP Server]
|
|
286
|
+
F --> G[AI Assistant]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Workflow
|
|
290
|
+
|
|
291
|
+
1. Source code is parsed using Tree-sitter or SCIP indexers.
|
|
292
|
+
2. Relationships between functions, classes, imports, and calls are extracted.
|
|
293
|
+
3. A knowledge graph is generated and stored in a graph database.
|
|
294
|
+
4. Users can query the graph through the CLI or AI assistants using MCP.
|
|
295
|
+
|
|
296
|
+
## 🏗️ Architecture & Workflow
|
|
297
|
+
|
|
298
|
+
CodeGraphContext parses your source code and builds a comprehensive knowledge graph. This graph can be queried directly via the CLI toolkit or exposed to AI assistants through the MCP server.
|
|
299
|
+
|
|
300
|
+
```mermaid
|
|
301
|
+
flowchart TD
|
|
302
|
+
A[Code Repository] -->|Parsed by| B[Tree-sitter / SCIP Indexing]
|
|
303
|
+
B -->|Generates| C[Knowledge Graph]
|
|
304
|
+
C -->|Stored in| D[(Graph Database)]
|
|
305
|
+
D -->|Queried via| E[CLI Toolkit]
|
|
306
|
+
D -->|Served by| F[MCP Server]
|
|
307
|
+
F -->|Provides context to| G[🤖 AI Assistant]
|
|
308
|
+
|
|
309
|
+
classDef default fill:#1f2937,stroke:#8b5cf6,stroke-width:2px,color:#fff;
|
|
310
|
+
classDef db fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#fff;
|
|
311
|
+
classDef ai fill:#312e81,stroke:#a855f7,stroke-width:2px,color:#fff;
|
|
312
|
+
|
|
313
|
+
D:::db
|
|
314
|
+
G:::ai
|
|
315
|
+
```
|
|
316
|
+
|
|
230
317
|
---
|
|
231
318
|
|
|
232
319
|
## Supported Programming Languages
|
|
@@ -297,8 +384,8 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
297
384
|
- `rich>=13.7.0`
|
|
298
385
|
- `inquirerpy>=0.3.4`
|
|
299
386
|
- `python-dotenv>=1.0.0`
|
|
300
|
-
- `tree-sitter>=0.
|
|
301
|
-
- `tree-sitter-language-pack>=
|
|
387
|
+
- `tree-sitter>=0.24.0,<0.26.0`
|
|
388
|
+
- `tree-sitter-language-pack>=1.6,<2.0`
|
|
302
389
|
- `pyyaml`
|
|
303
390
|
- `pathspec>=0.12.1`
|
|
304
391
|
- `falkordb>=1.0,<1.6`
|
|
@@ -332,6 +419,87 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
332
419
|
- **KuzuDB:** Cross-platform embedded backend.
|
|
333
420
|
- **Neo4j:** Run `codegraphcontext neo4j setup` to use an external server.
|
|
334
421
|
|
|
422
|
+
### 🧪 Local Development Setup
|
|
423
|
+
|
|
424
|
+
If you want to run CodeGraphContext from a local clone and contribute changes, use an editable install:
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
git clone https://github.com/CodeGraphContext/CodeGraphContext.git
|
|
428
|
+
cd CodeGraphContext
|
|
429
|
+
python -m venv .venv
|
|
430
|
+
source .venv/bin/activate
|
|
431
|
+
pip install -e ".[dev]"
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Then verify the install and try the local commands:
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
cgc --help
|
|
438
|
+
cgc doctor
|
|
439
|
+
cgc index .
|
|
440
|
+
cgc analyze callers main
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
For MCP server work, finish the setup with:
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
cgc mcp setup
|
|
447
|
+
cgc mcp start
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
If you are only installing the published package, `pip install codegraphcontext` is enough. If you are developing parser-heavy features and want the optional parsing extras too, install with `pip install -e ".[dev,parsing]"`.
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## 🐳 Docker (No Python Required)
|
|
455
|
+
|
|
456
|
+
Run CodeGraphContext without installing Python — pull the image and start indexing:
|
|
457
|
+
|
|
458
|
+
### Quick Start
|
|
459
|
+
```bash
|
|
460
|
+
# Pull the latest image
|
|
461
|
+
docker pull codegraphcontext/codegraphcontext:latest
|
|
462
|
+
|
|
463
|
+
# Index your current directory
|
|
464
|
+
docker run --rm -v "$(pwd):/workspace" codegraphcontext/codegraphcontext cgc index .
|
|
465
|
+
|
|
466
|
+
# List indexed repos
|
|
467
|
+
docker run --rm -v cgc-data:/home/cgc/.codegraphcontext \
|
|
468
|
+
codegraphcontext/codegraphcontext cgc list
|
|
469
|
+
|
|
470
|
+
# Interactive shell
|
|
471
|
+
docker run -it --rm -v "$(pwd):/workspace" \
|
|
472
|
+
-v cgc-data:/home/cgc/.codegraphcontext \
|
|
473
|
+
codegraphcontext/codegraphcontext bash
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Docker Compose
|
|
477
|
+
```bash
|
|
478
|
+
# Clone the repo and start with Docker Compose
|
|
479
|
+
git clone https://github.com/CodeGraphContext/CodeGraphContext.git
|
|
480
|
+
cd CodeGraphContext
|
|
481
|
+
|
|
482
|
+
# Start with embedded DB
|
|
483
|
+
docker compose run --rm cgc index .
|
|
484
|
+
|
|
485
|
+
# Start with external FalkorDB
|
|
486
|
+
docker compose --profile falkordb up -d
|
|
487
|
+
|
|
488
|
+
# Start with visualization server
|
|
489
|
+
docker compose --profile viz up -d
|
|
490
|
+
# Open http://localhost:8080
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Available Docker Tags
|
|
494
|
+
| Tag | Description |
|
|
495
|
+
|---|---|
|
|
496
|
+
| `latest` | Latest stable release |
|
|
497
|
+
| `edge` | Latest from `main` branch (may be unstable) |
|
|
498
|
+
| `0.4.19` | Specific version |
|
|
499
|
+
| `0.4` | Latest patch in 0.4.x |
|
|
500
|
+
|
|
501
|
+
For more advanced Docker usage, including running the MCP Server or connecting external databases, see our [Comprehensive Docker Guide](docs/DOCKER.md).
|
|
502
|
+
|
|
335
503
|
---
|
|
336
504
|
|
|
337
505
|
## 📋 Prerequisites
|
|
@@ -355,7 +523,7 @@ python --version
|
|
|
355
523
|
### Step 1: Install CodeGraphContext
|
|
356
524
|
|
|
357
525
|
```bash
|
|
358
|
-
pip install codegraphcontext
|
|
526
|
+
pip install codegraphcontext # Installs CodeGraphContext and required dependencies
|
|
359
527
|
```
|
|
360
528
|
|
|
361
529
|
This command installs CodeGraphContext and all required dependencies.
|
|
@@ -379,7 +547,7 @@ CodeGraphContext automatically uses an embedded database by default, so no addit
|
|
|
379
547
|
### Index a Repository
|
|
380
548
|
|
|
381
549
|
```bash
|
|
382
|
-
codegraphcontext index .
|
|
550
|
+
codegraphcontext index . # Scans current directory and builds code graph
|
|
383
551
|
```
|
|
384
552
|
|
|
385
553
|
This scans the current project and creates a searchable code graph.
|
|
@@ -407,7 +575,7 @@ Finds potentially unused code in the indexed repository.
|
|
|
407
575
|
After indexing a repository, run:
|
|
408
576
|
|
|
409
577
|
```bash
|
|
410
|
-
codegraphcontext list
|
|
578
|
+
codegraphcontext list # Shows all indexed repositories in the system
|
|
411
579
|
```
|
|
412
580
|
|
|
413
581
|
If the command executes successfully and displays indexed repositories, your setup is complete and CodeGraphContext is ready to use.
|
|
@@ -536,11 +704,6 @@ Add the following server configuration to your client's settings file (e.g., VS
|
|
|
536
704
|
"mcp",
|
|
537
705
|
"start"
|
|
538
706
|
],
|
|
539
|
-
"env": {
|
|
540
|
-
"NEO4J_URI": "YOUR_NEO4J_URI",
|
|
541
|
-
"NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
|
|
542
|
-
"NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
|
|
543
|
-
},
|
|
544
707
|
"disabled": false,
|
|
545
708
|
"alwaysAllow": []
|
|
546
709
|
}
|
|
@@ -580,6 +743,35 @@ If you installed CodeGraphContext using `pipx`, use the following configuration
|
|
|
580
743
|
|
|
581
744
|
---
|
|
582
745
|
|
|
746
|
+
## Token-Optimized Output (GCF)
|
|
747
|
+
|
|
748
|
+
Reduce tool response tokens by ~62% with the opt-in [GCF](https://gcformat.com) output format:
|
|
749
|
+
|
|
750
|
+
```bash
|
|
751
|
+
pip install gcf-python
|
|
752
|
+
CGC_OUTPUT_FORMAT=gcf codegraphcontext mcp start
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
Or add it to your MCP client config:
|
|
756
|
+
|
|
757
|
+
```json
|
|
758
|
+
{
|
|
759
|
+
"mcpServers": {
|
|
760
|
+
"CodeGraphContext": {
|
|
761
|
+
"command": "codegraphcontext",
|
|
762
|
+
"args": ["mcp", "start"],
|
|
763
|
+
"env": {
|
|
764
|
+
"CGC_OUTPUT_FORMAT": "gcf"
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
GCF encodes structured data with positional fields (keys declared once, values pipe-delimited). Code graph query results (symbols, relationships, callers, complexity) are exactly the data shape where GCF saves the most. 100% LLM comprehension on all frontier models. Falls back to JSON if `gcf-python` is not installed.
|
|
772
|
+
|
|
773
|
+
---
|
|
774
|
+
|
|
583
775
|
## Natural Language Interaction Examples
|
|
584
776
|
|
|
585
777
|
Once the server is running, you can interact with it through your AI assistant using plain English. Here are some examples of what you can say:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- 🇯🇵 [日本語](docs/translations/README.ja.md)
|
|
12
12
|
- 🇪🇸 Español (Soon)
|
|
13
13
|
|
|
14
|
-
🌍 **Help translate CodeGraphContext to your language by raising an issue & PR on [GitHub Issues](https://github.com/
|
|
14
|
+
🌍 **Help translate CodeGraphContext to your language by raising an issue & PR on [GitHub Issues](https://github.com/CodeGraphContext/CodeGraphContext/issues)!**
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
17
|
<br>
|
|
@@ -99,6 +99,43 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
102
|
+
## Why CodeGraphContext?
|
|
103
|
+
|
|
104
|
+
CodeGraphContext is built for the moment when plain text search stops being enough. It turns a repository into a graph of files, symbols, calls, inheritance, imports, and relationships so you can move from "where is this defined?" to "how does this actually connect?" without jumping between tools.
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
flowchart LR
|
|
108
|
+
A[Source code] --> B[Tree-sitter and SCIP indexers]
|
|
109
|
+
B --> C[Graph database]
|
|
110
|
+
C --> D[CLI queries]
|
|
111
|
+
C --> E[MCP server]
|
|
112
|
+
D --> F[Direct analysis]
|
|
113
|
+
E --> G[AI assistants with repo context]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Comparison at a glance
|
|
117
|
+
|
|
118
|
+
| Approach | Best for | Tradeoff |
|
|
119
|
+
| --- | --- | --- |
|
|
120
|
+
| `grep` / file search | Exact string lookup | Misses relationships and code structure |
|
|
121
|
+
| RAG over code chunks | Natural-language retrieval | Can lose symbol-level precision |
|
|
122
|
+
| CodeGraphContext | Repository-wide reasoning | Requires an indexing step |
|
|
123
|
+
|
|
124
|
+
### Common use cases
|
|
125
|
+
|
|
126
|
+
- Trace call chains across files and packages.
|
|
127
|
+
- Understand class hierarchies, imports, and module boundaries.
|
|
128
|
+
- Find dead code, hotspots, and unexpected dependencies.
|
|
129
|
+
- Give an AI assistant the same structural context a maintainer would use.
|
|
130
|
+
|
|
131
|
+
### FAQ
|
|
132
|
+
|
|
133
|
+
- **Do I need a remote service?** No. CGC works locally with embedded backends or with external graph databases when you want them.
|
|
134
|
+
- **Is it only for one language?** No. It supports a broad mix of mainstream languages and keeps expanding.
|
|
135
|
+
- **Can I use it with an AI assistant?** Yes. That is one of the main reasons the MCP server exists.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
102
139
|
## Project Details
|
|
103
140
|
- **Version:** 0.5.1
|
|
104
141
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
@@ -136,6 +173,49 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
136
173
|
- **Flexible Database Backend:** FalkorDB Lite (Default), KuzuDB, LadybugDB, FalkorDB Remote, Nornic DB, or Neo4j (all platforms via Docker/native).
|
|
137
174
|
|
|
138
175
|
|
|
176
|
+
---
|
|
177
|
+
## Architecture Overview
|
|
178
|
+
|
|
179
|
+
CodeGraphContext transforms source code into a queryable knowledge graph that can be explored through the CLI or AI assistants via MCP.
|
|
180
|
+
|
|
181
|
+
```mermaid
|
|
182
|
+
flowchart TD
|
|
183
|
+
A[Code Repository] --> B[Tree-sitter / SCIP Indexing]
|
|
184
|
+
B --> C[Knowledge Graph]
|
|
185
|
+
C --> D[Graph Database]
|
|
186
|
+
D --> E[CLI Toolkit]
|
|
187
|
+
D --> F[MCP Server]
|
|
188
|
+
F --> G[AI Assistant]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Workflow
|
|
192
|
+
|
|
193
|
+
1. Source code is parsed using Tree-sitter or SCIP indexers.
|
|
194
|
+
2. Relationships between functions, classes, imports, and calls are extracted.
|
|
195
|
+
3. A knowledge graph is generated and stored in a graph database.
|
|
196
|
+
4. Users can query the graph through the CLI or AI assistants using MCP.
|
|
197
|
+
|
|
198
|
+
## 🏗️ Architecture & Workflow
|
|
199
|
+
|
|
200
|
+
CodeGraphContext parses your source code and builds a comprehensive knowledge graph. This graph can be queried directly via the CLI toolkit or exposed to AI assistants through the MCP server.
|
|
201
|
+
|
|
202
|
+
```mermaid
|
|
203
|
+
flowchart TD
|
|
204
|
+
A[Code Repository] -->|Parsed by| B[Tree-sitter / SCIP Indexing]
|
|
205
|
+
B -->|Generates| C[Knowledge Graph]
|
|
206
|
+
C -->|Stored in| D[(Graph Database)]
|
|
207
|
+
D -->|Queried via| E[CLI Toolkit]
|
|
208
|
+
D -->|Served by| F[MCP Server]
|
|
209
|
+
F -->|Provides context to| G[🤖 AI Assistant]
|
|
210
|
+
|
|
211
|
+
classDef default fill:#1f2937,stroke:#8b5cf6,stroke-width:2px,color:#fff;
|
|
212
|
+
classDef db fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#fff;
|
|
213
|
+
classDef ai fill:#312e81,stroke:#a855f7,stroke-width:2px,color:#fff;
|
|
214
|
+
|
|
215
|
+
D:::db
|
|
216
|
+
G:::ai
|
|
217
|
+
```
|
|
218
|
+
|
|
139
219
|
---
|
|
140
220
|
|
|
141
221
|
## Supported Programming Languages
|
|
@@ -206,8 +286,8 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
206
286
|
- `rich>=13.7.0`
|
|
207
287
|
- `inquirerpy>=0.3.4`
|
|
208
288
|
- `python-dotenv>=1.0.0`
|
|
209
|
-
- `tree-sitter>=0.
|
|
210
|
-
- `tree-sitter-language-pack>=
|
|
289
|
+
- `tree-sitter>=0.24.0,<0.26.0`
|
|
290
|
+
- `tree-sitter-language-pack>=1.6,<2.0`
|
|
211
291
|
- `pyyaml`
|
|
212
292
|
- `pathspec>=0.12.1`
|
|
213
293
|
- `falkordb>=1.0,<1.6`
|
|
@@ -241,6 +321,87 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
241
321
|
- **KuzuDB:** Cross-platform embedded backend.
|
|
242
322
|
- **Neo4j:** Run `codegraphcontext neo4j setup` to use an external server.
|
|
243
323
|
|
|
324
|
+
### 🧪 Local Development Setup
|
|
325
|
+
|
|
326
|
+
If you want to run CodeGraphContext from a local clone and contribute changes, use an editable install:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
git clone https://github.com/CodeGraphContext/CodeGraphContext.git
|
|
330
|
+
cd CodeGraphContext
|
|
331
|
+
python -m venv .venv
|
|
332
|
+
source .venv/bin/activate
|
|
333
|
+
pip install -e ".[dev]"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Then verify the install and try the local commands:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
cgc --help
|
|
340
|
+
cgc doctor
|
|
341
|
+
cgc index .
|
|
342
|
+
cgc analyze callers main
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
For MCP server work, finish the setup with:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
cgc mcp setup
|
|
349
|
+
cgc mcp start
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
If you are only installing the published package, `pip install codegraphcontext` is enough. If you are developing parser-heavy features and want the optional parsing extras too, install with `pip install -e ".[dev,parsing]"`.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## 🐳 Docker (No Python Required)
|
|
357
|
+
|
|
358
|
+
Run CodeGraphContext without installing Python — pull the image and start indexing:
|
|
359
|
+
|
|
360
|
+
### Quick Start
|
|
361
|
+
```bash
|
|
362
|
+
# Pull the latest image
|
|
363
|
+
docker pull codegraphcontext/codegraphcontext:latest
|
|
364
|
+
|
|
365
|
+
# Index your current directory
|
|
366
|
+
docker run --rm -v "$(pwd):/workspace" codegraphcontext/codegraphcontext cgc index .
|
|
367
|
+
|
|
368
|
+
# List indexed repos
|
|
369
|
+
docker run --rm -v cgc-data:/home/cgc/.codegraphcontext \
|
|
370
|
+
codegraphcontext/codegraphcontext cgc list
|
|
371
|
+
|
|
372
|
+
# Interactive shell
|
|
373
|
+
docker run -it --rm -v "$(pwd):/workspace" \
|
|
374
|
+
-v cgc-data:/home/cgc/.codegraphcontext \
|
|
375
|
+
codegraphcontext/codegraphcontext bash
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Docker Compose
|
|
379
|
+
```bash
|
|
380
|
+
# Clone the repo and start with Docker Compose
|
|
381
|
+
git clone https://github.com/CodeGraphContext/CodeGraphContext.git
|
|
382
|
+
cd CodeGraphContext
|
|
383
|
+
|
|
384
|
+
# Start with embedded DB
|
|
385
|
+
docker compose run --rm cgc index .
|
|
386
|
+
|
|
387
|
+
# Start with external FalkorDB
|
|
388
|
+
docker compose --profile falkordb up -d
|
|
389
|
+
|
|
390
|
+
# Start with visualization server
|
|
391
|
+
docker compose --profile viz up -d
|
|
392
|
+
# Open http://localhost:8080
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Available Docker Tags
|
|
396
|
+
| Tag | Description |
|
|
397
|
+
|---|---|
|
|
398
|
+
| `latest` | Latest stable release |
|
|
399
|
+
| `edge` | Latest from `main` branch (may be unstable) |
|
|
400
|
+
| `0.4.19` | Specific version |
|
|
401
|
+
| `0.4` | Latest patch in 0.4.x |
|
|
402
|
+
|
|
403
|
+
For more advanced Docker usage, including running the MCP Server or connecting external databases, see our [Comprehensive Docker Guide](docs/DOCKER.md).
|
|
404
|
+
|
|
244
405
|
---
|
|
245
406
|
|
|
246
407
|
## 📋 Prerequisites
|
|
@@ -264,7 +425,7 @@ python --version
|
|
|
264
425
|
### Step 1: Install CodeGraphContext
|
|
265
426
|
|
|
266
427
|
```bash
|
|
267
|
-
pip install codegraphcontext
|
|
428
|
+
pip install codegraphcontext # Installs CodeGraphContext and required dependencies
|
|
268
429
|
```
|
|
269
430
|
|
|
270
431
|
This command installs CodeGraphContext and all required dependencies.
|
|
@@ -288,7 +449,7 @@ CodeGraphContext automatically uses an embedded database by default, so no addit
|
|
|
288
449
|
### Index a Repository
|
|
289
450
|
|
|
290
451
|
```bash
|
|
291
|
-
codegraphcontext index .
|
|
452
|
+
codegraphcontext index . # Scans current directory and builds code graph
|
|
292
453
|
```
|
|
293
454
|
|
|
294
455
|
This scans the current project and creates a searchable code graph.
|
|
@@ -316,7 +477,7 @@ Finds potentially unused code in the indexed repository.
|
|
|
316
477
|
After indexing a repository, run:
|
|
317
478
|
|
|
318
479
|
```bash
|
|
319
|
-
codegraphcontext list
|
|
480
|
+
codegraphcontext list # Shows all indexed repositories in the system
|
|
320
481
|
```
|
|
321
482
|
|
|
322
483
|
If the command executes successfully and displays indexed repositories, your setup is complete and CodeGraphContext is ready to use.
|
|
@@ -445,11 +606,6 @@ Add the following server configuration to your client's settings file (e.g., VS
|
|
|
445
606
|
"mcp",
|
|
446
607
|
"start"
|
|
447
608
|
],
|
|
448
|
-
"env": {
|
|
449
|
-
"NEO4J_URI": "YOUR_NEO4J_URI",
|
|
450
|
-
"NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
|
|
451
|
-
"NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
|
|
452
|
-
},
|
|
453
609
|
"disabled": false,
|
|
454
610
|
"alwaysAllow": []
|
|
455
611
|
}
|
|
@@ -489,6 +645,35 @@ If you installed CodeGraphContext using `pipx`, use the following configuration
|
|
|
489
645
|
|
|
490
646
|
---
|
|
491
647
|
|
|
648
|
+
## Token-Optimized Output (GCF)
|
|
649
|
+
|
|
650
|
+
Reduce tool response tokens by ~62% with the opt-in [GCF](https://gcformat.com) output format:
|
|
651
|
+
|
|
652
|
+
```bash
|
|
653
|
+
pip install gcf-python
|
|
654
|
+
CGC_OUTPUT_FORMAT=gcf codegraphcontext mcp start
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
Or add it to your MCP client config:
|
|
658
|
+
|
|
659
|
+
```json
|
|
660
|
+
{
|
|
661
|
+
"mcpServers": {
|
|
662
|
+
"CodeGraphContext": {
|
|
663
|
+
"command": "codegraphcontext",
|
|
664
|
+
"args": ["mcp", "start"],
|
|
665
|
+
"env": {
|
|
666
|
+
"CGC_OUTPUT_FORMAT": "gcf"
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
GCF encodes structured data with positional fields (keys declared once, values pipe-delimited). Code graph query results (symbols, relationships, callers, complexity) are exactly the data shape where GCF saves the most. 100% LLM comprehension on all frontier models. Falls back to JSON if `gcf-python` is not installed.
|
|
674
|
+
|
|
675
|
+
---
|
|
676
|
+
|
|
492
677
|
## Natural Language Interaction Examples
|
|
493
678
|
|
|
494
679
|
Once the server is running, you can interact with it through your AI assistant using plain English. Here are some examples of what you can say:
|