RoslynMcpServer logo

RoslynMcpServer

Roslyn-powered MCP tools for analyzing, navigating, refactoring, generating, and converting C# across projects and solutions.

Install RoslynMcpServer

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for RoslynMcpServer, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

RoslynMcpServer exposes 66 MCP tools for working with C# solutions and projects through the Roslyn compiler platform. Its capabilities cover refactoring, code navigation, analysis, metrics, code generation, and syntax conversion, with solution-wide reference tracking and preview support for refactoring operations. Reach for it when an AI assistant needs compiler-aware C# changes rather than text-only edits. It runs through stdio on Windows, Linux, and macOS and requires the .NET 9 SDK or later.

Use cases

  • Rename C# symbols across an entire solution
  • Move types between files or namespaces
  • Preview method extraction before changing files
  • Inspect compiler diagnostics and workspace health
  • Convert C# code to modern syntax

Key features

  • 66 Roslyn-powered MCP tools
  • Solution-wide reference updates
  • Preview mode for refactoring operations
  • Atomic writes with rollback
  • Cross-platform .NET tool installation
  • Standalone CLI for scripts and CI/CD

Tools66

What RoslynMcpServer lets your agent do. Expand a tool for its parameters.

Self-reported~5.1k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars37Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed66Callable tools this server registers over MCP.

How RoslynMcpServer works

What RoslynMcpServer does

RoslynMcpServer connects MCP clients to the Roslyn compiler platform for compiler-aware C# development tasks. It exposes 66 tools grouped across five areas: 37 refactoring operations, five navigation tools, six analysis and metrics tools, five code-generation tools, and 13 code-conversion tools.

The server works with a C# solution or project identified by an absolute path to a .sln, .slnx, or .csproj file. Operations can inspect code, apply structural changes, update references, and transform modern C# syntax. Examples include renaming symbols throughout a solution, moving types between files or namespaces, retrieving compiler diagnostics, and extracting a method.

How it works

MCP clients communicate with the installed roslyn-mcp executable over stdio. Each tool receives a solutionPath; refactoring tools additionally accept preview: true to return the proposed changes without writing them. Symbol changes use Roslyn’s understanding of declarations and references, allowing renames and moves to propagate across the solution instead of relying on plain-text replacement.

File updates are atomic: if a write fails, the server rolls back the changes. The server also tracks references across the solution for supported operations. A separate roslyn-cli package exposes the same 66 tools for shell scripts, CI/CD pipelines, and direct terminal use, with JSON output by default and optional text formatting.

Setup and configuration

Install the MCP server as a global .NET tool:

bash
dotnet tool install -g RoslynMcp.Server

The host machine needs the .NET 9.0 SDK or newer and a C# solution or project to process. For Claude Code, add a .mcp.json file in the project root:

config.json
{
  "mcpServers": {
    "roslyn-refactor": {
      "type": "stdio",
      "command": "roslyn-mcp",
      "args": []
    }
  }
}

Claude Desktop uses the same command in its claude_desktop_config.json file. On Windows, that file is under %APPDATA%/Claude; on macOS, it is under ~/Library/Application Support/Claude.

Tools and capabilities

  • Refactor C# symbols, types, namespaces, and methods.
  • Rename declarations and update references across a solution.
  • Move types to files or namespaces, including supported all-file workflows.
  • Navigate code and inspect compiler diagnostics, metrics, and workspace health.
  • Generate C# code and convert code to newer syntax forms.
  • Preview refactoring changes before applying them.
  • Run operations from scripts with the standalone CLI.

The diagnose tool can report Roslyn version, MSBuild status, and workspace details. The CLI supports commands such as get-diagnostics, rename-symbol, and extract-method, plus help output for individual tools.

Limitations and notes

The server requires the .NET 9.0 SDK or later and a local C# solution or project. MCP configuration examples use stdio rather than a network endpoint. Refactoring behavior depends on the selected symbol and operation: constructors, destructors, operators, source-generated documents, linked multi-views, nested types, collisions, and other ineligible targets may be skipped by particular tools. Use preview mode to inspect a proposed change before allowing file writes.

The CLI returns exit code 0 for success, 1 for a tool error, 2 for a CLI error, and 3 for an environment error. Its output is JSON unless text format is requested.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about RoslynMcpServer

RoslynMcpServer is an MCP server that connects AI assistants and other MCP clients to the Roslyn compiler platform for C# solutions and projects. Its 66 tools support refactoring, code navigation, analysis, metrics, code generation, and syntax conversion, including solution-wide symbol renames and previewable changes.

Install it as a global .NET tool with `dotnet tool install -g RoslynMcp.Server`. The host must have the .NET 9.0 SDK or later. After installation, configure an MCP client to launch the `roslyn-mcp` command over stdio.

Add a `.mcp.json` file in the project root with a stdio server whose command is `roslyn-mcp`. Restart Claude Code or run `/mcp` to connect, then provide a solution or project path when invoking a tool.

Yes. Set the `preview` parameter to `true` on refactoring tools to inspect the proposed changes without applying them. This is useful for checking solution-wide renames, moves, or other edits before files are written.

Yes. Add `roslyn-mcp` as an MCP server in Claude Desktop's `claude_desktop_config.json`. The configuration uses the command directly and does not require a separate repository checkout.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewRoslynMcpServer AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/roslynmcpserver?style=directory)](https://allmcps.com/mcp/roslynmcpserver)
HTML Embed
<a href="https://allmcps.com/mcp/roslynmcpserver"><img src="https://allmcps.com/api/badge/roslynmcpserver?style=directory" alt="RoslynMcpServer on AllMCPs" /></a>