Roslyn MCP
A Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn
What is Roslyn MCP?
Roslyn MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server that provides c# code analysis capabilities using microsoft roslyn
A Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol (MCP) server that provides C# code
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx roslynmcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Roslyn MCP
RoslynMCP is an MCP server that brings Microsoft's Roslyn compiler platform into your AI assistant, providing deep semantic analysis of C# codebases. Unlike simple text search, it understands the full type system—letting you search for symbols by pattern, find all references to a class or method across an entire solution, retrieve detailed type and signature information, analyze namespace dependencies, and measure cyclomatic complexity. .NET developers use it to navigate large C# solutions and get AI-assisted refactoring guidance grounded in real semantic data.
Prerequisites
- .NET SDK 8.0 or later installed (dotnet CLI must be available)
- A C# solution or project file (.sln or .csproj) to analyze
- Git to clone the repository
- An MCP-compatible client such as Claude Desktop
Clone the RoslynMCP repository
Clone the project from GitHub and navigate into the server project directory.
git clone https://github.com/carquiza/RoslynMCP.git
cd RoslynMCP/RoslynMcpServerRestore dependencies and build
Restore NuGet packages and compile the server. A platform-specific setup script is also available.
dotnet restore
dotnet buildRun the server
Start the MCP server. It listens on stdio for MCP protocol messages. Keep note of the absolute path to the built executable for the config step.
dotnet runConfigure Claude Desktop to use the server
Add the server to claude_desktop_config.json. Use the absolute path to your project directory so the server can locate the built binary.
Test symbol search
Ask Claude to search for symbols in your C# solution to verify the server is connected and analyzing your code correctly.
Roslyn MCP Examples
Client configuration
Add this to your claude_desktop_config.json, replacing the path with your actual RoslynMcpServer build output path.
{
"mcpServers": {
"roslynmcp": {
"command": "dotnet",
"args": ["run", "--project", "/absolute/path/to/RoslynMCP/RoslynMcpServer"],
"env": {
"DOTNET_ENVIRONMENT": "Production",
"LOG_LEVEL": "Information"
}
}
}
}Prompts to try
Example prompts that use Roslyn's semantic analysis capabilities.
- "Search for all classes ending with 'Service' in my solution"
- "Find all references to the UserRepository class across the entire codebase"
- "Get detailed information about the CalculateTotal method including its parameters and return type"
- "Analyze the dependencies between namespaces in this project"
- "Find all methods with cyclomatic complexity higher than 7 and suggest simplifications"Troubleshooting Roslyn MCP
dotnet run fails with restore errors
Ensure you have .NET SDK 8.0+ installed ('dotnet --version'). Run 'dotnet restore' inside the RoslynMcpServer directory explicitly before building.
Symbol search returns no results
Confirm the server is pointed at a directory containing a valid .sln or .csproj file. The server needs to successfully load the solution before it can search symbols.
High memory usage on large solutions
Roslyn loads the full compilation model in memory. For solutions with many projects, ensure at least 4 GB of RAM is available. Close other memory-intensive applications while running analysis.
Frequently Asked Questions about Roslyn MCP
What is Roslyn MCP?
Roslyn MCP is a Model Context Protocol (MCP) server that model context protocol (mcp) server that provides c# code analysis capabilities using microsoft roslyn It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Roslyn MCP?
Follow the installation instructions on the Roslyn MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Roslyn MCP?
Roslyn MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Roslyn MCP free to use?
Yes, Roslyn MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Roslyn MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to Roslyn MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Roslyn MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Roslyn MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.