Roslyn
Model Context Protocol server for Roslyn-powered C# refactoring operations
What is Roslyn?
Roslyn is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server for roslyn-powered c# refactoring operations
Model Context Protocol server for Roslyn-powered C# refactoring operations
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Model Context Protocol server for Roslyn-powered C# refactor
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx roslynmcpserverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Roslyn
RoslynMcpServer exposes the full power of the Roslyn .NET compiler infrastructure through 41 MCP tools, enabling AI assistants to perform precise C# refactoring operations on real solution files. Tools cover renaming symbols, extracting methods and interfaces, converting to async patterns, analyzing control and data flow, finding references, and computing code metrics — all with live compiler analysis.
Prerequisites
- .NET 8 SDK or later installed (dotnet CLI available in PATH)
- A .NET solution file (.sln) or C# project that Roslyn can load
- Claude Desktop or Claude Code as the MCP client
- Windows, macOS, or Linux (all supported)
Install the RoslynMcp.Server global tool
Install the roslyn-mcp server as a .NET global tool. This makes the roslyn-mcp command available system-wide.
dotnet tool install -g RoslynMcp.ServerVerify the installation
Confirm the tool installed correctly and is on your PATH by checking the version.
roslyn-mcp --versionAdd a project-level MCP config
Create a .mcp.json file in your project or solution root directory. Claude Code reads this automatically when you open the project.
{
"mcpServers": {
"roslyn-refactor": {
"type": "stdio",
"command": "roslyn-mcp",
"args": []
}
}
}Configure Claude Desktop (optional)
For Claude Desktop, add the server to claude_desktop_config.json. The config file location depends on your OS.
{
"mcpServers": {
"roslyn-refactor": {
"command": "roslyn-mcp",
"args": []
}
}
}Restart and verify
Restart Claude and ask it to run the roslyn diagnose tool against your solution file path to confirm it can open the project.
Roslyn Examples
Client configuration
Project-level .mcp.json configuration for Claude Code, placing roslyn-mcp as a stdio server requiring no environment variables.
{
"mcpServers": {
"roslyn-refactor": {
"type": "stdio",
"command": "roslyn-mcp",
"args": []
}
}
}Prompts to try
Example prompts for refactoring, renaming, analysis, and code generation using the Roslyn tools.
- "Rename the class UserService to AccountService in C:/projects/MyApp/MyApp.sln"
- "Extract the validation logic in the Register method into a new private method called ValidateRegistrationInput"
- "Convert the GetUserAsync method to use async/await properly in C:/projects/MyApp/MyApp.sln"
- "Find all references to the IOrderRepository interface across the solution"
- "Get code metrics for the OrderProcessingService class and identify methods with high complexity"Troubleshooting Roslyn
roslyn-mcp command not found after install
Ensure the .NET global tools directory is in your PATH. Run: dotnet tool list -g to confirm installation, then add ~/.dotnet/tools (macOS/Linux) or %USERPROFILE%\.dotnet\tools (Windows) to your PATH environment variable.
Solution file fails to load or open errors
Pass the full absolute path to the .sln file rather than a relative path. Ensure the solution targets a compatible .NET version and that all NuGet packages are restored (dotnet restore) before using the MCP tools.
Refactoring tool returns no results or empty diagnostics
Run the diagnose tool first with verbose output to confirm Roslyn can parse your solution. Ensure you are referencing the correct fully qualified type or symbol name including the namespace.
Frequently Asked Questions about Roslyn
What is Roslyn?
Roslyn is a Model Context Protocol (MCP) server that model context protocol server for roslyn-powered c# refactoring operations It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Roslyn?
Follow the installation instructions on the Roslyn GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Roslyn?
Roslyn works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Roslyn free to use?
Yes, Roslyn is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Roslyn Alternatives — Similar Coding Agents Servers
Looking for alternatives to Roslyn? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Roslyn 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?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.