RoslynMcp
Roslyn-powered MCP server for C# code intelligence
Ask AI about RoslynMcp
Powered by Claude Β· Grounded in docs
I know everything about RoslynMcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
![]()
RoslynMcp
A Model Context Protocol (MCP) server that brings Roslyn code intelligence to AI agents.
Get It on NuGet
This project uses Roslynator, licensed under Apache 2.0.
Installation
dotnet tool install -g RoslynMcp
Update
dotnet tool update -g RoslynMcp
MCP config (OpenCode)
"mcp": {
"roslyn": {
"type": "local",
"command": [
"roslynmcp"
]
}
}
What It Is
RoslynMcp is a .NET application that exposes the power of Roslyn (the .NET compiler platform) through the MCP protocol. It acts as a bridge between AI assistants and your C# codebase, enabling deep code understanding and analysis.
Why It Exists
Traditional AI code assistants often rely on simplistic pattern matching (grep/glob) which misses semantic context. RoslynMcp solves this by providing:
- Semantic understanding β It knows what your code means, not just what it says
- Symbol resolution β Understands types, methods, properties across your entire solution
- Call graph tracing β See how code flows through your system
Recommended Workflows
Choose the entry point based on what you already know.
%%{init: {"theme": "base", "themeVariables": { "background": "transparent" }}}%%
flowchart TD
ls[load_solution]
lp[load_project]
lt[load_type]
lm[load_member]
fr[find_references]
st[search_type]
sm[search_member]
df[diagnose_file]
rt[run_tests]
ls -->|projectPath| lp
lp -->|typeSymbolId| lt
lt -->|memberSymbolId| lm
lt -->|typeSymbolId| fr
st -->|typeSymbolId| lt
sm -->|memberSymbolId| lm
lm -->|memberSymbolId| fr
ls -.-> st
ls -.-> sm
lm -.->|filePath from location| df
df -.-> rt
classDef tool fill:#1f2937,stroke:#9ca3af,color:#f9fafb;
class ls,lp,lt,lm,fr,st,sm,df,rt tool;
linkStyle default stroke:#9ca3af,stroke-width:1.5px;
This keeps navigation semantic and symbol-aware without relying on text-only search, while still giving you fast search and file-level validation when you need it.
The full tool descriptions can be found here
