Sponsored by Deepsite.site

RR MCP Server for .NET Analysis

创建者
RaRdqa year ago
RR MCP Server for AI agents for .NET Analysis
内容

RR MCP Server for .NET Analysis

A generic MCP server for extracting .NET interface, OpenAPI, and data (models/entities/enums) information from any .NET solution using PowerShell scripts. The goal is to provide AI with large project structure and abstraction w\o exposing the contents.

Will be updated with more tools for .Net solution AI management and automation.

Dependencies

Features

  • Extracts Models, Entities, Enums, and Interfaces from any .NET solution
  • Gives AI agents full project structure/context to avoid redundant generation
  • Ready-to-use with Cursor, Copilot, Claude, or any MCP-compatible tool
  • Fast with caching, clean output (no stdout noise), full logging to files
  • Auto-discovers scripts, supports relative/absolute .sln paths
  • Cross-platform (Windows, macOS, Linux), requires PowerShell 7+

Output Format Examples

Data Tool (GetData)

  • Model/Entity:
    {
      "n": "UserModel",
      "b": "BaseModel",
      "p": { "Id": "string", "Name": "string", "Age": "int" },
      "prj": "My.Project.Namespace"
    }
    
    • Any class with *Entity suffix is included as an entity (no base class requirement).
  • Enum:
    {
      "n": "StatusType",
      "m": { "Unknown": 0, "Active": 1, "Inactive": 2 },
      "prj": "My.Project.Namespace"
    }
    

Interfaces Tool (GetInterfaces)

  • Interface:
    {
      "n": "IMyService",
      "b": "IBaseService",
      "d": "Service for handling user operations.",
      "m": [
        "Task DoWork(string arg);",
        { "s": "Task<int> GetCount();", "d": "Gets the count." }
      ],
      "prj": "My.Project"
    }
    
    • n: interface name
    • b: base interface (optional)
    • d: interface documentation (optional)
    • m: methods (string for signature, or object with doc)
    • prj: project name

Naming Conventions

  • Models: *Model
  • Entities: *Entity
  • Enums: *Type
  • Interfaces: I*Service, I*Repository, etc.

Manual Script Run (for cache warmup or debugging)

You can run the PowerShell scripts directly to pre-warm the cache or debug output. Run from the repo root or RR.MCP directory:

For interfaces:

pwsh -File RR.MCP/GetInterfacesPwsh.ps1 -SolutionFile MySolution.sln

For data (models/entities/types):

pwsh -File RR.MCP/GetDataPwsh.ps1 -SolutionFile MySolution.sln
  • On Windows, macOS, or Linux, ensure pwsh (PowerShell 7+) is in your PATH.
  • You can specify a different solution file if needed.
  • Output will be written to .cache/ and logs to mcp_debug.log/mcp_data_debug.log.

Requirements

  • .NET 9.0 SDK or later
  • PowerShell 7.0+ (pwsh must be set in PATH system variable)

Setup

  1. Clone and build

    git clone
    cd RR.MCP
    dotnet build
    
  2. Configure your MCP client Add a stdio MCP server entry, e.g.:

    {
      "mcpServers": {
        "rr-mcp": {
          "command": "dotnet",
          "args": ["run", "--project", "<absolute-path-to>/RR.MCP/RR.MCP.csproj"]
        }
      }
    }
    
    • The server will auto-register all available tools (interfaces, data, etc).
  3. Usage Simply add these rules for your agents to call the tools:

    • Call the GetInterfaces tool to extract interfaces/OpenAPI info.
    • Call the GetData tool to extract all Models, Entities, and Types (enums) with structure.
    • Pass the path to your .sln file as the solutionFile parameter (absolute or relative to the server working directory).

Logging & Debugging

  • All C# errors are logged to mcp_errors.log (in the output directory).
  • All PowerShell script activity and errors are logged to mcp_debug.log (interfaces) and mcp_data_debug.log (data) next to the script.
  • The PowerShell scripts will log and return an error if run with PowerShell < 7.

PowerShell Scripts

  • Scripts are always copied to the output directory and invoked with pwsh -File ....
  • They log all key steps, parameters, and errors.
  • They will fail gracefully and log if the solution file is not found or if no data is detected.
  • Caching is per-project and hash-based for fast repeated runs. (first run will be slow on big projects, you should manually run the scripts)

Customization

  • To adapt for other code analysis, edit GetInterfacesPwsh.ps1 or GetDataPwsh.ps1.
  • To add more tools, add new [McpServerTool] methods in the C# tool files.

Integration with Any AI IDE

  • This MCP server is fully generic and can be integrated with any AI IDE or tool that supports MCP stdio transport.
  • Tools are auto-discovered and described via OpenAPI for easy consumption.
  • No IDE-specific logic is present; all output is protocol-compliant.

Cursor Integration Example

If using Cursor, add the following to your .cursor/mcp.json:

{
  "mcpServers": {
    "rr-mcp": {
      "command": "dotnet",
      "args": ["run", "--project", "<absolute-path-to>/RR.MCP/RR.MCP.csproj"]
    }
  }
}

Contributing

  • PRs and issues welcome!
  • Please ensure all output is protocol-compliant and all logs go to file only.

License

MIT

推荐的 MCP Server
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
DeepChatYour AI Partner on Desktop
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。