Skip to content
Roslyn Bridge MCP

Get started

Install

Prerequisites: the .NET 10 SDK and a Model Context Protocol (MCP) client such as Claude Code, Codex, GitHub Copilot CLI, pi or Antigravity.

macOS and Linux:

Terminal window
curl -fsSL https://raw.githubusercontent.com/thomas-fazzari/roslyn-bridge-mcp/master/install.sh | bash

Windows x64, in PowerShell:

Terminal window
irm https://raw.githubusercontent.com/thomas-fazzari/roslyn-bridge-mcp/master/install.ps1 | iex

The script downloads the latest release for your platform and verifies its SHA-256 checksum. It installs roslyn-bridge-mcp in ~/.local/bin, or %LOCALAPPDATA%\Programs\roslyn-bridge-mcp on Windows, and runs roslyn-bridge-mcp setup. Set ROSLYN_BRIDGE_INSTALL_DIR to choose another directory.

Setup installs the official Roslyn language server as a global .NET tool when it is missing. It then prints the command that registers the bridge in each agent it detects, for example:

Terminal window
claude mcp add --scope user roslyn -- ~/.local/bin/roslyn-bridge-mcp

Run the printed command once per agent. To update, run the install command again. It replaces the binary in place, so the registrations keep working.

Releases target macOS x64 and ARM64, Linux x64 and ARM64 with glibc, and Windows x64. Your C# project can target a different .NET version. Keep its required SDK and workloads installed, including any SDK pinned in its global.json.

.NET tool

The bridge is also a .NET tool on NuGet, built for the same platforms.

Terminal window
dotnet tool install --global ThomasFazzari.RoslynBridge
roslyn-bridge-mcp setup

setup works as described above. To update, run dotnet tool update --global ThomasFazzari.RoslynBridge.

To run the tool without installing it, let the client start it with dnx, pinned to a release:

Terminal window
claude mcp add --scope user roslyn -- dnx ThomasFazzari.RoslynBridge@VERSION --yes

First run dnx ThomasFazzari.RoslynBridge@VERSION --yes -- setup in a terminal. It installs the Roslyn language server and downloads the package, whose first download writes a line to standard output that can break a client. To update, do the same with the new version.

Use it

Restore your C# solution with dotnet restore, then open a new agent session in that project. In the CLI, use /mcp to check that roslyn is connected.

Use the Roslyn MCP to report diagnostics for a C# file, find definitions and
implementations, then preview a rename and a suggested fix. Do not apply changes.

Approve the tool call if prompted. The bridge uses the session’s working directory as its workspace. Save editor changes before requesting diagnostics.

Agents keep their text-search habits, so add these lines to the project’s agent instructions, such as AGENTS.md or CLAUDE.md:

## C# code navigation
Use the `roslyn` MCP tools for C# code before text search or reading whole files. If your client defers MCP tools, load them first.
Send independent lookups of known symbols in one `bulk_navigate` call.
Read a whole file only to edit it.

Do not describe the tools there. The server already sends their descriptions and usage instructions when the client connects.

Configuration

In Claude Code, add mcp__roslyn__* to permissions.allow to run the tools without prompts. See Claude Code MCP and Codex MCP configuration for client settings and tool approvals.

The bridge starts loading Roslyn at launch when a .sln, .slnx, .slnf or .csproj file sits up to two folders below the workspace root, outside folders such as bin and obj. Otherwise Roslyn loads on the first request. A call waits up to the startup timeout, then returns the error loading while the load goes on. The error and lsp with action=status show the load progress. For large projects, set tool_timeout_sec = 200 under [mcp_servers.roslyn] in Codex. In Claude Code, set the MCP_TOOL_TIMEOUT environment variable in milliseconds, for example 200000.

Bridge argument Default
--workspace Current working directory
--server roslyn-language-server on PATH, then in ~/.dotnet/tools
--dotnet-root The .NET install found as described below
--startup-timeout 120 seconds
--request-timeout 60 seconds
--exclude None. Repeat it to add folders to the built-in list

A project can also set these in .roslyn-bridge.json (the argument wins).

Timeout arguments accept 1 to 600 seconds. When you raise these limits, keep the client’s tool timeout above the sum of the startup and request timeouts.

MCP clients often start the bridge without your shell environment, so it looks for a .NET 10 install itself, in DOTNET_ROOT, the dotnet on PATH, the installer’s registered location, the default location, then ~/.dotnet. Pass --dotnet-root when yours is elsewhere.

Remove

Remove the roslyn entry from each agent with its mcp remove command, for example claude mcp remove roslyn --scope user. Then delete roslyn-bridge-mcp from the installation directory, or run dotnet tool uninstall --global ThomasFazzari.RoslynBridge when you installed the tool.