Roslyn MCP

v1.0.0Developer Toolsstable

A Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn

roslynmcpmcpai-integration
Share:
52
Stars
0
Downloads
0
Weekly
0/5

What is Roslyn MCP?

Roslyn MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server that provides c# code analysis capabilities using microsoft roslyn

A Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server that provides C# code

Use Cases

Analyze C# code using Microsoft Roslyn for deep semantic understanding.
carquiza

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedMay 12, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx roslynmcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Roslyn MCP

RoslynMCP is an MCP server that brings Microsoft's Roslyn compiler platform into your AI assistant, providing deep semantic analysis of C# codebases. Unlike simple text search, it understands the full type system—letting you search for symbols by pattern, find all references to a class or method across an entire solution, retrieve detailed type and signature information, analyze namespace dependencies, and measure cyclomatic complexity. .NET developers use it to navigate large C# solutions and get AI-assisted refactoring guidance grounded in real semantic data.

Prerequisites

  • .NET SDK 8.0 or later installed (dotnet CLI must be available)
  • A C# solution or project file (.sln or .csproj) to analyze
  • Git to clone the repository
  • An MCP-compatible client such as Claude Desktop
1

Clone the RoslynMCP repository

Clone the project from GitHub and navigate into the server project directory.

git clone https://github.com/carquiza/RoslynMCP.git
cd RoslynMCP/RoslynMcpServer
2

Restore dependencies and build

Restore NuGet packages and compile the server. A platform-specific setup script is also available.

dotnet restore
dotnet build
3

Run the server

Start the MCP server. It listens on stdio for MCP protocol messages. Keep note of the absolute path to the built executable for the config step.

dotnet run
4

Configure Claude Desktop to use the server

Add the server to claude_desktop_config.json. Use the absolute path to your project directory so the server can locate the built binary.

5

Test symbol search

Ask Claude to search for symbols in your C# solution to verify the server is connected and analyzing your code correctly.

Roslyn MCP Examples

Client configuration

Add this to your claude_desktop_config.json, replacing the path with your actual RoslynMcpServer build output path.

{
  "mcpServers": {
    "roslynmcp": {
      "command": "dotnet",
      "args": ["run", "--project", "/absolute/path/to/RoslynMCP/RoslynMcpServer"],
      "env": {
        "DOTNET_ENVIRONMENT": "Production",
        "LOG_LEVEL": "Information"
      }
    }
  }
}

Prompts to try

Example prompts that use Roslyn's semantic analysis capabilities.

- "Search for all classes ending with 'Service' in my solution"
- "Find all references to the UserRepository class across the entire codebase"
- "Get detailed information about the CalculateTotal method including its parameters and return type"
- "Analyze the dependencies between namespaces in this project"
- "Find all methods with cyclomatic complexity higher than 7 and suggest simplifications"

Troubleshooting Roslyn MCP

dotnet run fails with restore errors

Ensure you have .NET SDK 8.0+ installed ('dotnet --version'). Run 'dotnet restore' inside the RoslynMcpServer directory explicitly before building.

Symbol search returns no results

Confirm the server is pointed at a directory containing a valid .sln or .csproj file. The server needs to successfully load the solution before it can search symbols.

High memory usage on large solutions

Roslyn loads the full compilation model in memory. For solutions with many projects, ensure at least 4 GB of RAM is available. Close other memory-intensive applications while running analysis.

Frequently Asked Questions about Roslyn MCP

What is Roslyn MCP?

Roslyn MCP is a Model Context Protocol (MCP) server that model context protocol (mcp) server that provides c# code analysis capabilities using microsoft roslyn It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Roslyn MCP?

Follow the installation instructions on the Roslyn MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Roslyn MCP?

Roslyn MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Roslyn MCP free to use?

Yes, Roslyn MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "roslynmcp": { "command": "npx", "args": ["-y", "roslynmcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Roslyn MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides