1. Conduid
  2. Science
  3. RoslynMCP
MCP server · Science

RoslynMCP

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

Unclaimed last commit a year ago science
44Fair

Scored 22 hours ago · breakdown

About RoslynMCP

RoslynMCP is an MCP server published by carquiza in the Science category: a Model Context Protocol (MCP) server that provides C# code analysis capabilities using Microsoft Roslyn.

The repository has 65 stars and 12 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/carquiza/RoslynMCP

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about RoslynMCP

Powered by Claude · Grounded in docs

I know everything about RoslynMCP. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 20 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • !License declaredNo license file. Legally you have no right to use it in a product.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

README

Roslyn MCP Server

A C# MCP (Model Context Protocol) server that integrates with Microsoft's Roslyn compiler platform to provide Claude Desktop with code analysis and navigation capabilities for C# codebases.

Features

  • Wildcard Symbol Search - Find classes, methods, and properties using pattern matching (*Service, Get*User, etc.)
  • Reference Tracking - Locate all usages of symbols across entire solutions
  • Symbol Information - Get detailed information about types, methods, properties, and more
  • Dependency Analysis - Analyze project dependencies and namespace usage patterns
  • Code Complexity Analysis - Identify high-complexity methods using cyclomatic complexity metrics
  • Performance Optimized - Multi-level caching and incremental analysis for large codebases
  • Security - Input validation and path sanitization

Prerequisites

  • .NET 8.0 SDK or later
  • Visual Studio 2022 or VS Code (recommended for development)
  • Claude Desktop application

Installation

  1. Clone or download the project

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

    dotnet restore
    
  3. Build the project

    dotnet build
    
  4. Test the server (optional)

    dotnet run
    

Quick Setup

Windows

Run the PowerShell setup script:

.\setup.ps1

Linux/macOS

Run the installation test:

./test-installation.sh

Claude Desktop Configuration

To connect this MCP server to Claude Desktop, you need to modify the Claude Desktop configuration file:

Configuration File Location

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Configuration Content

Add the following to your claude_desktop_config.json file:

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

Important: Replace /path/to/RoslynMCP/RoslynMcpServer with the actual absolute path to your project directory.

Usage

Once configured, restart Claude Desktop. You should see the Roslyn MCP Server appear in the available tools. Here are some example queries:

Search for Symbols

Search for all classes ending with 'Service' in my solution at C:\MyProject\MyProject.sln

Find References

Find all references to the UserRepository class in C:\MyProject\MyProject.sln

Get Symbol Information

Get information about the CalculateTotal method in C:\MyProject\MyProject.sln

Analyze Dependencies

Analyze dependencies for the solution at C:\MyProject\MyProject.sln

Code Complexity Analysis

Find methods with complexity higher than 7 in C:\MyProject\MyProject.sln

Available Tools

  1. SearchSymbols - Search for symbols using wildcard patterns
  2. FindReferences - Find all references to a specific symbol
  3. GetSymbolInfo - Get detailed information about a symbol
  4. AnalyzeDependencies - Analyze project dependencies and usage patterns
  5. AnalyzeCodeComplexity - Identify high-complexity methods

Development and Testing

Using MCP Inspector

For development and testing, you can use the MCP Inspector:

# Install the inspector
npm install -g @modelcontextprotocol/inspector

# Test your server
npx @modelcontextprotocol/inspector dotnet run --project ./RoslynMcpServer

Architecture

The server features a modular architecture with:

  • MCP Server Layer: Handles communication with Claude Desktop
  • Roslyn Integration Layer: Manages workspaces and compilations
  • Search Engine Layer: Implements symbol search and analysis
  • Multi-level Caching: Performance optimization for large codebases
  • Security Layer: Input validation and sanitization

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Christopher Arquiza

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

README fetched from the repository 20 hours ago. The original is authoritative.

Questions

About RoslynMCP

How do I install RoslynMCP?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is RoslynMCP safe to use with an AI agent?

Its trust score is 44 out of 100 (fair). It passes 2 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is RoslynMCP still maintained?

The last commit was a year ago and 5 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.