Get the FREE Ultimate OpenClaw Setup Guide →

RoslynMcpServer

Model Context Protocol server for Roslyn-powered C# refactoring operations

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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
  1. Install the Roslyn MCP Server as a global .NET tool
dotnet tool install -g RoslynMcp.Server
  1. Verify installation
dotnet tool list -g
roslyn-mcp --version
  1. 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
  1. 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

Sponsor this space

Reach thousands of developers