🔍 Intelligent code architecture analysis with AI-powered insights
Discover code smells, architectural antipatterns, and technical debt in your projects
- Code Smells Detection: Long methods, magic numbers, code duplication
- SOLID Principles: Violations of single responsibility, open/closed principles
- Architectural Antipatterns: God Objects, tight coupling, circular dependencies
- Quality Metrics: Cyclomatic complexity, cognitive complexity, maintainability index
- Project Structure: Hierarchical analysis with layer detection
- Dependency Mapping: Import/export relationships and circular dependencies
- Technical Debt: Quantified debt assessment with refactoring recommendations
- Risk Assessment: Automated architectural risk evaluation
- MCP Server (Rust, STDIO): Official STDIO JSON-RPC with JSON Schema publishing (no HTTP)
- Structured Reports: JSON/Markdown exports optimized for AI consumption
- Interactive Diagrams: Mermaid diagrams for visual architecture representation
- Context-Rich: Detailed explanations suitable for AI-assisted refactoring
- Multi-Language: Rust, TypeScript, JavaScript, Python, Java, Go, C/C++
- Cross-Platform: Windows, macOS, Linux support
- CLI & Library: Command-line interface and Rust library API
- No Admin Rights: Works without elevated permissions
# Clone repository
git clone https://github.com/yourusername/archlens.git
cd archlens
# Build release binaries
cargo build --release
# Binaries will be available at ./target/release/archlens and ./target/release/archlens-mcp
# Analyze current directory
./target/release/archlens analyze .
# Analyze specific project
./target/release/archlens analyze /path/to/project
./target/release/archlens structure . --show-metrics
# Export comprehensive analysis for AI (summary detail level by default)
./target/release/archlens export . ai_compact --output analysis.md
The ArchLens MCP server provides a clean STDIO JSON‑RPC interface (no HTTP). It exposes:
- Methods:
tools/list
,tools/call
,resources/list
,resources/read
,prompts/list
,prompts/get
- Tool names returned via
tools/list
use underscore format (e.g.,export_ai_summary_json
), while calls accept both underscore and dotted aliases (e.g.,export.ai_summary_json
).
# Build the server
cargo build --release --bin archlens-mcp
# Start MCP Inspector against the server (stdio)
npx @modelcontextprotocol/inspector -- ./target/release/archlens-mcp
# Open the printed Inspector URL to interactively test tools/resources/prompts
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"export_ai_summary_json","arguments":{"project_path":".","top_n":5}}}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ai_recommend","arguments":{"project_path":".","json":{}}}}
# Development build
cargo build
# Release build with optimizations
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run --bin archlens -- analyze .
# Run all tests
cargo test
# With output
cargo test -- --nocapture
This project is licensed under the MIT License - see the LICENSE file for details.