Roslyn MCP Server

by carquiza

Not rated
GitHub

About

A C# MCP server using Microsoft's Roslyn compiler for code analysis and navigation in C# codebases.

Details

Author
carquiza
Categories
Developer Tools

Setup

Install Roslyn MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/carquiza/RoslynMCP

Follow the installation instructions in the repository README, then restart your MCP client.

A C# MCP server using Microsoft's Roslyn compiler for code analysis and navigation in C# codebases.

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.

- Wildcard Symbol Search- Find classes, methods, and properties using pattern matching (Service,GetUser, 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

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

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

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

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

Add the following to yourclaude_desktop_config.jsonfile:

{ "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/RoslynMcpServerwith the actual absolute path to your project directory.

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

Search for all classes ending with 'Service' in my solution at C:\MyProject\MyProject.sln
Find all references to the UserRepository class in C:\MyProject\MyProject.sln
Get information about the CalculateTotal method in C:\MyProject\MyProject.sln
Analyze dependencies for the solution at C:\MyProject\MyProject.sln
Find methods with complexity higher than 7 in C:\MyProject\MyProject.sln

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

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

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

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

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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

AI-to-AI code review platform — Claude, Codex, and Gemini cross-check each other via MCP, REST API, and CLI for consensus-based results.

A stateful LSP runtime for AI agents: warm language server sessions with 50+ tools for go-to-definition, find-references, diagnostics, rename, and more across 30+ languages.

Persistent code index using Tree-sitter for fast, precise code search. Replaces grep with ~50 token responses instead of 2000+.

Orchestrates a dual-AI engineering loop where a Primary AI plans and implements, while a Review AI validates and reviews, with continuous feedback for optimal code quality. Supports custom AI pairing (Claude, Codex, Gemini, etc.)

AmazingMCP — MCP Server for .NET / C# Codebases

An MCP server that gives AI agents deep understanding of C# codebases via Roslyn — type search, dependency graphs, usage analysis, and architecture overviews, all from a live in-memory compilation.

A platform-agnostic code analysis library with semantic search capabilities and MCP server support.

Enforce consistent C++ style and best practices across your codebase. Analyze naming conventions, memory safety, and const correctness, and get actionable modernization suggestions up to C++23. Accelerate reviews with ready-made prompts and quick access to curated guidelines.

AI-Safe Code Analysis with 113+ MCP tools for guard validation, memory, workflow, and testing.

A Rust-based CLI tool for code-related tasks, operating as an MCP server.

Provides AI assistants with a comprehensive, one-time analysis for complete codebase context and understanding.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.