Roslyn MCP Server
MCP server that lets AI assistants refactor C# code using Roslyn tools.
Tested on Linux
Use it
Linux x86_64
You need first
- Runtimes:
.NET 9.0 SDK or later
Download Microsoft dotnet-install script
curl -sSL https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh -o /tmp/dotnet-install.shInstall .NET 9 SDK to $HOME/.dotnet
bash /tmp/dotnet-install.sh --channel 9.0 --install-dir $HOME/.dotnetInstall RoslynMcp.Server global tool (roslyn-mcp 0.15.0)
export DOTNET_ROOT=$HOME/.dotnet && export PATH=$HOME/.dotnet:$HOME/.dotnet/tools:$HOME/.local/bin:$PATH && dotnet tool install -g RoslynMcp.ServerExpose dotnet and roslyn-mcp on default PATH with DOTNET_ROOT wrapper
ln -sf $HOME/.dotnet/dotnet $HOME/.local/bin/dotnet && printf '#!/bin/sh\nexport DOTNET_ROOT="$HOME/.dotnet"\nexec "$HOME/.dotnet/tools/roslyn-mcp" "$@"\n' > $HOME/.local/bin/roslyn-mcp && chmod +x $HOME/.local/bin/roslyn-mcp
Check that it works
dotnet --versionThe output should contain “9.0.320”.
Add it to your agent
claude mcp add roslynmcpserver -- roslyn-mcpJSON for Claude Desktop, Cursor and other clients
{
"mcpServers": {
"roslynmcpserver": {
"command": "roslyn-mcp",
"args": []
}
}
}What it does
Good for
- Rename a class and update references across solution
- Run diagnose tool for health report on a solution
- Extract code into a new method
How far pickfit got
Linux x86_64
- Installs
- Connects
- A tool call works
- Works offline
macOS and Windows: the project says it runs there; pickfit hasn’t tried it.
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
An MCP client connects and lists its tools
- Replayed from scratch
- Works offline
- Checked on 1 Nov 2026
- Version 0.15.0
An MCP client handshake over stdio listed 66 tools.
Differences the test machine hit
- README: Prereq .NET 9 SDK then `dotnet tool install -g RoslynMcp.Server`
In the test: Install .NET 9 SDK first via dotnet-install.sh to $HOME/.dotnet (SDK 9.0.320); box had no dotnet - README: `dotnet tool install -g` puts `roslyn-mcp` on PATH ready to run
In the test: Symlink $HOME/.dotnet/dotnet to $HOME/.local/bin/dotnet and wrap $HOME/.dotnet/tools/roslyn-mcp in $HOME/.local/bin/roslyn-mcp exporting DOTNET_ROOT=$HOME/.dotnet, else apphost reports `.NET location: Not found` / libhostfxr missing - README: Install script from Microsoft
In the test: dotnet-install.sh downloads SDK tarball (~218MB) from builds.dotnet.microsoft.com at install time; binary payload could not be read beforehand