🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

ProjGraph.Mcp

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ProjGraph.Mcp

MCP server for ProjGraph to interact with LLMs and provide project graph context.

Source
nugetNuGet
Version
1.0.2
Version published
Total downloads
4K
Maintainers
1
Created
Source

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

ToolDescriptionPrimary Parameters
get_project_graphDependency graph as a Mermaid diagrampath, showTitle, includePackages
get_erdMermaid ERD from EF Core DbContext or ModelSnapshotpath, contextName, showTitle
get_class_diagramMermaid class diagram for C# files or directoriespath, options, showTitle
get_project_statsArchitectural metrics (counts, depth, hotspots, cycles)path, topN

Prompts

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

PromptDescriptionArguments
architecture_reviewComprehensive architecture review of a .NET solutionpath
dependency_analysisHotspot and cycle detection for a solutionpath, topN (optional)
database_schema_reviewEF Core schema design reviewpath, contextName (optional)
class_structure_reviewClass hierarchy and design pattern reviewpath

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.

Keywords

AI

FAQs

Package last updated on 07 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts