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 分