About RR MCP Server for .NET Analysis
An MCP server that extracts interface, OpenAPI, and data-model structure from .NET solutions using PowerShell scripts. It is intended to give AI agents project-level context without exposing source contents, with cached results for repeated analysis.
Key features
- 01Extracts interfaces and OpenAPI information
- 02Extracts models, entities, and enums
- 03Caches results per project
- 04Supports relative and absolute solution paths
- 05Cross-platform PowerShell 7 operation
Use cases
- 01Give coding agents .NET project structure
- 02Inspect interfaces and data types in a solution
- 03Reuse cached analysis across repeated runs
MCP support
The server exposes tools including `GetInterfaces` and `GetData` to MCP clients. Clients pass a `.sln` path to retrieve interface and data-structure information.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMERR 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
- ModelContextProtocol — Official C# SDK for Model Context Protocol servers and clients. GitHub
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
.slnpaths - 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
*Entitysuffix is included as an entity (no base class requirement).
- Any class with
- 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 nameb: 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 tomcp_debug.log/mcp_data_debug.log.
Requirements
- .NET 9.0 SDK or later
- PowerShell 7.0+ (
pwshmust be set in PATH system variable)
Setup
-
Clone and build
git clone cd RR.MCP dotnet build -
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).
-
Usage Simply add these rules for your agents to call the tools:
- Call the
GetInterfacestool to extract interfaces/OpenAPI info. - Call the
GetDatatool to extract all Models, Entities, and Types (enums) with structure. - Pass the path to your
.slnfile as thesolutionFileparameter (absolute or relative to the server working directory).
- Call the
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) andmcp_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.ps1orGetDataPwsh.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
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.