ProjGraph.Mcp 1.0.2

{
  "servers": {
    "projgraph.mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": ["projgraph.mcp@1.0.2", "--yes"]
    }
  }
}
                    
This package contains an MCP Server. The server can be used in VS Code by copying the generated JSON to your VS Code workspace's .vscode/mcp.json settings file.
dotnet tool install --global ProjGraph.Mcp --version 1.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ProjGraph.Mcp --version 1.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ProjGraph.Mcp&version=1.0.2
                    
nuke :add-package ProjGraph.Mcp --version 1.0.2
                    

ProjGraph MCP Server

Model Context Protocol (MCP) server that enables AI assistants to analyze .NET solution architectures, generate Entity Relationship Diagrams, and visualize class hierarchies.

NuGet License: MIT

Setup

To use ProjGraph with an MCP-compatible client like Claude or Cursor, add the following configuration to your client's MCP settings file:

Find the latest version number on NuGet

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

Or run from source:

{
  "mcpServers": {
    "projgraph": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "/absolute/path/to/src/ProjGraph.Mcp/ProjGraph.Mcp.csproj"
      ]
    }
  }
}

Capabilities

Tools

Tool Description Primary Parameters
get_project_graph Dependency graph as a Mermaid diagram path, showTitle, includePackages
get_erd Mermaid ERD from EF Core DbContext or ModelSnapshot path, contextName, showTitle
get_class_diagram Mermaid class diagram for C# files or directories path, options, showTitle
get_project_stats Architectural metrics (counts, depth, hotspots, cycles) path, topN

Prompts

Pre-built analysis workflows that guide the LLM through multi-step investigations:

Prompt Description Arguments
architecture_review Comprehensive architecture review of a .NET solution path
dependency_analysis Hotspot and cycle detection for a solution path, topN (optional)
database_schema_review EF Core schema design review path, contextName (optional)
class_structure_review Class hierarchy and design pattern review path

Resources

  • projgraph://welcome — Always-available overview of all server capabilities
  • projgraph://diagrams/{type}/{path} — Cached diagram outputs from tool calls (up to 50 entries, LRU eviction)

Diagram resources are automatically created when tools generate output. Clients receive notifications/resources/list_changed when resources are added or evicted.

Roots

The server resolves relative file paths against workspace roots declared by the client. When a client declares roots via roots/list, passing "MyApp.slnx" instead of "D:/Projects/MyApp/MyApp.slnx" just works.

Progress Notifications

Every tool emits 3-stage notifications/progress reports during execution (e.g., Parsing → Analyzing → Rendering). Clients with progress UI display live feedback; clients without progress support are unaffected.

Tools Reference

get_project_graph

Analyzes a solution or project file and returns the dependency graph as a Mermaid diagram.

Parameters:

  • path (string): Absolute path to .sln, .slnx, or .csproj file
  • showTitle (boolean, optional): Include graph title (default: true)
  • includePackages (boolean, optional): Include NuGet packages in the graph (default: false)

Example prompts:

"Analyze the dependencies in ./MySolution.slnx"
"Show me the project structure"
"Are there any circular dependencies?"

get_erd

Generates a Mermaid Entity Relationship Diagram from an EF Core DbContext or ModelSnapshot file.

Parameters:

  • path (string): Absolute path to a .cs file containing a DbContext or ModelSnapshot
  • contextName (string, optional): Specific class name if multiple exist in the file
  • showTitle (boolean, optional): Include diagram title (default: true)

Features:

  • Detects entities, properties (including types), and relationships from source or migration snapshots
  • Shows primary keys, foreign keys, and constraints
  • Supports inheritance, base classes, data annotations, and Fluent API configurations
  • Handles many-to-many with join tables

Example prompts:

"Show me the database schema from ./Data/MyDbContext.cs"
"Generate an ERD from the migration snapshot in ./Migrations/MyDbContextModelSnapshot.cs"
"What are the entity relationships in my database?"

get_class_diagram

Generates a Mermaid class diagram for the types defined in a specific C# file or directory, with options to discover inheritance and related types in the workspace.

Parameters:

  • path (string): Absolute path to the C# file or directory to analyze
  • options (object, optional): Analysis and discovery options:
    • includeInheritance (boolean): Search for base classes and interfaces (default: false)
    • includeDependencies (boolean): Include classes used as properties or fields (default: false)
    • includeProperties (boolean): Display properties and fields (default: true)
    • includeFunctions (boolean): Display methods (default: true)
    • depth (number): Levels of relationships to follow (default: 1)
  • showTitle (boolean, optional): Include diagram title (default: true)

Example prompts:

"Show me the class diagram for the Models folder"
"Analyze the class hierarchy in ./Services/OrderService.cs"
"Generate a combined diagram for all classes in the Domain project"

get_project_stats

Returns key architectural metrics as structured JSON, useful for reasoning about solution health without a diagram.

Parameters:

  • path (string): Absolute path to .sln, .slnx, or .csproj file
  • topN (number, optional): Top most-referenced projects to include (default: 5)

Returns: Project count, type breakdown (library/executable/test), dependency depth stats, cycle detection, and hotspot ranking.

Example prompts:

"How many projects are in my solution and what types are they?"
"Which projects are referenced the most in ./MySolution.slnx?"
"Is there a circular dependency in my solution?"

License

Licensed under the terms specified in the repository.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.2 249 4/7/2026
1.0.1 156 4/4/2026
1.0.0 140 3/12/2026
0.8.0 129 3/11/2026
0.7.1 136 3/4/2026
0.7.0 139 2/26/2026
0.6.7 135 2/26/2026
0.6.6 144 2/26/2026
0.6.5 131 2/26/2026
0.6.4 126 2/26/2026
0.6.3 130 2/26/2026
0.6.2 133 2/26/2026
0.6.1 140 2/26/2026
0.6.0 136 2/26/2026
0.5.1 148 2/20/2026
0.5.0 129 2/17/2026
0.4.0 138 2/6/2026
0.3.4 140 2/5/2026
0.3.3 144 1/30/2026
0.3.2 138 1/29/2026
Loading failed