
Roslyn Code Analysis
STDIOMCP server for C# code analysis using Roslyn compiler platform
MCP server for C# code analysis using Roslyn compiler platform
A Model Context Protocol (MCP) server that provides C# code analysis capabilities using the Roslyn compiler platform. This tool helps validate C# files, find symbol references, and perform static code analysis within the context of a .NET project.
ValidateFile
: Validates a C# file using Roslyn and runs code analyzersFindUsages
: Finds all references to a symbol at a specified position{ "servers": { "RoslynMCP": { "type": "stdio", "command": "dotnet", "args": [ "run", "--no-build", "--project", "E:/Source/roslyn-mcp/RoslynMCP/RoslynMCP/RoslynMCP.csproj" ] } } }
When done implementing changes, run these validation steps as human will not accept work unless these are done:
- Always use Roslyn validation tool on C# (.cs) files
dotnet run
Validate a C# file:
ValidateFile --filePath="/path/to/your/file.cs" --runAnalyzers=true
Find all usages of a symbol:
FindUsages --filePath="/path/to/your/file.cs" --line=10 --column=15
Microsoft.CodeAnalysis
libraries for code analysis