- Home
- MCP servers
- Roslyn Code Analysis
Roslyn Code Analysis
- other
22
GitHub Stars
other
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"egorpavlikhin-roslyn-mcp": {
"command": "dotnet",
"args": [
"run",
"--no-build",
"--project",
"E:/Source/roslyn-mcp/RoslynMCP/RoslynMCP/RoslynMCP.csproj"
]
}
}
}You run a Roslyn-based MCP Server that analyzes C# code, validates syntax and semantic issues, finds symbol usages, and runs Microsoft-recommended code analyzers within your .NET projects. It helps you validate files in their project context and quickly locate references across a codebase, making static analysis and code quality checks faster and repeatable.
How to use
You interact with the Roslyn Code Analysis MCP Server through an MCP client. Start the server locally, then issue commands to validate C# files, locate symbol usages, and run analyzers within your project context. Use the provided tools to ensure your code is syntactically correct, semantically sound, and aligned with Microsoft’s code analysis recommendations. The server returns diagnostics that include syntax errors, semantic issues, and analyzer warnings so you can fix problems before compilation.
How to install
Prerequisites you need before installing and running the server:
-
.NET SDK
-
MSBuild tools
-
Roslyn analyzers NuGet packages (will be loaded if available)
How to install
# 1) Build the Roslyn MCP project (adjust path if needed)
# If you have the project on disk, navigate there first
cd /path/to/RoslynMCP
# 2) Run the MCP server with the explicit project path
# This starts the server and it will listen for MCP commands via standard I/O
dotnet run --no-build --project E:/Source/roslyn-mcp/RoslynMCP/RoslynMCP/RoslynMCP.csproj
```},
Additional sections
Configuration and purpose: The server is configured to operate as a stdio MCP server. It uses the Roslyn CodeAnalysis libraries to validate C# files, locate symbol usages, and analyze code with standard analyzers within project contexts. The supported tools are:
- ValidateFile: Validates a C# file using Roslyn and runs code analyzers
- FindUsages: Finds all references to a symbol at a specified position
Example workflow
- Start the server using the runtime command described in the installation steps.
- Submit a C# file for validation with analyzers enabled.
- Request all usages of a symbol at a given file position to understand its references across the project.
- Review the diagnostic output to address syntax, semantic, and analyzer warnings.
Available tools
ValidateFile
Validates a C# file using Roslyn and runs code analyzers, returning syntax, semantic, and analyzer diagnostics.
FindUsages
Finds all references to a symbol at a specified position in a C# file, showing usages across the project.