ProjGraph MCP Server
Analyze .NET solutions: Generate Mermaid graphs, ERDs, class diagrams, and project metrics.
Open source Open in the app JSON README (API)
About
Analyze .NET solutions: Generate Mermaid graphs, ERDs, class diagrams, and project metrics.
Details
- Kind
- MCP servers
- Topic
- Media, design & games
- Publisher
- handys11
- Origin
- official
- Category
- ferramentas
- Transport
- local
- Version
- 1.1.0
- Stars
- 1
- Last push
- 2026-09-01T18:38:17Z
- Repository state
- ativo
- Language
- C#
- License
- MIT
- Added
- 2026-08-29 03:01:57
- Updated
- 2026-08-29 03:01:57
- Origin id
io.github.HandyS11/projgraph
README
<div align="center">
# ProjGraph
**.NET tool ecosystem for visualizing project dependencies, database schemas, and class hierarchies.**
[](https://github.com/HandyS11/ProjGraph/actions/workflows/ci.yml)
[](https://github.com/HandyS11/ProjGraph/actions/workflows/publish.yml)
[](./LICENSE)
[](https://www.nuget.org/packages/ProjGraph.Cli)
[](https://www.nuget.org/packages/ProjGraph.Cli)
[](https://www.nuget.org/packages/ProjGraph.Mcp)
[](https://www.nuget.org/packages/ProjGraph.Mcp)
</div>
**ProjGraph** is a .NET tool ecosystem for visualizing project dependencies, database schemas, and class hierarchies.
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:
```bash
# Install
dotnet tool install -g ProjGraph.Cli
# Visualize project dependencies
projgraph visualize ./MySolution.slnx
# Generate Entity Relationship Diagram (from DbContext or ModelSnapshot)
projgraph erd ./Data/MyDbContext.cs
# Generate Class Diagram for a class and its hierarchy
projgraph classdiagram ./Models/User.cs
# Compute key solution metrics (project counts, depth, hotspots)
projgraph stats ./MySolution.slnx
```
๐ [Full CLI Documentation](./src/ProjGraph.Cli/README.md)
### MCP Server
Configure your MCP client (e.g., GitHub Copilot, Claude) with the following settings:
> Find the latest version number on [NuGet](https://www.nuget.org/packages/ProjGraph.Mcp)
```json
{
"servers": {
"ProjGraph.Mcp": {
"type": "stdio",
"command": "dnx",
"args": ["ProjGraph.Mcp@x.x.x", "--yes"]
}
}
}
```
๐ [Full MCP Documentation](./src/ProjGraph.Mcp/README.md)
## โจ Key Features
- **๐ Multiple Output Formats**: ASCII tree and Mermaid.js diagrams
- **๐๏ธ Entity Relationship Diagrams**: Generate ERDs from EF Core `DbContext` or `ModelSnapshot` files
- **๐๏ธ Class Hierarchies**: Visualize class diagrams with inheritance and dependencies
- **๐ Solution Metrics**: Project counts, type breakdown, dependency depth, and hotspot detection
- **๐ 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
## ๐ ๏ธ Development
### Prerequisites
- [.NET 10.0 SDK](https://dotnet.microsoft.com/download) or later
### Run Locally
```bash
# CLI
dotnet run --project src/ProjGraph.Cli -- visualize ./ProjGraph.slnx
# Stats
dotnet run --project src/ProjGraph.Cli -- stats ./ProjGraph.slnx
# MCP Server
dotnet run --project src/ProjGraph.Mcp
```
## ๐ Usage Examples
### Analyze Project Dependencies
```bash
# Tree format (default)
projgraph visualize ./MySolution.sln
# Mermaid format for documentation
projgraph visualize ./MySolution.slnx --format mermaid --output docs/dependencies.mmd
```
### Generate Database Diagrams
```bash
# Generate ERD from DbContext
projgraph erd ./Data/MyDbContext.cs
# Generate ERD from ModelSnapshot (leveraging migrations)
projgraph erd ./Migrations/MyDbContextModelSnapshot.cs
# Output to Markdown for documentation
projgraph erd ./Data/MyDbContext.cs --output docs/database-schema.md
# Control how EF Core owned types (OwnsOne/OwnsMany) are rendered:
# 'mirror' (default) inlines a table-split owned type onto its owner as EF names it;
# 'classic' gives every owned type its own entity box regardless of table mapping
projgraph erd ./Data/MyDbContext.cs --owned-mode classic
```
### Visualize Class Hierarchies
```bash
# Generate diagram for a class and its inheritance and dependencies
projgraph classdiagram ./Models/Admin.cs -i -d
# Control discovery depth (default: 1)
projgraph classdiagram ./Models/Admin.cs -i -d --depth 5
```
### Analyze Solution Metrics
```bash
# Display project counts, depth stats, and hotspot projects
projgraph stats ./MySolution.slnx
# Show top 10 most-referenced projects
projgraph stats ./MySolution.slnx --top 10
```
### With AI Assistants
Once the MCP server is configured:
```text
You: "Analyze the dependencies in my solution"
AI: [Generate the architecture diagram]
You: "Generate a class diagram for the User class"
AI: [Generates the class hierarchy]
You: "Show me the entity relationships in my DbContext"
AI: [Generates the database schema]
You: "Give me a health summary of my solution"
AI: [Returns project counts, depth stats, and hotspot projects]
```
## ๐ Links
- **CLI Package**: [ProjGraph.Cli on NuGet](https://www.nuget.org/packages/ProjGraph.Cli)
- **MCP Package**: [ProjGraph.Mcp on NuGet](https://www.nuget.org/packages/ProjGraph.Mcp)
## ๐ Samples & Showcase
Explore live examples of ProjGraph's capabilities in the [Samples Showcase](./samples/README.md).
Available samples include:
- **E-commerce ERD**: Complex database model with inheritance and hierarchies.
- **Design Patterns**: Deep class diagrams showing pattern implementation.
- **Modular Architecture**: Project dependency visualization for modern solutions.
- **Simple Hierarchy**: Easy entry-level examples for new users.
- **Solution Metrics**: Architectural health summary with project counts, depth, and hotspots.
## ๐ Documentation
- [Architecture Overview](./ARCHITECTURE.md) - Solution structure and design decisions
- [Contributing Guide](./CONTRIBUTING.md) - How to contribute to the project
- [Security Policy](./SECURITY.md) - Security reporting guidelines