io.github.darylmcd/roslyn-mcp

Official registry Other

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

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NUGET package Darylmcd.RoslynMcp
Claude Code
claude mcp add roslyn-mcp -e 'ROSLYNMCP_SANCTIONED_ROOTS=<ROSLYNMCP_SANCTIONED_ROOTS>' -- dnx Darylmcd.RoslynMcp@5.0.0 --yes
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "roslyn-mcp": {
            "command": "dnx",
            "args": [
                "Darylmcd.RoslynMcp@5.0.0",
                "--yes"
            ],
            "env": {
                "ROSLYNMCP_SANCTIONED_ROOTS": "<ROSLYNMCP_SANCTIONED_ROOTS>"
            }
        }
    }
}

Environment variables

  • ROSLYNMCP_SANCTIONED_ROOTS Server-owned filesystem boundary for path validation and solution discovery. Path-separator-delimited (';' on Windows, ':' on macOS/Linux). '.' scopes the server to its working directory. An empty value fails closed: every path-taking tool rejects its input.

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. Roslyn-Backed MCP Server
  2. Quick Start
  3. Live Surface
  4. Configuration And Security
  5. Docs
  6. Support

Roslyn-Backed MCP Server

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. Refactoring tools follow a preview → apply discipline: previews return short-lived tokens, so agents can dry-run multi-file edits before mutating the workspace. It ships as a .NET global tool, a Claude Code plugin, and a source-buildable stdio host.

Correct package ID: Darylmcd.RoslynMcp · CLI: roslynmcp · Plugin: roslyn-mcp@roslyn-mcp-marketplace

Quick Start

Prerequisite: the .NET 10 SDK.

Option A — Install As A Global Tool
dotnet tool install -g Darylmcd.RoslynMcp

Update later with dotnet tool update -g Darylmcd.RoslynMcp.

Configure a filesystem boundary before first use. The global tool ships a binary, not a config, and an unset boundary is fail-closed: every path-taking tool rejects its input. Set ROSLYNMCP_SANCTIONED_ROOTS in your MCP client config (for example a project-scope .mcp.json):

{
  "mcpServers": {
    "roslyn": {
      "type": "stdio",
      "command": "roslynmcp",
      "env": { "ROSLYNMCP_SANCTIONED_ROOTS": "." }
    }
  }
}

. resolves against the server process's working directory, which your MCP client chooses; use an absolute path to pin the boundary. See Setup.

Option B — Zero-Install Via dnx (.NET 10)

dnx resolves the package from NuGet on demand, without installing a global shim: run dnx Darylmcd.RoslynMcp. Pin a version for reproducible setups with Darylmcd.RoslynMcp@<version>. Configure the same ROSLYNMCP_SANCTIONED_ROOTS boundary as above; copy-paste configs live in docs/mcp-json-examples/, and details are in Setup.

Option C — Claude Code Plugin
/plugin marketplace add darylmcd/Roslyn-Backed-MCP
/plugin install roslyn-mcp@roslyn-mcp-marketplace

The plugin bundles 32 skills and safety hooks, then launches the exact release-matched Darylmcd.RoslynMcp package through dnx; it does not require a global roslynmcp shim. The first launch requires NuGet access unless the package is already cached. The plugin's bundled "." boundary resolves to the session's working directory, so start Claude Code inside the repo you want to analyze; see Setup for the other supported overrides.

Per-Client Config

The JSON shape is the same across MCP clients (VS Code uses a top-level "servers" key); only the config file path differs. See the compatibility matrix for per-client paths and a health-check prompt, and docs/mcp-json-examples/ for copy-ready snippets.

Live Surface

The current release exposes 175 tools (113 stable / 62 experimental), 14 resources (9 stable / 5 experimental), and 20 prompts (all experimental).

Use the running server for the authoritative live catalog and support tiers:

  • server_info for a human-readable summary
  • roslyn://server/catalog for the machine-readable contract
  • roslyn://server/resource-templates for resource URI templates

Stable families include workspace/session management, semantic navigation, diagnostics, build/test helpers, and preview/apply refactoring flows. Experimental families include broader project mutation, scaffolding, orchestration, direct text-edit helpers, and prompts. Set ROSLYNMCP_TOOL_TIERS=stable to register only the closed stable workflow (currently 94 callable tools) for clients that eagerly load tool definitions.

Configuration And Security

All operational settings are optional ROSLYNMCP_* environment variables with compiled-in defaults; the full reference is in docs/setup.md. The exception is ROSLYNMCP_SANCTIONED_ROOTS, which you must set (see above).

Loading a solution or project executes MSBuild evaluation: only load repositories you trust, or run the server in a sandbox. The filesystem boundary is server-owned; a client's MCP Roots can only narrow it. See docs/setup.md and SECURITY.md for the disclosure policy. Upgrading from 2.x? Read the migration notes first.

Docs

Support

Frequently asked questions

What is io.github.darylmcd/roslyn-mcp?

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

How do I install io.github.darylmcd/roslyn-mcp?

It runs on your machine. In Claude Code: claude mcp add roslyn-mcp -e 'ROSLYNMCP_SANCTIONED_ROOTS=<ROSLYNMCP_SANCTIONED_ROOTS>' -- dnx Darylmcd.RoslynMcp@5.0.0 --yes. For other clients, paste the JSON configuration from this page into their MCP settings.

Does io.github.darylmcd/roslyn-mcp need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is io.github.darylmcd/roslyn-mcp open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains io.github.darylmcd/roslyn-mcp?

It is published by darylmcd. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.