Submit

Ast Metrics

@Halleck45

Static code analyzer with MCP server. Gives AI agents access to complexity metrics, coupling analysis, community detection, risk scoring, and test quality, without reading every file.
Overview

AST Metrics is a multi-language static code analyzer (Go, PHP, Python, Rust, TypeScript...) that exposes architectural insights via MCP. AI coding agents can query complexity hotspots, dependency graphs, coupling metrics, architectural communities, and test quality on demand.

No server required. No account. One binary. Works offline.

Tools exposed

  • analyze_project -- High-level project overview: languages, average complexity, maintainability, top risks
  • get_file_metrics -- Detailed metrics for a specific file (complexity, LOC, coupling, maintainability)
  • find_risky_code -- Ranked list of riskiest files/classes (composite score: complexity + coupling + change frequency)
  • find_complex_code -- Functions/classes above a cyclomatic complexity threshold
  • get_dependencies -- Dependency subgraph around a component
  • get_coupling -- Afferent and efferent coupling for a component
  • get_communities -- Architectural community detection with modularity metrics
  • get_test_quality -- Test isolation, traceability, god tests, orphan classes

Installation

curl -s https://raw.githubusercontent.com/Halleck45/ast-metrics/main/scripts/download.sh|bash

Configuration

Add to .mcp.json:

{
  "mcpServers": {
    "ast-metrics": {
      "command": "ast-metrics",
      "args": ["mcp", "."]
    }
  }
}

Server Config

{
  "mcpServers": {
    "ast-metrics": {
      "command": "ast-metrics",
      "args": [
        "mcp",
        "."
      ]
    }
  }
}
© 2025 MCP.so. All rights reserved.

Build with ShipAny.