ProjGraph.Mcp
Enables GitHub Copilot to explore and visualize .NET project dependencies, generate ERDs from EF Core DbContext/ModelSnapshot files, produce class hierarchy diagrams, and compute solution metrics via ProjGraph's MCP tools.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ProjGraph.Mcpgenerate a dependency diagram for ./MySolution.slnx"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ProjGraph
.NET tool ecosystem for visualizing project dependencies, database schemas, and class hierarchies.
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:
# 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.slnxMCP 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"]
}
}
}Related MCP server: Understand-Anything MCP Server
✨ Key Features
📊 Multiple Output Formats: ASCII tree and Mermaid.js diagrams
🗄️ Entity Relationship Diagrams: Generate ERDs from EF Core
DbContextorModelSnapshotfiles🏗️ 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.csprojfiles🤖 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 or later
Run Locally
# 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
# Mermaid format (default)
projgraph visualize ./MySolution.sln
# ASCII tree format
projgraph visualize ./MySolution.sln --format tree
# Mermaid format for documentation
projgraph visualize ./MySolution.slnx --format mermaid --output docs/dependencies.mmdGenerate Database Diagrams
# 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 classicVisualize Class Hierarchies
# 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 5Analyze Solution Metrics
# Display project counts, depth stats, and hotspot projects
projgraph stats ./MySolution.slnx
# Show top 10 most-referenced projects
projgraph stats ./MySolution.slnx --top 10With AI Assistants
Once the MCP server is configured:
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
MCP Package: ProjGraph.Mcp on NuGet
📚 Samples & Showcase
Explore live examples of ProjGraph's capabilities in the Samples Showcase. 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 - Solution structure and design decisions
Contributing Guide - How to contribute to the project
Security Policy - Security reporting guidelines
This server cannot be deployed
Maintenance
Related MCP Connectors
AI Agent with Architectural Memory. Impact analysis (free), tests and code from the graph (pro).
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
AI-powered codebase analysis — call graphs, security, dead code, complexity. 150+ tools.
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI-powered architecture analysis and visualization of codebases, exposing 17 MCP tools for querying components, dependencies, and generating interactive diagrams.16 npm5MIT
- FlicenseAqualityBmaintenanceEnables AI assistants to deeply understand codebases via Knowledge Graphs, supporting fuzzy search, architecture layer queries, call chain tracing, impact analysis, and domain knowledge with multi-project support.182-
- AlicenseNot gradedqualityCmaintenanceProvides semantic code search and code insights via a knowledge graph, enabling AI to understand, navigate, and modify complex projects with deep dependency and architecture analysis.MIT
- AlicenseNot gradedqualityBmaintenanceA semantic map of your .NET solution for AI coding agents. Analyzes a solution with Roslyn into a queryable code graph exposing 11 read-only tools (find_symbol, impact_analysis, find_implementations, etc.) over MCP. 100% local, no telemetry, MIT licensed.25MIT