Your code already describes its architecture. ProjGraph draws it.
One command turns a solution, an EF Core DbContext, or a single class into a Mermaid diagram or an ASCII tree. Run it from your terminal, or let an AI assistant run it for you over MCP.
public class LibraryContext : DbContext { public DbSet<Author> Authors { get; set; } public DbSet<Book> Books { get; set; } public DbSet<Publisher> Publishers { get; set; } public DbSet<Review> Reviews { get; set; } } public class Book { public int Id { get; set; } [MaxLength(300)] public string Title { get; set; } public int PublisherId { get; set; } public Publisher Publisher { get; set; } public List<Review> Reviews { get; set; } }
Nothing was annotated to produce this. ProjGraph reads the C# with Roslyn, resolves the navigation properties into relationships, and carries the constraints across — [MaxLength(300)] on the left becomes max:300 on the right. No build, no running database, no migration step.
dotnet tool install -g ProjGraph.Cli
What it draws
Four commands, each pointed at something you already have on disk.
projgraph visualize
Reads a .slnx, .sln, or .csproj and maps how the projects reference each other. Emits Mermaid by default, or an ASCII tree for the terminal.
projgraph erd
Turns an EF Core DbContext or a ModelSnapshot into an entity relationship diagram, including keys, constraints, owned types, and join tables.
projgraph classdiagram
Draws a class with its inheritance chain and dependencies, following related types across the workspace as deep as you ask it to.
projgraph stats
Reports project counts, type breakdown, dependency depth, and the hotspot projects that everything else references.
Two ways to run it
The same analysis, reached either by hand or by an assistant.
Command line
$ projgraph erd ./Data/LibraryContext.cs $ projgraph visualize ./MySolution.slnx --format mermaid $ projgraph stats ./MySolution.slnx --top 10
Writes to stdout by default, or to a file with --output. The Mermaid it emits renders as-is on GitHub and GitLab.
AI assistant
{
"servers": {
"ProjGraph.Mcp": {
"type": "stdio",
"command": "dnx",
"args": ["ProjGraph.Mcp@x.x.x", "--yes"]
}
}
}
Drop this into any MCP client — GitHub Copilot, Claude, and others — then ask about your architecture in plain language.
See it on real code
Every diagram below was generated by ProjGraph from a project in this repository, and is regenerated whenever the tool changes.