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.
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.csConfigure 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"]
}
}
}- 📊 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.csprojfiles - 🤖 AI Integration: MCP server for GitHub Copilot, Claude, and other AI assistants
- ⚡ Fast & Reliable: Efficient parsing and graph algorithms
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
- 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
- .NET 10.0 SDK or later
# CLI
dotnet run --project src/ProjGraph.Cli -- visualize ./ProjGraph.sln
# MCP Server
dotnet run --project src/ProjGraph.Mcp# Tree format (default)
projgraph visualize ./MySolution.sln
# Mermaid format for documentation
projgraph visualize ./MySolution.slnx --format mermaid > docs/dependencies.mmd# Generate ERD from DbContext
projgraph erd ./Data/MyDbContext.cs
# Save to documentation
projgraph erd ./Data/MyDbContext.cs > docs/database-schema.mdOnce 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]
- CLI Package: ProjGraph.Cli on NuGet
- MCP Package: ProjGraph.Mcp on NuGet