RoslynMcpServer
Model Context Protocol server for Roslyn-powered C# refactoring operations
claude mcp add --transport stdio joshuaramirez-roslynmcpserver roslyn-mcp
How to use
Roslyn MCP Server exposes 41 Roslyn-powered tools that integrate with MCP clients (such as Claude) to provide AI-assisted refactoring, navigation, analysis, generation, and code conversion capabilities for C# projects. The server runs as a dotnet tool and can be invoked via the standard MCP workflow used by clients: connect to the server through a compatible host (for example Claude) and issue tool requests. Tools include rename_symbol, extract_method, move_type_to_file, get-diagnostics, and many others, all designed to operate across an entire solution with solution-wide reference updates, preview support, and atomic writes. To begin, install the Roslyn MCP server as a global .NET tool, then configure your MCP client to point at roslyn-mcp and use the available tool endpoints to perform refactorings, analyses, or code generation across your C# projects.
How to install
Prerequisites:
- .NET 9.0 SDK or later
- A C# solution (.sln) or project (.csproj) to work with
- Install the Roslyn MCP Server as a global .NET tool
dotnet tool install -g RoslynMcp.Server
- Verify installation
dotnet tool list -g
roslyn-mcp --version
- Start or configure the MCP server as needed by your MCP client. If your client expects a standard MCP server endpoint, use the command name roslyn-mcp in your MCP configuration.
Optional: If you prefer a CLI workflow without an AI assistant, you can also explore the standalone Roslyn MCP CLI after installing RoslynMcp.Cli:
dotnet tool install -g RoslynMcp.Cli
- Connect your MCP client (e.g., Claude) to the server using the provided mcp configuration (see mcp_config below).
Additional notes
Tips and notes:
- The server exposes 41 tools spanning refactoring, navigation, analysis, generation, and conversion. Use preview mode when available to see changes before applying them.
- Changes are applied atomically across the solution, with rollback if a write fails.
- Ensure your solution is accessible to the tool (paths and environment must be valid on the host running the MCP server).
- If you encounter environment-specific issues, verify that the .NET 9.0 SDK is installed and that the global tool RoslynMcp.Server is in the PATH.
- The MCP configuration can point to roslyn-mcp with no extra arguments for standard operation; add tool-specific parameters via the client as needed.
Related MCP Servers
SharpToolsMCP
A suite of MCP tools for AIs to analyze and modify C# solutions with high signal, Roslyn powered context.
mcp-gm
wanna develop an app ❓
arbor
Graph-native code intelligence that replaces embedding-based RAG with deterministic program understanding.
Mcp.Net
A fully featured C# implementation of Anthropic's Model Context Protocol (MCP)
seq
A Model Context Protocol (MCP) server providing AI assistants with tools to search, stream, and analyze events from Seq structured logging servers.
mcpapp-colorpicker
A Model Context Protocol (MCP) App built with .NET that provides an interactive color picker with a rich UI