Skip to content

get_repository_stats MCP tool returns incorrect counts for indexed repo #682

Closed

Description

@ayackel

Description

get_repository_stats (MCP tool) returns wrong counts for an indexed repository, even after a complete fresh re-index.

Steps to Reproduce

  1. Index a large Python/Django project (~1400 Python files, ~29K functions, ~3800 classes)
  2. Verify via cgc stats CLI that indexing completed:
    Files:    1892
    Functions: 29086
    Classes:   3797
    Modules:   1838
    
  3. Call get_repository_stats MCP tool with the repo path

Expected Result

Stats matching (or close to) the CLI output.

Actual Result

{"files": 1, "functions": 0, "classes": 0, "modules": 16}

The Cypher query MATCH (f:File) WHERE f.path STARTS WITH '{repo_path}' RETURN count(f) correctly returns 1892, so the data is in Neo4j — the get_repository_stats tool query is broken.

Environment

  • CGC version: 0.2.14 (also reproduced on 0.2.5 and 0.2.8)
  • Database: Neo4j
  • OS: Linux (Ubuntu/WSL2)

Activity

  1. github-actions commented on Mar 10, 2026

    @github-actions
    Contributor

    Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

  2. added a commit that references this issue on Mar 10, 2026
  3. Shashankss1205 commented on Mar 10, 2026

    @Shashankss1205
    Collaborator

    can you please see if the issue gets resolved in the latest version 0.2.12?

  4. added a commit that references this issue on Mar 24, 2026
  5. added a commit that references this issue on Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions