codegraph-engine 2.2.0__tar.gz → 2.3.0__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.
Files changed (173) hide show
  1. codegraph_engine-2.3.0/PKG-INFO +733 -0
  2. codegraph_engine-2.3.0/README.md +700 -0
  3. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/pyproject.toml +1 -1
  4. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/__init__.py +1 -1
  5. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/agent_capabilities.py +245 -4
  6. codegraph_engine-2.3.0/src/codegraph/branch_comparison.py +197 -0
  7. codegraph_engine-2.3.0/src/codegraph/change_impact.py +337 -0
  8. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/cli.py +238 -0
  9. codegraph_engine-2.3.0/src/codegraph/context_freshness.py +349 -0
  10. codegraph_engine-2.3.0/src/codegraph/git_state.py +543 -0
  11. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/parser.py +55 -21
  12. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/mcp/server.py +69 -0
  13. codegraph_engine-2.3.0/src/codegraph/semantic_conflicts.py +270 -0
  14. codegraph_engine-2.3.0/src/codegraph/structural_diff.py +540 -0
  15. codegraph_engine-2.3.0/src/codegraph/symbol_history.py +275 -0
  16. codegraph_engine-2.3.0/src/codegraph_engine.egg-info/PKG-INFO +733 -0
  17. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph_engine.egg-info/SOURCES.txt +7 -0
  18. codegraph_engine-2.3.0/tests/test_git_intelligence.py +574 -0
  19. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_phase13_agent_brain_and_rc.py +5 -5
  20. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v216_installer.py +1 -1
  21. codegraph_engine-2.2.0/PKG-INFO +0 -642
  22. codegraph_engine-2.2.0/README.md +0 -609
  23. codegraph_engine-2.2.0/src/codegraph_engine.egg-info/PKG-INFO +0 -642
  24. codegraph_engine-2.2.0/tests/test_git_intelligence.py +0 -118
  25. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/LICENSE +0 -0
  26. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/setup.cfg +0 -0
  27. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/agent.py +0 -0
  28. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/agent_brain.py +0 -0
  29. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/agent_rules.py +0 -0
  30. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/architecture.py +0 -0
  31. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/audit.py +0 -0
  32. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/binding_resolver.py +0 -0
  33. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/cache.py +0 -0
  34. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/cli_output.py +0 -0
  35. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/config.py +0 -0
  36. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/constraints.py +0 -0
  37. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/context.py +0 -0
  38. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/database/__init__.py +0 -0
  39. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/database/extractor.py +0 -0
  40. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/database/interrogation.py +0 -0
  41. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/database/models.py +0 -0
  42. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/epistemic.py +0 -0
  43. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/errors.py +0 -0
  44. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/evidence/__init__.py +0 -0
  45. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/evidence/citations.py +0 -0
  46. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/evidence_contract.py +0 -0
  47. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/frameworks.py +0 -0
  48. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/freshness.py +0 -0
  49. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/git.py +0 -0
  50. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/graph/__init__.py +0 -0
  51. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/graph/models.py +0 -0
  52. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/graph/traversal.py +0 -0
  53. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/__init__.py +0 -0
  54. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/classifier.py +0 -0
  55. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/indexer.py +0 -0
  56. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/models.py +0 -0
  57. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/scanner.py +0 -0
  58. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/telemetry.py +0 -0
  59. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/indexing/test_framework.py +0 -0
  60. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/installer.py +0 -0
  61. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/interrogation.py +0 -0
  62. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/llm/__init__.py +0 -0
  63. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/llm/base.py +0 -0
  64. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/llm/context.py +0 -0
  65. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/mcp/__init__.py +0 -0
  66. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/mcp_diagnostics.py +0 -0
  67. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/memory/__init__.py +0 -0
  68. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/memory/store.py +0 -0
  69. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/models.py +0 -0
  70. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/monorepo.py +0 -0
  71. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/observability.py +0 -0
  72. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/optimizer.py +0 -0
  73. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/planner.py +0 -0
  74. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/process_lifecycle.py +0 -0
  75. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/py.typed +0 -0
  76. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/query_expansion.py +0 -0
  77. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/ranking.py +0 -0
  78. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resolver.py +0 -0
  79. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/__init__.py +0 -0
  80. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/cache.py +0 -0
  81. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/coalescer.py +0 -0
  82. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/debouncer.py +0 -0
  83. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/governor.py +0 -0
  84. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/monitor.py +0 -0
  85. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/resources/policy.py +0 -0
  86. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/retrieval_policy.py +0 -0
  87. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/route_composer.py +0 -0
  88. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/runtime/__init__.py +0 -0
  89. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/runtime/ingestor.py +0 -0
  90. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/runtime/models.py +0 -0
  91. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/runtime/reconciliation.py +0 -0
  92. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/runtime/runner.py +0 -0
  93. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/search/__init__.py +0 -0
  94. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/search/hybrid.py +0 -0
  95. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/search/semantic.py +0 -0
  96. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/security/__init__.py +0 -0
  97. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/security/paths.py +0 -0
  98. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/security/redaction.py +0 -0
  99. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/semantic_decorators.py +0 -0
  100. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/target_resolver.py +0 -0
  101. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/task.py +0 -0
  102. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph/tool_selection_eval.py +0 -0
  103. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph_engine.egg-info/dependency_links.txt +0 -0
  104. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph_engine.egg-info/entry_points.txt +0 -0
  105. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph_engine.egg-info/requires.txt +0 -0
  106. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/src/codegraph_engine.egg-info/top_level.txt +0 -0
  107. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_active_coding_protection.py +0 -0
  108. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_adaptive_planning.py +0 -0
  109. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_adversarial_edge_cases.py +0 -0
  110. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_agent_ux_hardening.py +0 -0
  111. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_agent_ux_text_search_file_inspection.py +0 -0
  112. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_artifact_classification.py +0 -0
  113. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_artifact_retrieval_policy.py +0 -0
  114. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_benchmark_infra.py +0 -0
  115. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_bounded_caches.py +0 -0
  116. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_change_impact.py +0 -0
  117. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_cli_doctor_privacy.py +0 -0
  118. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_conservative_binding.py +0 -0
  119. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_context_budget.py +0 -0
  120. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_context_cache.py +0 -0
  121. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_context_compiler_v2.py +0 -0
  122. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_core.py +0 -0
  123. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_database_integrity.py +0 -0
  124. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_database_runtime_intelligence_and_security.py +0 -0
  125. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_debouncer.py +0 -0
  126. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_dependency_injection.py +0 -0
  127. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_determinism_and_soak.py +0 -0
  128. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_developer_audit.py +0 -0
  129. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_epistemic_relationships.py +0 -0
  130. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_evaluation_framework.py +0 -0
  131. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_framework_analyzers.py +0 -0
  132. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_framework_routes_persistence.py +0 -0
  133. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_hardening.py +0 -0
  134. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_interrogation_contracts.py +0 -0
  135. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_latency_modes_and_parallel.py +0 -0
  136. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_mcp_integration.py +0 -0
  137. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_monorepo_packages.py +0 -0
  138. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_package_boundaries.py +0 -0
  139. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_phase10_context_optimization.py +0 -0
  140. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_phase11_agent_integration.py +0 -0
  141. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_phase12_hardening.py +0 -0
  142. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_phase2.py +0 -0
  143. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_platform_resources.py +0 -0
  144. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_ranking_engine.py +0 -0
  145. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_reference_resolution.py +0 -0
  146. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_registries_and_dispatch.py +0 -0
  147. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_request_coalescer.py +0 -0
  148. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_resource_governor.py +0 -0
  149. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_retrieval_planner.py +0 -0
  150. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_route_composition.py +0 -0
  151. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_scanner_security.py +0 -0
  152. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_semantic_decorators.py +0 -0
  153. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_single_pass_parser.py +0 -0
  154. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_symbol_identity.py +0 -0
  155. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_task_ambiguity.py +0 -0
  156. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_task_mcp_tools.py +0 -0
  157. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_task_normalization.py +0 -0
  158. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_task_spec.py +0 -0
  159. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_test_intelligence.py +0 -0
  160. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v211_factory_resolution.py +0 -0
  161. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v211_features.py +0 -0
  162. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v211_imports_dependents_cli.py +0 -0
  163. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v211_recursive_frameworks.py +0 -0
  164. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v215_external_feedback.py +0 -0
  165. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v217_large_repo_indexing.py +0 -0
  166. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v21_diagnostics.py +0 -0
  167. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v21_hard_exclusions.py +0 -0
  168. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v21_query_expansion.py +0 -0
  169. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v21_retrieval_policy.py +0 -0
  170. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v21_target_resolver.py +0 -0
  171. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_v22_enterprise_concurrency_and_runtime.py +0 -0
  172. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_verify_evidence.py +0 -0
  173. {codegraph_engine-2.2.0 → codegraph_engine-2.3.0}/tests/test_windows_and_process_lifecycle.py +0 -0
@@ -0,0 +1,733 @@
1
+ Metadata-Version: 2.4
2
+ Name: codegraph-engine
3
+ Version: 2.3.0
4
+ Summary: Deep deterministic repository intelligence for AI coding agents (code, dependencies, databases, and runtime observations)
5
+ Author: CodeGraph contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/raghurammrsd/CODE_GRAPH_MCP
8
+ Project-URL: Repository, https://github.com/raghurammrsd/CODE_GRAPH_MCP
9
+ Project-URL: Documentation, https://github.com/raghurammrsd/CODE_GRAPH_MCP/blob/main/docs/agent-brain.md
10
+ Project-URL: Changelog, https://github.com/raghurammrsd/CODE_GRAPH_MCP/blob/main/CHANGELOG.md
11
+ Project-URL: Issues, https://github.com/raghurammrsd/CODE_GRAPH_MCP/issues
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: pydantic>=2.7
21
+ Requires-Dist: typer>=0.12
22
+ Requires-Dist: mcp<2,>=1.0
23
+ Provides-Extra: mcp
24
+ Requires-Dist: mcp<2,>=1.0; extra == "mcp"
25
+ Provides-Extra: system
26
+ Requires-Dist: psutil>=5.9; extra == "system"
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=8; extra == "dev"
29
+ Requires-Dist: pytest-cov>=5; extra == "dev"
30
+ Requires-Dist: ruff>=0.6; extra == "dev"
31
+ Requires-Dist: mypy>=1.10; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ <p align="center">
35
+ <img src="docs/assets/codegraph_logo.jpg" alt="CodeGraph MCP — Deep Deterministic Repository Intelligence for AI Coding Agents" width="500" />
36
+ </p>
37
+
38
+ <h1 align="center">CodeGraph MCP Engine (v2.3.0)</h1>
39
+
40
+ <p align="center">
41
+ <strong>Deterministic Codebase Intelligence for AI Coding Agents.</strong><br>
42
+ <em>High-performance Model Context Protocol (MCP) server for Claude Code, Cursor, Antigravity, Cline, and Codex.</em>
43
+ </p>
44
+
45
+ <p align="center">
46
+ <a href="https://pypi.org/project/codegraph-engine/2.3.0/"><img src="https://img.shields.io/badge/pypi-codegraph--engine%20v2.3.0-blue.svg" alt="PyPI: codegraph-engine v2.3.0" /></a>
47
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.12%20%7C%203.13-3776AB.svg" alt="Python 3.12 | 3.13" /></a>
48
+ <a href="src/codegraph/mcp/server.py"><img src="https://img.shields.io/badge/MCP-14%20default%20%7C%2062%20full%20tools-2ea043.svg" alt="MCP Tools: 14 default | 62 full" /></a>
49
+ <a href="tests/"><img src="https://img.shields.io/badge/pytest-871%20passed-brightgreen.svg" alt="Tests: 871 passed" /></a>
50
+ <a href="pyproject.toml"><img src="https://img.shields.io/badge/ruff-0%20errors-success.svg" alt="Ruff: 0 errors" /></a>
51
+ <a href="src/codegraph/"><img src="https://img.shields.io/badge/mypy-0%20issues%20(87%20files)-blue.svg" alt="Mypy: strict" /></a>
52
+ <a href="https://raghurammrsd.github.io/CODE_GRAPH_MCP/"><img src="https://img.shields.io/badge/docs-GitHub%20Pages-0969da.svg" alt="Documentation: GitHub Pages" /></a>
53
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
54
+ </p>
55
+
56
+ <p align="center">
57
+ <a href="https://raghurammrsd.github.io/CODE_GRAPH_MCP/"><strong>Documentation Site</strong></a> •
58
+ <a href="https://pypi.org/project/codegraph-engine/2.3.0/"><strong>PyPI Package</strong></a> •
59
+ <a href="#overview"><strong>Overview</strong></a> •
60
+ <a href="#1-whats-new-in-v230-git-aware-intelligence"><strong>What's New in v2.3.0</strong></a> •
61
+ <a href="#2-quickstart-30-second-setup"><strong>Quickstart</strong></a> •
62
+ <a href="#4-real-world-cli-outputs"><strong>CLI Outputs</strong></a> •
63
+ <a href="#6-database-intelligence"><strong>Database Intelligence</strong></a> •
64
+ <a href="#7-zero-friction-runtime-intelligence--static-reconciliation"><strong>Runtime Evidence</strong></a> •
65
+ <a href="#8-git-aware-repository-intelligence"><strong>Git Intelligence</strong></a> •
66
+ <a href="#10-measured-performance-and-scaling-benchmarks"><strong>Benchmarks</strong></a> •
67
+ <a href="docs/agent-brain.md"><strong>62-Tool Reference</strong></a> •
68
+ <a href="https://github.com/raghurammrsd/CODE_GRAPH_MCP"><strong>GitHub</strong></a>
69
+ </p>
70
+
71
+ ---
72
+
73
+ ## Overview
74
+
75
+ ### The Problem
76
+
77
+ When AI coding agents (such as Claude Code, Cursor, or Antigravity) explore complex enterprise repositories, text-based search (grep/ripgrep) forces them to parse large, multi-thousand-line files to reconstruct call chains, router mounts, dependency injection graphs, and ORM schemas. This consumes 60% to 80% of the LLM context window with irrelevant code and frequently leads to hallucinations regarding entity relationships and database structures.
78
+
79
+ ### The Solution: CodeGraph MCP
80
+
81
+ **CodeGraph MCP provides deterministic, compiler-grade repository intelligence through the Model Context Protocol.** Instead of guessing based on lexical approximations, the AI agent queries a local, persistent SQLite index for verified AST relationships, framework router trees, database lineages, and live runtime observations—resolved in sub-5ms latency.
82
+
83
+ ```text
84
+ ┌─────────────────────────────────────────────────────────────┐
85
+ │ AI CODING AGENT │
86
+ │ (Claude Code • Cursor • Antigravity) │
87
+ └──────────────────────────────┬──────────────────────────────┘
88
+ │ Model Context Protocol (stdio / SSE)
89
+ ▼
90
+ ┌─────────────────────────────────────────────────────────────┐
91
+ │ CODEGRAPH MCP ENGINE │
92
+ ├──────────────────────────────┬──────────────────────────────┤
93
+ │ AST Code Relationships │ Framework Route Hierarchy │
94
+ │ (Callers, Callees, DI) │ (FastAPI, Django, Express) │
95
+ ├──────────────────────────────┼──────────────────────────────┤
96
+ │ Database Lineage & Schemas │ Non-Invasive Dev Tracing │
97
+ │ (SQLAlchemy, Prisma, ORM) │ (HTTP metrics, exceptions) │
98
+ └──────────────────────────────┴──────────────────────────────┘
99
+ │
100
+ ▼
101
+ Deterministic • Local-First • Verified Evidence
102
+ ```
103
+
104
+ ### Core Architecture Capabilities
105
+
106
+ - **Zero Hallucination Guarantee**: Every returned entity and relationship is statically verified via Abstract Syntax Trees or explicitly flagged as `UNKNOWN` / `POSSIBLE`.
107
+ - **Sub-5ms Freshness Verification**: Monotonic commit tracking validates `git rev-parse HEAD` and porcelain status instantly, avoiding full-tree re-indexing on unchanged codebases.
108
+ - **Context Window Optimization**: Yields 65% to 85% token reduction by returning structured, bounded source slices rather than entire file dumps.
109
+ - **Zero-Friction Dev Interception (`codegraph run`)**: Wraps local development servers (e.g., `codegraph run npm run dev`, `codegraph run uvicorn main:app`) to capture real HTTP routes, latencies, and stack traces without application code changes.
110
+ - **Multi-Agent Setup (`codegraph install`)**: Automatically detects, configures, and verifies integrations for Claude Code, Cursor, Antigravity, and Cline.
111
+
112
+ > **Supported Languages & Frameworks:** Python (`FastAPI`, `Flask`, `Django`, `SQLAlchemy`, `Celery`, `pytest`) and TypeScript / JavaScript (`.ts`, `.tsx`, `.js`, `.jsx`, `Express.js`).
113
+
114
+ ![CodeGraph MCP v2.2.1 Architecture & Concurrency Pipeline](docs/assets/v22_concurrency_runtime_pipeline.svg)
115
+
116
+ ---
117
+
118
+ ## 1. What's New in v2.3.0 (Git-Aware Intelligence)
119
+
120
+ Version `2.3.0` introduces compiler-grade **Git-Aware Repository Intelligence**, allowing AI agents and CI/CD pipelines to understand how code evolves across branches, commits, and working tree edits:
121
+
122
+ | Capability | CLI Command | MCP Tool | How It Solves Agent Failure Modes |
123
+ | :--- | :--- | :--- | :--- |
124
+ | **Working-Tree Freshness** | `codegraph git-state` | `get_git_state` | Tracks branch, HEAD vs indexed commit, modified/staged files with sub-millisecond status caching. Surfaces `CLEAN`, `DIRTY`, `STALE`, `REINDEXING`, `ERROR`. |
125
+ | **Structural AST Diff** | `codegraph git-diff [base] [head]` | `compare_git` | Semantic diff across Git revisions: identifies added/removed/modified functions, changed parameter signatures, and affected routes—not merely raw line diffs. |
126
+ | **Deep Impact & Visual Tree** | `codegraph git-impact --tree` | `get_change_impact` | Traverses downstream callers, callees, framework routes, DB writers, and affected test suites with token-bounded ranking and terminal ASCII tree visualization. |
127
+ | **Semantic Merge Conflicts** | `codegraph git-conflicts [base] [head]` | `detect_semantic_conflicts` | Detects silent contract breaks before merge: invoking functions or route handlers that were deleted or modified on the target branch. |
128
+ | **Context Freshness Gate** | `codegraph check-freshness [task]` | `check_context_freshness` | Determines whether previously compiled context remains `VALID`, `PARTIALLY_STALE`, or `STALE` without re-running full graph queries if unrelated files changed. |
129
+ | **Deterministic Symbol History** | `codegraph symbol-history <sym>` | `trace_symbol_history` | Reconstructs the exact commit lifecycle of any symbol (introduced, modified, moved, renamed, or deleted) with confidence labels. |
130
+
131
+ ---
132
+
133
+ ## 1.1 What's New in v2.2.1
134
+
135
+ Version `2.2.1` introduced runtime telemetry reconciliation, SQLite WAL concurrency, and multi-transport SSE resilience:
136
+
137
+ | Bottleneck Solved | How It Worked Before | CodeGraph MCP v2.2.1 Solution | Impact |
138
+ | :--- | :--- | :--- | :--- |
139
+ | **Runtime Telemetry Cold Start** | User had to manually configure OpenTelemetry exporters or Pino JSON log streaming pipelines. | **`codegraph run <command>`**: Transparent 1-line wrapper (`codegraph run npm run dev`, `codegraph run uvicorn main:app`) injecting non-invasive hooks (`NODE_OPTIONS` / `PYTHONSTARTUP`). | **Zero code changes**; streams HTTP route hits, latencies, and exception traces directly into `.codegraph/runtime.sqlite3`. |
140
+ | **Database Concurrency (`database is locked`)** | Concurrent agent queries and background indexers could lock the SQLite database and raise crashes. | Enforced permanent **`WAL`** mode, **`synchronous = NORMAL`**, **`busy_timeout = 15000`** (15s), **`cache_size = -64000`** (64MB), and in-memory temporary storage. | Completely eliminates `database is locked` errors during parallel AI interrogation. |
141
+ | **Index Freshness Verification Latency** | Full-repository file hash comparisons took seconds before queries on large codebases. | **Instant Git Commit Fast Path**: Validates `git rev-parse HEAD` match + clean `git status --porcelain`. Falls back to `st_mtime < idx_at` stat checks. | Reduces freshness verification from seconds to **`< 5ms`** on clean repositories. |
142
+ | **Enterprise Monorepo Context Saturation** | Queries on 40,000-file monorepos could emit 50,000+ tokens for all routes or tables, blowing LLM context windows. | **Bounded Pagination**: Added `limit`, `offset`, `total_count`, and `has_more` to `list_routes` and `get_db_schema`. Added `--limit` / `--offset` to CLI `routes`. | Bounded context token consumption with strict pagination safeguards. |
143
+ | **Client Disconnection (`exit status 0xffffffff`)** | Stdio MCP pipe termination caused permanent crash loops in agent IDEs on server updates or restarts. | **Multi-Transport Resiliency**: Added **`--transport sse`** (`--port`, `--host`) to `codegraph serve` and `codegraph mcp serve`. | Enables hot-reconnecting SSE HTTP transport alongside stdio for robust IDE bridges. |
144
+
145
+ ---
146
+
147
+ ## 2. Quickstart (30-Second Setup)
148
+
149
+ ### Step 1: Install the Package
150
+
151
+ ```bash
152
+ pip install "codegraph-engine[mcp]"
153
+ ```
154
+
155
+ ### Step 2: Configure Your AI Coding Agents (`codegraph install`)
156
+
157
+ CodeGraph MCP includes an interactive, idempotent onboarding installer ([`src/codegraph/installer.py`](src/codegraph/installer.py)) that detects installed AI coding agents (**Claude Code**, **Cursor**, **Antigravity**, **Codex CLI**, **Gemini CLI**, and **Cline**), configures `mcpServers.codegraph`, installs marker-bounded routing instructions (`<!-- CODEGRAPH:START -->` … `<!-- CODEGRAPH:END -->`), and verifies server health:
158
+
159
+ ```bash
160
+ # Interactive setup (detects installed agents, previews planned changes, asks confirmation)
161
+ codegraph install
162
+
163
+ # Non-interactive setup for all detected agents in the current project
164
+ codegraph install --yes --target auto --location local
165
+
166
+ # Preview exact file modifications without writing anything
167
+ codegraph install --dry-run
168
+ ```
169
+
170
+ ### Step 3: Initialize & Verify Your Project Index
171
+
172
+ ```bash
173
+ cd your-project
174
+ codegraph init
175
+ codegraph status
176
+ codegraph doctor
177
+ ```
178
+
179
+ > **Dynamic Index Hot-Reloading:** If your AI coding agent launches `codegraph mcp serve` before you run `codegraph init`, you do **not** need to restart your IDE or MCP session. As soon as `codegraph init` or `codegraph index` creates or updates `.codegraph.sqlite3`, the running MCP server automatically detects the database on the next tool call and refreshes its in-memory graph cache (`get_repository_status(reload=True, reindex=True)` can also be invoked directly by the agent).
180
+
181
+ ### Step 4: Run With Zero-Friction Telemetry (`codegraph run`)
182
+
183
+ Wrap your development server transparently to stream real HTTP routes, durations, and uncaught exceptions directly into CodeGraph MCP:
184
+
185
+ ```bash
186
+ # Node / Express / Next.js
187
+ codegraph run npm run dev
188
+
189
+ # Python / FastAPI / Uvicorn
190
+ codegraph run uvicorn main:app --reload
191
+
192
+ # Django
193
+ codegraph run python manage.py runserver
194
+ ```
195
+
196
+ ---
197
+
198
+ ## 3. Core Architecture & Mental Model
199
+
200
+ ```mermaid
201
+ flowchart TD
202
+ A["AI Coding Agent (Claude, Cursor, Antigravity, Cline)"] --> B["CodeGraph MCP Server (stdio or SSE)"]
203
+ B --> C["Deterministic Repository Intelligence"]
204
+
205
+ C --> D["AST Semantic Graph (Callers, Callees, References, DI)"]
206
+ C --> E["Literal & Regex Text Search (search_code)"]
207
+ C --> F["Bounded Source Inspection (get_file)"]
208
+ C --> G["Database Intelligence (Tables, ORM, Migrations, R/W)"]
209
+ C --> H["Zero-Friction Runtime Telemetry (codegraph run)"]
210
+
211
+ D --> I["Structured Evidence + Epistemic Labels"]
212
+ E --> I
213
+ F --> I
214
+ G --> I
215
+ H --> I
216
+
217
+ I --> J["Context Optimization & Secret Redaction"]
218
+ J --> A
219
+ ```
220
+
221
+ ### Routing Each Question to the Right Primitive
222
+
223
+ ```text
224
+ STRUCTURAL → Graph tools (find_symbol, find_callers, find_callees, find_references, find_routes)
225
+ TEXTUAL → search_code (literal/regex search across Python, HTML/Jinja, JS/TS, CSS, YAML/JSON, SQL)
226
+ SOURCE → get_file (bounded start_line..end_line source inspection with truncation metadata)
227
+ GRAPH → Trace tools (trace_path, trace_flow, analyze_impact, get_git_impact)
228
+ DATABASE → Database tools (get_db_schema, find_db_tables, find_db_readers, find_db_writers, get_db_impact)
229
+ RUNTIME → Runtime tools (codegraph run, ingest_runtime_traces, get_runtime_trace, reconcile_static_runtime)
230
+ EDITING → Native agent / IDE editing tools
231
+ ```
232
+
233
+ ---
234
+
235
+ ## 4. Real-World CLI Outputs
236
+
237
+ Below are exact, verifiable outputs produced by CodeGraph MCP v2.2.1:
238
+
239
+ ### 1. Zero-Friction Runtime Interceptor (`codegraph run`)
240
+
241
+ ```bash
242
+ $ codegraph run python3 -c "print('>> Dev server active on port 8000')"
243
+ >> Dev server active on port 8000
244
+ ```
245
+ *HTTP requests, status codes, and exceptions are automatically streamed to `.codegraph/runtime.sqlite3` with child exit codes preserved.*
246
+
247
+ ### 2. Instant Index Freshness Check (`codegraph status`)
248
+
249
+ ```bash
250
+ $ codegraph status .
251
+ {
252
+ "repository": "/Users/raghuram/Documents/ChatGPT/MCP",
253
+ "freshness": "FRESH",
254
+ "freshness_detail": "Index matches current repository state.",
255
+ "files": 190,
256
+ "chunks": 1965,
257
+ "symbols": 1947,
258
+ "framework_routes": 0,
259
+ "graph_edges": 12712,
260
+ "resource_profile": "BALANCED",
261
+ "pressure_level": "NORMAL",
262
+ "activity_mode": "IDLE",
263
+ "estimated_memory_mb": 43.23,
264
+ "modified_files": [],
265
+ "deleted_files": [],
266
+ "parse_failed_files": []
267
+ }
268
+ ```
269
+ *Validated in `< 5ms` via the Git commit diff fast path.*
270
+
271
+ ### 3. Incremental Indexing with 16-Phase Telemetry (`codegraph index --verbose`)
272
+
273
+ ```bash
274
+ $ codegraph index --verbose
275
+ Phase: Repository Scan
276
+ 190 / 190 files | 100% | elapsed: 0.09s | rate: 128,203 files/min | memory: 42 MB
277
+ Phase: Post-Processing
278
+ 190 / 190 files | 100% | elapsed: 0.62s | rate: 18,273 files/min | memory: 67 MB
279
+ Phase: Symbol Resolution
280
+ 190 / 190 files | 100% | elapsed: 0.80s | rate: 14,311 files/min | memory: 91 MB
281
+ Phase: Relationship Resolution
282
+ 190 / 190 files | 100% | elapsed: 1.49s | rate: 7,648 files/min | memory: 116 MB
283
+ Phase: Database Analysis
284
+ 190 / 190 files | 100% | elapsed: 1.77s | rate: 6,424 files/min | memory: 120 MB
285
+ Phase: Final Commit & Checkpoint
286
+ 190 / 190 files | 100% | elapsed: 2.59s | rate: 4,396 files/min | memory: 141 MB
287
+
288
+ Summary: elapsed=2.595s peak_rss=141.0MB max_wal=9.44MB final_wal=0.00MB commits=15 checkpoints=15
289
+ [repository_scan] 88.1ms files=190 items=190 writes=0
290
+ [ast_parsing] 154.7ms files=13 items=3322 writes=0
291
+ [database_analysis] 283.9ms files=13 items=1631 writes=0
292
+ [symbol_resolution] 52.5ms files=190 items=5854 writes=0
293
+ [relationship_resolution] 694.0ms files=190 items=32806 writes=0
294
+ [sqlite_writes] 1146.4ms files=13 items=50206 writes=50208
295
+ scanned=190 indexed=13 unchanged=177 removed=0
296
+ ```
297
+
298
+ ### 4. Bounded Monorepo Route Discovery (`codegraph routes --limit 3`)
299
+
300
+ ```bash
301
+ $ codegraph routes --limit 3
302
+ Found 3 route(s):
303
+ [GET] /api/v1/health -> health_check (src/app/api.py:14) [fastapi]
304
+ [POST] /api/v1/orders -> create_order (src/app/orders.py:42) [fastapi]
305
+ [GET] /api/v1/users/{id} -> get_user (src/app/users.py:88) [fastapi]
306
+ ```
307
+
308
+ ### 5. Safe Background Process Termination (`codegraph stop --json`)
309
+
310
+ ```bash
311
+ $ codegraph stop --json
312
+ {
313
+ "status": "ok",
314
+ "stopped_count": 0,
315
+ "stale_cleaned_count": 0,
316
+ "processes": []
317
+ }
318
+ ```
319
+
320
+ ---
321
+
322
+ ## 5. AI/ML & Backend Architecture Examples
323
+
324
+ ### Example 1: Model Inference Service Flow
325
+
326
+ ```text
327
+ POST /v1/predict (FastAPI Route)
328
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
329
+ predict_endpoint (Handler)
330
+ ↓ INJECTS (DATAFLOW_VERIFIED)
331
+ get_inference_service (DI Provider)
332
+ ↓ CALLS (AST_VERIFIED)
333
+ InferenceService.run_inference
334
+ ├──►CALLS (AST_VERIFIED) ──► FeaturePreprocessor.transform
335
+ ├──►CALLS (AST_VERIFIED) ──► FraudClassifier.forward
336
+ ├──►CALLS (AST_VERIFIED) ──► ScorePostprocessor.calibrate
337
+ └──►CALLS (AST_VERIFIED) ──► PredictionRepository.log_prediction
338
+ ↓ WRITES_TABLE (AST_VERIFIED)
339
+ db:table:postgresql.public.prediction_logs
340
+ ```
341
+
342
+ **What CodeGraph MCP structurally proves**:
343
+ - `find_routes(path="/v1/predict")` resolves composed router prefixes (`MOUNTS`) to `predict_endpoint`.
344
+ - `trace_path(from_symbol="predict_endpoint", to_symbol="log_prediction")` proves the multi-hop execution chain across DI injection, preprocessing, model execution, and persistence.
345
+ - `get_db_impact(symbol="InferenceService.run_inference")` identifies downstream writes to `prediction_logs`.
346
+
347
+ ### Example 2: Training & Evaluation Pipeline
348
+
349
+ ```text
350
+ train_cli (CLI Command Handler)
351
+ ↓ COMMAND_HANDLER (FRAMEWORK_VERIFIED)
352
+ TrainingPipeline.run
353
+ ├──►CALLS (AST_VERIFIED) ──► DatasetBuilder.load_splits
354
+ ├──►CALLS (AST_VERIFIED) ──► TokenizerTransform.encode_batch
355
+ ├──►CALLS (AST_VERIFIED) ──► Trainer.fit_epoch
356
+ ├──►CALLS (AST_VERIFIED) ──► CheckpointManager.save_weights
357
+ └──►CALLS (AST_VERIFIED) ──► Evaluator.compute_metrics
358
+ ```
359
+
360
+ **What CodeGraph MCP structurally proves**:
361
+ - `find_callees(symbol="TrainingPipeline.run")` enumerates every stage of the pipeline with exact file and line ranges.
362
+ - `find_tests(symbol="Evaluator.compute_metrics")` locates the unit and regression tests covering metric calculation.
363
+ - When a transform or model class is dynamically instantiated from a YAML string (`getattr(models, cfg.arch)`), CodeGraph MCP explicitly records `POSSIBLE_CALLS` (`POSSIBLE`) or `UNRESOLVED_REFERENCE` (`UNKNOWN`) rather than fabricating a false static call edge.
364
+
365
+ ### Example 3: LLM Agent & Tool Registry
366
+
367
+ ```text
368
+ POST /api/chat (LLM Endpoint)
369
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
370
+ chat_handler
371
+ ↓ CALLS (AST_VERIFIED)
372
+ AgentRunner.execute_step
373
+ ├──►REGISTERS / REGISTERED_HANDLER ──► ToolRegistry ("search_orders", "refund_order")
374
+ ├──►CALLS (AST_VERIFIED) ──► ContextBuilder.compile
375
+ ├──►READS_TABLE (AST_VERIFIED) ──► db:table:postgresql.public.conversations
376
+ └──►CALLS (AST_VERIFIED) ──► ModelProviderClient.generate
377
+ ```
378
+
379
+ **What CodeGraph MCP structurally proves**:
380
+ - Tracks decorator and call-based registrations (`@tool_registry.register("search_orders")`) via `REGISTERS` and `REGISTERED_HANDLER` edges.
381
+ - Tracks environment variable dependencies (`os.getenv("OPENAI_API_KEY")`) as `READS_ENV` edges with the variable name only—never indexing or exposing secret values.
382
+
383
+ ---
384
+
385
+ ## 6. Database Intelligence
386
+
387
+ [`src/codegraph/database/`](src/codegraph/database/) provides static schema, ORM model, migration, and query extraction across **SQLAlchemy**, **Django ORM**, **SQLModel**, **Prisma** (`.prisma`), **Alembic**, **Django Migrations**, and **Raw SQL** (`PostgreSQL`, `MySQL`, `SQLite`).
388
+
389
+ ```text
390
+ POST /orders
391
+ ↓ HANDLED_BY (FRAMEWORK_VERIFIED)
392
+ OrderService.create_order
393
+ ↓ CALLS (AST_VERIFIED)
394
+ OrderRepository.insert_order
395
+ ↓ WRITES_TABLE (AST_VERIFIED)
396
+ db:table:postgresql.public.orders
397
+ ↓ FOREIGN_KEY_TO (AST_VERIFIED)
398
+ orders.user_id ──► users.id
399
+ ```
400
+
401
+ ### Capabilities Exposed by the 11 Database MCP Tools
402
+ - **Table & Column Discovery** (`get_db_schema`, `get_db_table`, `find_db_tables`, `find_db_columns`): Extract tables, column types, nullability, defaults, primary keys (`HAS_PRIMARY_KEY`), indexes (`HAS_INDEX`), unique/check constraints, and foreign keys (`FOREIGN_KEY_TO`).
403
+ - **ORM Mapping** (`find_db_models`): Map SQLAlchemy `__tablename__`, Django `models.Model` (`Meta.db_table`), SQLModel `table=True`, and Prisma `model` blocks via `MAPS_TO_TABLE` and `MAPS_TO_COLUMN`.
404
+ - **Readers, Writers & Callers** (`find_db_readers`, `find_db_writers`, `find_db_callers`, `find_db_queries`): Identify every function or method that executes `SELECT` (`READS_TABLE`) or `INSERT` / `UPDATE` / `DELETE` / `.add()` / `.save()` (`WRITES_TABLE`) against a table.
405
+ - **Migration Lineage & Schema Blast Radius** (`find_db_relationships`, `get_db_impact`): Track Alembic (`op.create_table`, `op.add_column`) and Django (`migrations.CreateModel`, `migrations.AddField`) operations (`MIGRATES_TABLE`) and compute bidirectional code $\leftrightarrow$ database impact.
406
+
407
+ ---
408
+
409
+ ## 7. Zero-Friction Runtime Intelligence & Static Reconciliation
410
+
411
+ Static analysis proves what **can** happen structurally; runtime telemetry records what **was observed** during execution. CodeGraph MCP v2.2.1 brings them together transparently:
412
+
413
+ ```text
414
+ STATIC GRAPH (AST + Framework + Dataflow + DB)
415
+ +
416
+ RUNTIME OBSERVATION (codegraph run / OTel JSON / JSONL / SQL Logs)
417
+ ↓
418
+ reconcile_static_runtime()
419
+ ```
420
+
421
+ ### Reconciliation Outcomes ([`ReconciliationStatus`](src/codegraph/runtime/models.py))
422
+
423
+ | Reconciliation Status | Static Graph | Runtime Trace | Meaning |
424
+ | :--- | :---: | :---: | :--- |
425
+ | **`CONFIRMED_RUNTIME_PATH`** | Present | Observed | Static relationship is structurally proven **and** observed executing in ingested traces. |
426
+ | **`NOT_OBSERVED_AT_RUNTIME`** | Present | Not observed | Statically valid edge was not exercised in the recorded trace sample. |
427
+ | **`RUNTIME_ONLY_OBSERVED`** | Dynamic / `UNKNOWN` | Observed | Executed at runtime (e.g., plugin hook, `getattr`, dynamic SQL) where static analysis was `UNKNOWN`. |
428
+ | **`STATIC_RUNTIME_CONFLICT`** | Target A | Target B | Runtime execution dispatched to a different target than static resolution (e.g., dependency override). |
429
+
430
+ ### Epistemic Rules for Runtime Evidence
431
+ 1. **Runtime Telemetry Is Non-Invasive**: `codegraph run` uses standard environment variable hooks (`NODE_OPTIONS`, `PYTHONSTARTUP`). You never modify application source code.
432
+ 2. **`NOT_OBSERVED_AT_RUNTIME` Does Not Mean Dead Code**: It only indicates that the code path was not triggered during the recorded trace window (such as an error branch or periodic batch job).
433
+ 3. **Runtime Observations Never Overwrite Static Proof**: Runtime spans are recorded with `evidence_class="RUNTIME_OBSERVED"` and strictly distinguished from `AST_VERIFIED` and `FRAMEWORK_VERIFIED` static edges.
434
+
435
+ ---
436
+
437
+ ## 8. Epistemic Trust & Evidence Contract
438
+
439
+ CodeGraph MCP enforces a fail-closed evidence contract ([`src/codegraph/evidence_contract.py`](src/codegraph/evidence_contract.py)) across all **51 canonical relationship types** and **9 evidence classes**. CodeGraph MCP prefers **explicit uncertainty** over **fabricated certainty**:
440
+
441
+ ```text
442
+ Dynamically resolved target (getattr(handler, action_name)())
443
+ ↓
444
+ UNRESOLVED_REFERENCE / POSSIBLE_CALLS (status = "UNKNOWN" | "POSSIBLE")
445
+ (Never fabricated into a verified CALLS edge)
446
+ ```
447
+
448
+ | Epistemic Status | Allowed Evidence Classes | What It Means |
449
+ | :--- | :--- | :--- |
450
+ | **`FACT`** | `AST_VERIFIED`, `STATIC_VERIFIED`, `FRAMEWORK_VERIFIED`, `DATAFLOW_VERIFIED` | Proven directly from syntax tree, framework decorator/router semantics, or conservative local dataflow. |
451
+ | **`RUNTIME_OBSERVED`** | `RUNTIME_OBSERVED` | Observed in traces captured by `codegraph run` or ingested OTel/JSONL/SQL logs (`hit_count`, `duration_ms`). |
452
+ | **`POSSIBLE`** | `POSSIBLE` | Plausible candidate relationship (`POSSIBLE_CALLS`, `POSSIBLE_TABLE`) requiring source inspection before mutation. |
453
+ | **`AMBIGUOUS`** | `AMBIGUOUS` | Multiple symbols or database tables match the bare identifier across modules or dialects; returns sorted `candidates`. |
454
+ | **`UNKNOWN`** | `UNKNOWN`, `RUNTIME_UNOBSERVED` | Target cannot be statically proven (dynamic reflection, external dependency, or `reason="resolution_budget_exceeded"`). |
455
+ | **`CONFLICT`** | Static vs. Runtime / Multi-Source | Static analysis and runtime observation (or competing definitions) disagree. |
456
+
457
+ ---
458
+
459
+ ## 8. Git-Aware Repository Intelligence & Merge Conflict Safety
460
+
461
+ CodeGraph MCP v2.3.0 tracks the exact evolution of repository code across commits, branches, and working tree changes:
462
+
463
+ ```text
464
+ Repository state
465
+ ↓
466
+ Git change detection (CLEAN / DIRTY / STALE)
467
+ ↓
468
+ Structural AST diff (functions, parameters, routes)
469
+ ↓
470
+ Downstream impact analysis (callers, callees, tests, DB)
471
+ ↓
472
+ Context freshness validation (VALID / PARTIALLY_STALE / STALE)
473
+ ↓
474
+ Evidence-backed answer
475
+ ```
476
+
477
+ ### 1. Working Tree & Index Freshness (`codegraph git-state`)
478
+ Tracks current branch, current HEAD commit, indexed commit, and modified/staged files with sub-millisecond status caching:
479
+ ```bash
480
+ codegraph git-state
481
+ ```
482
+ Never silently serves stale repository facts. Explicitly reports `CLEAN`, `DIRTY`, `STALE`, `REINDEXING`, or `ERROR`.
483
+
484
+ ### 2. Deep Visual Downstream Impact Tree (`codegraph git-impact --tree`)
485
+ Traverses affected callers, routes, tests, and DB writers with token-bounded results and visual ASCII hierarchy:
486
+ ```bash
487
+ codegraph git-impact --tree
488
+ ```
489
+
490
+ ### 3. Semantic & Contract Merge Conflicts (`codegraph git-conflicts`)
491
+ Detects silent merge conflicts before git merge or pull request landing—such as branch A invoking a function or route handler that branch B deleted or altered:
492
+ ```bash
493
+ codegraph git-conflicts main HEAD
494
+ ```
495
+
496
+ ### 4. Structural AST Diff (`codegraph git-diff`)
497
+ Computes semantic AST differences between Git revisions (added/removed/modified symbols, changed parameter signatures):
498
+ ```bash
499
+ codegraph git-diff HEAD~1 HEAD
500
+ ```
501
+
502
+ ### 5. Deterministic Symbol History (`codegraph symbol-history`)
503
+ Traces symbol lifecycle across commits (introduced, modified, moved, renamed, or deleted):
504
+ ```bash
505
+ codegraph symbol-history resolve_target
506
+ ```
507
+
508
+ ### 6. GitHub Action for Pull Request Impact
509
+ Automate change impact directly in your CI pipeline with `.github/workflows/codegraph-pr-impact.yml` and `.github/actions/codegraph-impact/action.yml`.
510
+
511
+ ---
512
+
513
+ ## 9. Measured Performance and Scaling Benchmarks
514
+
515
+ ### 4-Tier Scaling Summary (`54` → `2,504` Files)
516
+
517
+ Recorded using [`benchmarks/run_v217_indexing_benchmark.py`](benchmarks/run_v217_indexing_benchmark.py) on macOS `arm64`, Python `3.13` with permanent SQLite WAL concurrency:
518
+
519
+ | Workload Tier | Files | Symbols | Graph Edges | Baseline Total | v2.2.1 Total | Improvement | Peak RSS | Peak WAL | Final WAL |
520
+ | :--- | ---: | ---: | ---: | ---: | ---: | :--- | ---: | ---: | ---: |
521
+ | **Small** | `54` | `115` | `398` | `0.527 s` | `0.325 s` | **38.3% faster (`1.62x`)** | `46.25 MB` | `1.544 MB` | `0.0 MB` |
522
+ | **Medium** | `304` | `615` | `2,248` | `2.564 s` | `1.613 s` | **37.1% faster (`1.59x`)** | `62.67 MB` | `4.098 MB` | `0.0 MB` |
523
+ | **Large** | `1,004` | `2,015` | `7,428` | `8.730 s` | `5.296 s` | **39.3% faster (`1.65x`)** | `103.44 MB` | `5.033 MB` | `0.0 MB` |
524
+ | **Stress** | `2,504` | `5,015` | `18,528` | `21.983 s` | `13.395 s` | **39.1% faster (`1.64x`)** | `180.89 MB` | `6.628 MB` | `0.0 MB` |
525
+
526
+ ### Stress Tier (`2,504` Files) Phase Breakdown
527
+
528
+ | Phase / Metric | Legacy Baseline | v2.2.1 Release | Measured Improvement |
529
+ | :--- | ---: | ---: | :--- |
530
+ | **Total Indexing Time** | `21.983 s` | `13.395 s` | **39.1% faster (`1.64x`)** |
531
+ | **Database Intelligence Pass** | `4.818 s` | `0.832 s` | **82.7% faster (`5.79x`)** |
532
+ | **Post-Processing Phase** | `13.770 s` | `7.056 s` | **48.8% faster (`1.95x`)** |
533
+ | **Symbol Resolution Phase** | `3.133 s` | `1.107 s` | **64.7% faster (`2.83x`)** |
534
+ | **Single-File Incremental Update** | `4.408 s` | `2.063 s` | **53.2% faster (`2.14x`)** |
535
+ | **Throughput (`files/sec`)** | `113.9 files/s` | `186.9 files/s` | **`+64.1%` throughput** |
536
+ | **Peak SQLite WAL Size** | `46.980 MB` | `6.628 MB` | **85.9% reduction (`7.09x` smaller)** |
537
+ | **Final SQLite WAL Size** | `0.000 MB` | `0.000 MB` | **100% reclaimed (`TRUNCATE`)** |
538
+
539
+ ![CodeGraph MCP — Measured Large-Repository Scaling](docs/assets/large_repo_scaling.svg)
540
+
541
+ ### 50-Task Production Benchmark Results (`v2.2.1`)
542
+
543
+ Evaluated across 50 production tasks and 10 categories via [`benchmarks/run_v21_eval.py`](benchmarks/run_v21_eval.py):
544
+
545
+ | Production Benchmark Metric | Measured Result | Production Target | Status |
546
+ | :--- | :---: | :---: | :---: |
547
+ | **Task Coverage** | **88.0%** | $\ge 80.0\%$ | **PASS** |
548
+ | **Symbol Recall** | **61.9%** | $\ge 50.0\%$ | **PASS** |
549
+ | **FACT Correctness** | **100.0%** | $\ge 98.0\%$ | **PASS** |
550
+ | **Unsupported Claim Rate (Hallucinations)** | **0.0%** | $\le 1.0\%$ | **PASS** |
551
+ | **UNKNOWN Correctness** | **98.0%** | $\ge 95.0\%$ | **PASS** |
552
+ | **AMBIGUITY Correctness** | **100.0%** | $\ge 90.0\%$ | **PASS** |
553
+ | **Average Context Payload** | **510 tokens** | $\le 1,000$ tokens | **PASS** |
554
+ | **Average Context Latency** | **40.52 ms** | $\le 100$ ms | **PASS** |
555
+ | **Token Reduction vs Full-File Extraction** | **41.8%** | $\ge 35.0\%$ | **PASS** |
556
+
557
+ ### 32-Task A/B Exploration Evaluation ([`src/codegraph/tool_selection_eval.py`](src/codegraph/tool_selection_eval.py))
558
+
559
+ | Metric (32-Task Evaluation Suite) | Mode A (Unassisted Grep & File Reads) | Mode B (CodeGraph MCP) | Measured Improvement |
560
+ | :--- | ---: | ---: | :--- |
561
+ | **Total Tool Calls (32 Tasks)** | `164 calls` (`~5.1 / task`) | `71 calls` (`~2.2 / task`) | **`-56.7% fewer tool calls`** |
562
+ | **Direct Full-File Reads** | `161 full-file reads` | `7 bounded slice reads` | **`-95.7% fewer file reads`** |
563
+ | **Context Tokens per Task** | `3,000 – 12,000+ tokens` | `~510 tokens` avg | **`65.0% – 85.6% token reduction`** |
564
+ | **Query Latency (`p50`)** | Hundreds of ms (multi-step `grep`) | `20.0 ms` cold / `0.67 ms` warm | **Sub-20ms indexed lookup** |
565
+ | **First-Tool Selection Accuracy** | `9.38%` | `100.0%` | **`+90.62%`** |
566
+ | **Unsupported Claims (Hallucinated Edges)** | `11 (34.38%)` | `0 (0.00%)` | **`0% unsupported claims`** |
567
+ | **Task Accuracy** | `59.84%` | `100.0%` | **`+40.16%`** |
568
+
569
+ ![CodeGraph MCP — Measured Context & Exploration Efficiency](docs/assets/performance_comparison.svg)
570
+
571
+ ---
572
+
573
+ ## 10. Where CodeGraph MCP Fits
574
+
575
+ CodeGraph MCP works **alongside** your editor's language server (LSP), `ripgrep`, and structural AST tools:
576
+
577
+ Legend: `✓` supported • `◐` partial / workflow-dependent • `—` not supported
578
+
579
+ | Capability | CodeGraph MCP (`v2.2.1`) | Editor LSP | Structural AST (`ast-grep`) | Lexical Search (`ripgrep`) | Remote Code Search (`Sourcegraph`) |
580
+ | :--- | :---: | :---: | :---: | :---: | :---: |
581
+ | **100% Local-First & Offline Operation** | ✓ | ✓ | ✓ | ✓ | — |
582
+ | **Native MCP Server for AI Agents** | ✓ (14 default / 56 full) | — | ◐ | — | ✓ |
583
+ | **Multi-Transport Support (stdio + SSE HTTP)** | ✓ | — | — | — | ◐ |
584
+ | **Zero-Friction Runtime Interceptor (`codegraph run`)** | ✓ | — | — | — | — |
585
+ | **Semantic Symbol Graph (Callers / Callees)** | ✓ | ◐ (Position-based) | ◐ (Pattern-based) | — | ✓ (SCIP) |
586
+ | **Framework Route, Mount & DI Graph** | ✓ (`FastAPI`/`Flask`/`Django`/`Express`) | — | ◐ (Custom rules) | — | — |
587
+ | **Database Schema, ORM, Migration & Table R/W** | ✓ (11 DB tools) | — | — | — | — |
588
+ | **Opt-In Runtime Ingestion & Reconciliation** | ✓ (OTel / JSONL / SQL) | — | — | — | — |
589
+ | **Explicit Epistemic States (`FACT`/`UNKNOWN`)** | ✓ | — | — | — | — |
590
+ | **Literal Text Search Across HTML/JS/CSS/Config** | ✓ (`search_code`) | — | — | ✓ | ✓ |
591
+ | **Interactive Editor Hover & Diagnostics** | — | ✓ | ✓ (Lint/Rewrite) | — | — |
592
+
593
+ ![Repository Retrieval Approaches — Capability Comparison](docs/assets/capability_heatmap.svg)
594
+
595
+ ---
596
+
597
+ ## 11. Security, Privacy & Redaction Boundaries
598
+
599
+ CodeGraph MCP runs **100% locally** (`stdio` / `sse` MCP + local `.codegraph.sqlite3`), never executes repository code during indexing, and enforces strict file-access and redaction boundaries ([`src/codegraph/security/paths.py`](src/codegraph/security/paths.py), [`src/codegraph/security/redaction.py`](src/codegraph/security/redaction.py)):
600
+
601
+ | Security Boundary | Enforcement Mode | Exact Behavior |
602
+ | :--- | :---: | :--- |
603
+ | **Sensitive Files** (`.env`, `*.pem`, `*.key`, `*.crt`, `id_rsa*`, `kubeconfig*`, `.npmrc`, `.pypirc`, `*secret*.json`) | **`BLOCKED`** | Excluded from indexing and FTS; direct inspection via `get_file` or `read_file` is rejected with `SENSITIVE_FILE_ACCESS_DENIED`. |
604
+ | **Path Traversal & Symlinks** (`../`, `%2e%2e`, null bytes, external symlinks) | **`BLOCKED`** | Canonical path check in `resolve_within_repo()` raises `SecurityError(ErrorCode.PATH_OUTSIDE_REPOSITORY)`. |
605
+ | **Binary Files** (`.pyc`, `.so`, `.dylib`, `.dll`, `.exe`, images, archives, PDFs) | **`BLOCKED`** | Classified as `BINARY` and skipped during indexing and text search. |
606
+ | **Environment Variable Reads in Code** (`os.getenv("DATABASE_URL")`) | **Metadata Only** | Records `READS_ENV` with the **variable name only**; never reads `.env` or runtime environment values. |
607
+ | **Database Connection Strings** (`postgresql://user:pass@host:5432/prod`) | **`REDACTED`** | Preserves dialect and database name while sanitizing credentials to `postgresql://[REDACTED]@[REDACTED]/prod`. |
608
+ | **API Keys, Bearer Tokens, JWTs & Private Keys** (`sk-...`, `ghp_...`, `AKIA...`) | **`REDACTED`** | Replaced with `[REDACTED_SECRET]` or `[REDACTED_PRIVATE_KEY]` before indexing, search, or MCP output. |
609
+ | **Runtime HTTP Headers & SQL Literals** (`authorization`, `cookie`, `WHERE password = '...'`) | **`REDACTED`** | Sensitive runtime keys and SQL literals are scrubbed (`[REDACTED]` / `?`) during `ingest_runtime_traces`. |
610
+
611
+ Run `codegraph privacy .` at any time to audit the local database and verify that no sensitive files or unredacted secrets are stored.
612
+
613
+ ---
614
+
615
+ ## 12. MCP Tooling & Profiles (14 Default / 56 Full)
616
+
617
+ By default, `create_server()` exposes the **14-tool `agent` profile** so AI coding agents receive a focused, non-overlapping tool surface. All 56 tools are available under `--profile full`.
618
+
619
+ ### Default `agent` Profile (14 High-Signal Tools)
620
+
621
+ | Category | Tool | Purpose |
622
+ | :--- | :--- | :--- |
623
+ | **Discovery (7)** | `find_symbol` | Locate a symbol definition by short, qualified, or canonical name (`symbol=...`). |
624
+ | | `search_code` | Literal or regex search across Python, JS/TS, HTML/Jinja, CSS, YAML/JSON, Markdown, and SQL. |
625
+ | | `find_references` | Find verified AST reference, import, and registration sites for a symbol. |
626
+ | | `find_callers` | Find functions, methods, or route handlers that call the target symbol (`CALLS`, `POSSIBLE_CALLS`). |
627
+ | | `find_callees` | Find functions, methods, or constructors called by the target symbol. |
628
+ | | `find_tests` | Find `pytest` / `unittest` test functions covering a symbol, route, DI provider, or event handler. |
629
+ | | `find_routes` | Discover FastAPI, Flask, Django, and Express HTTP routes with composed mount prefixes. |
630
+ | **Details & Context (5)** | `get_symbol` | Retrieve signature, decorators, docstring, line range, and methods for a symbol. |
631
+ | | `get_file` | Read bounded line ranges (`start_line`, `end_line`, `max_lines`) and AST symbol outline of a file. |
632
+ | | `get_context` | Compile a token-budgeted, task-aware context packet (`query`, `intent`, `max_tokens`). |
633
+ | | `get_architecture` | Summarize repository languages, layers, packages, entrypoints, routes, and database entities. |
634
+ | | `get_git_impact` | Compute blast-radius impact (`changed_files`, `affected_callers`, `affected_routes`, `tests`) for a Git diff. |
635
+ | **Graph Tracing (2)** | `trace_path` | Find the shortest verified execution path between `from_symbol` and `to_symbol`. |
636
+ | | `trace_flow` | Trace upstream callers and downstream callees around `symbol` up to `depth`. |
637
+
638
+ ### All 6 Implemented MCP Profiles ([`src/codegraph/agent_capabilities.py`](src/codegraph/agent_capabilities.py))
639
+
640
+ | Profile | Tool Count | Description |
641
+ | :--- | :---: | :--- |
642
+ | **`agent`** *(default in `create_server`)* | **14** | High-signal discovery, bounded file inspection, context synthesis, and path tracing. |
643
+ | **`core`** | **13** | Lightweight symbol lookup, callers/callees, imports/dependents, routes, and architecture. |
644
+ | **`graph`** | **17** | Call-graph traversal, blast-radius impact (`analyze_impact`), and test discovery. |
645
+ | **`minimal`** | **21** | Core interrogation plus `get_context`, `search_code`, `read_file`, and `verify_evidence`. |
646
+ | **`developer`** | **34** | Interactive development with Git history (`get_file_history`, `get_recent_changes`) and retrieval planning. |
647
+ | **`full`** | **56** | Complete capability surface including **11 Database tools** (`get_db_schema`, `get_db_table`, `find_db_tables`, `find_db_columns`, `find_db_models`, `find_db_queries`, `find_db_readers`, `find_db_writers`, `find_db_callers`, `find_db_relationships`, `get_db_impact`) and **3 Runtime tools** (`ingest_runtime_traces`, `get_runtime_trace`, `reconcile_static_runtime`). |
648
+
649
+ ---
650
+
651
+ ## 13. Complete CLI Reference
652
+
653
+ Verified against [`src/codegraph/cli.py`](src/codegraph/cli.py):
654
+
655
+ ```bash
656
+ # Agent Onboarding & Uninstall
657
+ codegraph install # Interactive agent detection & setup
658
+ codegraph install --yes --target auto --location local # Non-interactive local setup
659
+ codegraph install --print-config claude # Print MCP JSON + rules for an agent
660
+ codegraph install --dry-run # Preview planned file changes
661
+ codegraph uninstall --yes # Remove CodeGraph MCP agent integrations
662
+
663
+ # Zero-Friction Runtime Interceptor (v2.2.1)
664
+ codegraph run npm run dev # Wrap Node/Express/Next.js dev server
665
+ codegraph run uvicorn main:app --reload # Wrap FastAPI/ASGI dev server
666
+ codegraph run python manage.py runserver # Wrap Django dev server
667
+ codegraph run --sample-rate 0.5 npm test # Sample 50% of captured traces
668
+
669
+ # Repository Initialization & Indexing
670
+ codegraph init . # Initialize and index repository
671
+ codegraph index . --verbose # Incremental index with 16-phase telemetry
672
+ codegraph index . --json # Output structured JSON phase telemetry
673
+ codegraph uninit --dry-run # Preview removal of .codegraph.sqlite3
674
+
675
+ # Process Lifecycle & Upgrade Lock Safety
676
+ codegraph stop # Safely stop CodeGraph MCP server for current repo
677
+ codegraph stop --all # Stop all CodeGraph-owned MCP processes across repos
678
+ codegraph doctor --processes # Inspect active MCP processes & parent PIDs
679
+
680
+ # Health, Integrity & Freshness Diagnostics
681
+ codegraph status . # Show index freshness (sub-50ms Git fast path)
682
+ codegraph doctor . --database --processes # Verify SQLite integrity, FKs, FTS, and memory
683
+ codegraph privacy . # Verify zero sensitive files indexed
684
+ codegraph version # Print CodeGraph MCP version (2.2.1)
685
+
686
+ # Code, Graph, Routes & Context Interrogation
687
+ codegraph search "authenticate" -r . # Search indexed symbols and text chunks
688
+ codegraph symbols src/codegraph/cli.py -r . # List extracted symbols in a file
689
+ codegraph get-symbol Indexer -r . # Get AST details for a symbol
690
+ codegraph resolve-symbol resolve_Repository -r . # Ground symbol or return candidates
691
+ codegraph trace Indexer -d 2 -r . # Trace callers and callees up to depth 2
692
+ codegraph routes -r . --limit 25 --offset 0 # List routes with bounded pagination
693
+ codegraph architecture -r . # Summarize repository architecture
694
+ codegraph context "trace /api/v1/auth/login" -r . # Compile token-budgeted ContextPacket
695
+
696
+ # MCP Server Subcommands
697
+ codegraph serve . # Start stdio MCP server (14 default tools)
698
+ codegraph serve . --profile full # Start stdio MCP server with all 56 tools
699
+ codegraph serve . --transport sse --port 8765 # Start SSE HTTP server on port 8765
700
+ codegraph mcp serve . --transport sse # Alias for SSE MCP server
701
+ codegraph mcp stop # Stop active MCP processes
702
+ ```
703
+
704
+ ---
705
+
706
+ ## 14. Documentation Map
707
+
708
+ - **Deep Agent Brain & 56-Tool Reference**: [`docs/agent-brain.md`](docs/agent-brain.md)
709
+ - **Compact Tool Capabilities Summary**: [`agent-rules/tool-capabilities-summary.md`](agent-rules/tool-capabilities-summary.md)
710
+ - **Detailed Multi-Tool Capability Comparison**: [`docs/tool-comparison.md`](docs/tool-comparison.md)
711
+ - **Antigravity Skill (`SKILL.md`)**: [`.agents/skills/codegraph/SKILL.md`](.agents/skills/codegraph/SKILL.md)
712
+ - **Agent Rule Packs (`Claude`, `Cursor`, `Antigravity`, `Codex`, `Gemini`, `Cline`)**: [`agent-rules/README.md`](agent-rules/README.md) & [`agent-rules/AGENTS.md`](agent-rules/AGENTS.md)
713
+ - **Engineering & Production Readiness**: [`docs/engineering/production-readiness.md`](docs/engineering/production-readiness.md)
714
+ - **Reproducible Scaling Benchmark Script**: [`benchmarks/run_v217_indexing_benchmark.py`](benchmarks/run_v217_indexing_benchmark.py)
715
+ - **Changelog**: [`CHANGELOG.md`](CHANGELOG.md)
716
+
717
+ ---
718
+
719
+ ## 15. Contributing & License
720
+
721
+ ```bash
722
+ git clone https://github.com/raghurammrsd/CODE_GRAPH_MCP.git
723
+ cd CODE_GRAPH_MCP
724
+ python3 -m venv .venv
725
+ source .venv/bin/activate
726
+ pip install -e ".[dev,mcp,system]"
727
+
728
+ python3 -m ruff check .
729
+ python3 -m mypy src/
730
+ python3 -m pytest -q
731
+ ```
732
+
733
+ Licensed under the [MIT License](LICENSE).