Architecture metrics analysis server for Java projects using Model Context Protocol
ArchMetrics MCP provides 6 well-named analysis tools with clear descriptions and structured schemas. Naming is action-oriented (analyze_*, find_*, show_*) and follows verb_noun conventions. Descriptions are detailed (150-250 chars on average) and explain purpose, output, and use cases. Input schemas are present and properly typed with descriptions. However, output schemas are not explicitly documented in the source code, the tool returns formatted text rather than structured JSON responses. Error handling exists but lacks actionable recovery guidance. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) are declared despite all tools being READ_ONLY. The 'analyze_modules' tool has good parameter documentation with ranges and defaults, but most other tools have no parameters or minimal parameter annotation beyond type. Overall, this is a solid domain-specific tool suite that meets basic MCP requirements but lacks polish for production agent workflows.
Returns a unified per-package table combining hexagonal layer classification (DOMAIN / PORT / ADAPTER / UNKNOWN) with Main Sequence metrics (Nc, Abstractness A, Instability I, Distance D) and zone label (Zone of Pain / Zone of Uselessness / Main Sequence). Packages configured in .arch-metrics.yml suppress_zones are tagged as suppressed instead of flagged. Sorted by D descending (worst first).
Classifies every package in the project into DOMAIN / PORT / ADAPTER by naming convention, then reports per-layer abstractness, instability, port purity, domain isolation, and an overall Hexagonal Architecture score.
Groups packages into logical modules and returns: Core/Periphery zone classification, Propagation Cost (PC = fraction of system affected by a change), and an ASCII Dependency Structure Matrix (DSM). The optional 'depth' parameter (default 1) controls granularity: depth=1 groups all of 'infrastructure.*' into one node; depth=2 splits it into 'infrastructure.rest', 'infrastructure.persistence', etc.
Scans compiled bytecode for a Java package and computes Robert C. Martin's Main Sequence metrics: Abstractness (A), Instability (I), and Distance from the Main Sequence (D). Writes a timestamped JSON snapshot to .stats/.
Lists every dependency edge that violates the Hexagonal Architecture Dependency Rule (inner layer → outer layer), including the specific class causing each violation. Violation types: DOMAIN→ADAPTER, PORT→ADAPTER.
Output schemas not documented. Tools return formatted text/tables rather than structured JSON. LLMs cannot plan downstream operations or parse specific fields without documented response schemas.
Missing tool annotations. All tools are READ_ONLY (per Risk field), but readOnlyHint is not declared in tool metadata. This prevents agents from understanding safety properties and optimizing execution plans.
Error handling lacks recovery guidance. AnalyzeAllPackagesTool catches IOException and returns 'IO failure: <message>' with no actionable next step (e.g. 'Check project root path' or 'Ensure bytecode compiled via mvn compile').
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 60 | 2026-07-28+ | v2 |
Shows detailed efferent (Ce — packages this package depends on) and afferent (Ca — project packages that depend on this package) coupling lists for a named Java package. Each entry is labelled as (framework), (domain), (port), (adapter), (external), or (internal).
Tools with no parameters (analyze_hexagonal, find_boundary_violations, analyze_all_packages) lack discovery guidance in descriptions. LLMs don't know if running them repeatedly yields different results or requires setup.