ProjGraph MCP Server

io.github.HandyS11由 GitHub 帳號 HandyS11 發布v1.2.0更新於 Oct 27, 2026

Analyze .NET solutions: Generate Mermaid graphs, ERDs, class diagrams, and project metrics.

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,分析 .NET 解決方案並產生 Mermaid 圖、ERD、類別圖與專案指標,供 AI 助理使用。

可以做什麼
  • 為 .slnx、.sln 與 .csproj 檔案產生專案相依圖,可輸出 Mermaid 圖或 ASCII 樹狀圖
  • 從 EF Core DbContext 或 ModelSnapshot 檔案產生實體關聯圖
  • 為某個類別及其繼承與相依關係繪製類別圖
  • 計算解決方案指標:專案數量、型別分布、相依深度與熱點專案
適用情境
適合在助理需要理解 .NET 程式碼庫架構時使用:梳理專案相依、記錄資料庫結構、探索類別階層,或快速取得解決方案的健康概況。
執行需求
以 .NET 工具(NuGet 上的 ProjGraph.Mcp)透過 stdio 在本機執行,通常以 dnx 啟動。需要 .NET 10.0 SDK 或更新版本。未宣告驗證、環境變數或標頭。助理需能存取要分析的解決方案、專案或原始碼檔案。
安裝前請注意
此伺服器會讀取本機原始碼檔案,請只指向你願意在助理工作階段中曝露的程式碼庫。其功能為唯讀分析(產生圖與指標),未記載任何寫入、傳送或刪除操作。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 ProjGraph MCP Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ProjGraph

.NET tool ecosystem for visualizing project dependencies, database schemas, and class hierarchies.

[CI] [CD] [License]

[ProjGraph.Cli NuGet] [ProjGraph.Cli Downloads] [ProjGraph.Mcp NuGet] [ProjGraph.Mcp Downloads]

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
# Installdotnet tool install -g ProjGraph.Cli
# Visualize project dependenciesprojgraph visualize ./MySolution.slnx
# Generate Entity Relationship Diagram (from DbContext or ModelSnapshot)projgraph erd ./Data/MyDbContext.cs
# Generate Class Diagram for a class and its hierarchyprojgraph classdiagram ./Models/User.cs
# Compute key solution metrics (project counts, depth, hotspots)projgraph stats ./MySolution.slnx

📖 Full CLI Documentation

MCP Server

Configure your MCP client (e.g., GitHub Copilot, Claude) with the following settings:

Find the latest version number on NuGet

json
{  "servers": {    "ProjGraph.Mcp": {      "type": "stdio",      "command": "dnx",      "args": ["[email protected]", "--yes"]    }  }}

📖 Full MCP Documentation

✨ 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

Run Locally

bash
# CLIdotnet run --project src/ProjGraph.Cli -- visualize ./ProjGraph.slnx
# Statsdotnet run --project src/ProjGraph.Cli -- stats ./ProjGraph.slnx
# MCP Serverdotnet run --project src/ProjGraph.Mcp

📝 Usage Examples

Analyze Project Dependencies

bash
# Mermaid format (default)projgraph visualize ./MySolution.sln
# ASCII tree formatprojgraph visualize ./MySolution.sln --format tree
# Mermaid format for documentationprojgraph visualize ./MySolution.slnx --format mermaid --output docs/dependencies.mmd

Generate Database Diagrams

bash
# Generate ERD from DbContextprojgraph erd ./Data/MyDbContext.cs
# Generate ERD from ModelSnapshot (leveraging migrations)projgraph erd ./Migrations/MyDbContextModelSnapshot.cs
# Output to Markdown for documentationprojgraph 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 mappingprojgraph erd ./Data/MyDbContext.cs --owned-mode classic

Visualize Class Hierarchies

bash
# Generate diagram for a class and its inheritance and dependenciesprojgraph 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 projectsprojgraph stats ./MySolution.slnx
# Show top 10 most-referenced projectsprojgraph 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

📚 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

來源:README.md,提交 ffb4bc0

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分