Skip to content

A .NET tool ecosystem for visualizing and analyzing project dependencies within solutions. It provides both a CLI for manual analysis and an MCP server for AI-assisted exploration of your codebase architecture.

License

Notifications You must be signed in to change notification settings

HandyS11/ProjGraph

Repository files navigation

ProjGraph

CI CD

ProjGraph.Cli NuGet ProjGraph.Cli Downloads ProjGraph.Mcp NuGet ProjGraph.Mcp Downloads

ProjGraph is a .NET tool ecosystem for visualizing and analyzing project dependencies within solutions. It provides both a CLI for manual analysis and an MCP server for AI-assisted exploration of your codebase architecture.

🚀 Quick Start

CLI Tool

Install and use the command-line tool for immediate visualization:

# Install
dotnet tool install -g ProjGraph.Cli

# Visualize project dependencies
projgraph visualize ./MySolution.slnx

# Generate Entity Relationship Diagram
projgraph erd ./Data/MyDbContext.cs

📖 Full CLI Documentation

MCP Server

Configure your MCP client (e.g., GitHub Copilot, Claude) with the following settings:

Find the latest version number on NuGet

{
  "servers": {
    "ProjGraph.Mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": ["ProjGraph.Mcp@x.x.x", "--yes"]
    }
  }
}

📖 Full MCP Documentation

✨ Key Features

  • 📊 Multiple Output Formats: ASCII tree and Mermaid.js diagrams
  • 🗄️ Entity Relationship Diagrams: Generate ERDs from EF Core DbContext files
  • 🔄 Circular Dependency Detection: Automatically identifies problematic cycles
  • 📁 Modern .NET Support: Full support for .slnx, .sln, and .csproj files
  • 🤖 AI Integration: MCP server for GitHub Copilot, Claude, and other AI assistants
  • ⚡ Fast & Reliable: Efficient parsing and graph algorithms

📦 Project Structure

ProjGraph/
├── src/
│   ├── ProjGraph.Core/      # Domain models (Project, Dependency, SolutionGraph)
│   ├── ProjGraph.Lib/       # Business logic (parsers, algorithms, graph service)
│   ├── ProjGraph.Cli/       # Command-line interface tool
│   └── ProjGraph.Mcp/       # Model Context Protocol server
└── tests/
    ├── ProjGraph.Tests.Unit/        # Unit tests
    ├── ProjGraph.Tests.Integration/ # Integration tests
    └── ProjGraph.Tests.Contract/    # Contract tests for MCP

Layer Responsibilities

  • Core: Domain entities and value objects (no dependencies)
  • Lib: Parsing logic, graph algorithms, and service orchestration
  • Cli: User-facing command-line interface using Spectre.Console
  • Mcp: Model Context Protocol server for AI integration

🛠️ Development

Prerequisites

Run Locally

# CLI
dotnet run --project src/ProjGraph.Cli -- visualize ./ProjGraph.sln

# MCP Server
dotnet run --project src/ProjGraph.Mcp

📝 Usage Examples

Analyze Project Dependencies

# Tree format (default)
projgraph visualize ./MySolution.sln

# Mermaid format for documentation
projgraph visualize ./MySolution.slnx --format mermaid > docs/dependencies.mmd

Generate Database Diagrams

# Generate ERD from DbContext
projgraph erd ./Data/MyDbContext.cs

# Save to documentation
projgraph erd ./Data/MyDbContext.cs > docs/database-schema.md

With AI Assistants

Once the MCP server is configured:

You: "Analyze the dependencies in my solution"
AI: [Uses ProjGraph MCP to analyze and explain your architecture]

You: "Show me the entity relationships in my DbContext"
AI: [Generates and explains the database schema]

🔗 Links

About

A .NET tool ecosystem for visualizing and analyzing project dependencies within solutions. It provides both a CLI for manual analysis and an MCP server for AI-assisted exploration of your codebase architecture.

Topics

Resources

License

Stars

Watchers

Forks

Packages