Roslyn MCP Server

Local-first MCP server for semantic C# analysis & refactoring via Roslyn & MSBuildWorkspace.

Local serverstdioPython

What is the Roslyn MCP server?

Local-first MCP server for semantic C# analysis & refactoring via Roslyn & MSBuildWorkspace. The roslyn mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 11 defined tools rather than through you.

What it actually does

Local-first MCP (Model Context Protocol) server for semantic C# analysis, navigation, validation, and refactoring on real .sln / .slnx / .csproj workspaces. It uses Roslyn and MSBuildWorkspace, runs over stdio, and does not require Visual Studio.

  • Loads real C# solutions and projects with session-scoped workspaceIds
  • Exposes semantic navigation, diagnostics, build/test helpers, and preview/apply refactoring workflows over MCP
  • Ships as a .NET global tool, a Claude Code plugin, and a source-buildable stdio host
  • Publishes the authoritative live surface through server_info and roslyn://server/catalog

Its toolset

Everything the assistant can do here goes through one of these:

  • Updates — dotnet tool update -g Darylmcd.RoslynMcp
  • roslyn — //server/catalog for the machine-readable contract
  • Client — Config file
  • Cursor — .cursor/mcp.json (repo root) or ~/.cursor/mcp.json (global)
  • Variable — Default
  • ROSLYNMCP_MAX_WORKSPACES — 8
  • ROSLYNMCP_BUILD_TIMEOUT_SECONDS — 300
  • ROSLYNMCP_TEST_TIMEOUT_SECONDS — 600
  • ROSLYNMCP_PREVIEW_TTL_MINUTES — 5
  • ROSLYNMCP_REQUEST_TIMEOUT_SECONDS — 120
  • Prerequisites — The Prerequisites tool exposed by this server

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Configuration

When to reach for it

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Roslyn's toolset — Updates, roslyn, Client and 8 more — is a fair guide to whether it matches your workflow. It is maintained by darylmcd; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Roslyn.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the roslyn mcp server does with a few real requests.

Available tools

ToolWhat it does
Updatesdotnet tool update -g Darylmcd.RoslynMcp
roslyn//server/catalog for the machine-readable contract
ClientConfig file
Cursor.cursor/mcp.json (repo root) or ~/.cursor/mcp.json (global)
VariableDefault
ROSLYNMCP_MAX_WORKSPACES8
ROSLYNMCP_BUILD_TIMEOUT_SECONDS300
ROSLYNMCP_TEST_TIMEOUT_SECONDS600
ROSLYNMCP_PREVIEW_TTL_MINUTES5
ROSLYNMCP_REQUEST_TIMEOUT_SECONDS120
PrerequisitesThe Prerequisites tool exposed by this server.

Configuration

Example prompts to try

  • Use Roslyn to Updates.
  • Use Roslyn to roslyn.
  • Use Roslyn to Client.

Frequently asked questions

It connects Roslyn to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (Updates, roslyn, Client, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Roslyn directly.