Model Context Protocol · Roslyn · .NET 10

Navigate C# by structure,
not by re-reading source.

An MCP server that gives Claude, Cursor, and Copilot a semantic, read-only view of your C# solution via Roslyn — so agents navigate by structure instead of re-reading source.

dotnet tool install --global RoslynLens
77%
fewer tokens
pooled reduction, self-hosted benchmark
34
MCP tools
navigation, analysis & architecture
18
anti-pattern detectors
async, security, EF Core & domain
.NET 10
Roslyn 5.6
analyzes any C# target framework

What it does

A semantic lens over your solution

Thirty-four MCP tools built on the Roslyn compiler platform — read-only, token-optimized, and aware of your real project references.

Semantic navigation

Find symbols, references, callers, implementations and overrides across the whole solution — resolved by Roslyn, not text search.

Architecture graphs

Namespace communities, god nodes, surprising cross-namespace dependencies, circular dependencies and isolated symbols reveal coupling and layering issues.

Anti-pattern detection

18 built-in detectors for async/await, HttpClient, DateTime, EF Core, logging, secrets and more — plus opt-in Roslynator (500+ rules).

Token efficiency

Responses are 30–150 tokens of structured JSON. A reproducible, offline benchmark measures 77% pooled / 73% median reduction versus reading source.

Zero-config discovery

BFS auto-discovery finds your .sln/.slnx, with multi-solution switching at runtime. No manual path wiring.

Read-only by design

Every tool advertises MCP read-only/idempotent hints. RoslynLens inspects your code; it never edits it.

The toolbox

34 tools, six families

From single-symbol lookups to whole-solution architecture graphs and batch queries.

Navigation

  • find_symbol
  • find_references
  • find_callers
  • find_implementations
  • find_overrides
  • find_dead_code

Inspection

  • get_symbol_detail
  • get_public_api
  • get_type_hierarchy
  • get_file_overview
  • get_type_overview
  • resolve_external_source

Analysis

  • analyze_method
  • analyze_control_flow
  • analyze_data_flow
  • get_complexity_metrics
  • detect_antipatterns
  • detect_duplicates

Architecture graphs

  • get_communities
  • find_god_nodes
  • find_surprising_dependencies
  • find_isolated_symbols
  • detect_circular_dependencies
  • get_dependency_graph

Project & solution

  • get_project_graph
  • get_diagnostics
  • get_test_coverage_map
  • get_module_depends_on
  • list_solutions
  • switch_solution

Batch

  • find_symbols_batch
  • get_symbol_detail_batch
  • get_public_api_batch
  • validate_granit_conventions

Install

Wire it up in a minute

Works with Claude Code, Claude Desktop, Cursor and Copilot over stdio.

dotnet tool install --global RoslynLens

Global .NET tool. Requires the .NET 10 SDK.

claude mcp add --scope user --transport stdio roslyn-lens -- roslyn-lens

Register the stdio server with Claude Code.

npx @anthropic-ai/mcpb pack mcpb roslyn-lens.mcpb

Pack the bundle, then drag the .mcpb into Settings → Extensions.

docker run --rm -i -v "$PWD":/workspace roslyn-lens

SDK-based image; mount the repo to analyse at /workspace.

Give your agent a compiler, not a grep.

Read-only, reproducible, and measured — 77% fewer tokens on navigation tasks.