marcelroozekrans avatar

Roslyn CodeLens

marcelroozekrans/roslyn-codelens-mcp

This is Roslyn as an MCP server. It exposes the full .NET Compiler Platform APIs to Claude: find implementations, callers, and test coverage; inspect DI registrations and type hierarchies; run diagnostics and apply refactorings; detect dead code, async violations, and disposable misuse. You can switch between loaded solutions at runtime, decompile IL from referenced assemblies, run data flow analysis, and even generate test skeletons for uncovered methods. If you're working with a .NET codebase and need semantic understanding beyond grep, this gives Claude the same view your IDE has. Ships as a NuGet package, runs over stdio, and includes a trust model for analyzer execution.

GitHub stars
70
tools
65
transport
STDIO
last updated
Oct 13, 2026

Tools

65 tools

Public tool metadata for what this MCP can expose to an agent.

find_implementationsFind all classes/structs implementing an interface or extending a class

Find all classes/structs implementing an interface or extending a class

No parameter schema in public metadata yet.

find_callersFind every call site for a method, property, or constructor

Find every call site for a method, property, or constructor

No parameter schema in public metadata yet.

find_event_subscribersEvery += / -= site for an event symbol, with resolved handler and subscribe/unsubscribe tag

Every += / -= site for an event symbol, with resolved handler and subscribe/unsubscribe tag

No parameter schema in public metadata yet.

find_tests_for_symbolList xUnit/NUnit/MSTest methods that exercise a production symbol; opt-in transitive walk through helpers

List xUnit/NUnit/MSTest methods that exercise a production symbol; opt-in transitive walk through helpers

No parameter schema in public metadata yet.

get_test_summaryPer-project inventory of test methods with framework, attribute kind, data-row count, location, and production symbols referenced

Per-project inventory of test methods with framework, attribute kind, data-row count, location, and production symbols referenced

No parameter schema in public metadata yet.

find_uncovered_symbolsPublic methods and properties no test transitively reaches; sorted by cyclomatic complexity for prioritization

Public methods and properties no test transitively reaches; sorted by cyclomatic complexity for prioritization

No parameter schema in public metadata yet.

generate_test_skeletonEmit a compilable test-class skeleton (as text) for a method or type. Auto-detects xUnit/NUnit/MSTest; surfaces constructor dependencies as TodoNotes; returns a suggested file path. Closes the loop with find_uncovered_symbols

Emit a compilable test-class skeleton (as text) for a method or type. Auto-detects xUnit/NUnit/MSTest; surfaces constructor dependencies as TodoNotes; returns a suggested file path. Closes the loop with find_uncovered_symbols

No parameter schema in public metadata yet.

get_type_hierarchyWalk base classes, interfaces, and derived types

Walk base classes, interfaces, and derived types

No parameter schema in public metadata yet.

get_di_registrationsScan for DI service registrations. Reads generic, single-generic, typeof pair and factory-lambda forms

Scan for DI service registrations. Reads generic, single-generic, typeof pair and factory-lambda forms

No parameter schema in public metadata yet.

get_instantiation_optionsHow do I construct this type? constructors, static factory methods, DI registrations, and required members in one call

How do I construct this type? constructors, static factory methods, DI registrations, and required members in one call

No parameter schema in public metadata yet.

get_project_dependenciesGet the project reference graph

Get the project reference graph

No parameter schema in public metadata yet.

get_symbol_contextOne-shot context dump for any type

One-shot context dump for any type

No parameter schema in public metadata yet.

get_public_api_surfaceEnumerate every public/protected type and member in production projects; flat, deterministically-sorted list suitable for API review or breaking-change baselines.

Enumerate every public/protected type and member in production projects; flat, deterministically-sorted list suitable for API review or breaking-change baselines.

No parameter schema in public metadata yet.

find_breaking_changesDiff the current API against a baseline JSON or DLL; report removed members, kind changes, and accessibility changes with Breaking/NonBreaking severity.

Diff the current API against a baseline JSON or DLL; report removed members, kind changes, and accessibility changes with Breaking/NonBreaking severity.

No parameter schema in public metadata yet.

find_reflection_usageDetect dynamic/reflection-based usage

Detect dynamic/reflection-based usage

No parameter schema in public metadata yet.

get_exception_flowWhat exceptions can escape a method: walks callees depth-bounded, propagates each throw up through every enclosing try/catch, and reports what still escapes with its propagation path

What exceptions can escape a method: walks callees depth-bounded, propagates each throw up through every enclosing try/catch, and reports what still escapes with its propagation path

No parameter schema in public metadata yet.

find_throw_sitesEvery place an exception type is thrown, optionally including derived types; rethrows flagged

Every place an exception type is thrown, optionally including derived types; rethrows flagged

No parameter schema in public metadata yet.

find_catch_blocksEvery catch for a type, optionally via base clauses; flags filtered, rethrowing, and empty (swallowing) handlers

Every catch for a type, optionally via base clauses; flags filtered, rethrowing, and empty (swallowing) handlers

No parameter schema in public metadata yet.

find_referencesFind all references to any symbol (types, methods, properties, fields, events), each tagged with a kind and reported per occurrence with a column; filter server-side with kinds

Find all references to any symbol (types, methods, properties, fields, events), each tagged with a kind and reported per occurrence with a column; filter server-side with kinds

No parameter schema in public metadata yet.

go_to_definitionFind the source file and line where a symbol is defined

Find the source file and line where a symbol is defined

No parameter schema in public metadata yet.

get_method_sourceFull declaration source for one or many members by name in a single call, with per-item statuses so a batch never fails wholesale

Full declaration source for one or many members by name in a single call, with per-item statuses so a batch never fails wholesale

No parameter schema in public metadata yet.

resolve_stack_traceMap a pasted .NET stack trace to file/line/symbol, undoing compiler name mangling

Map a pasted .NET stack trace to file/line/symbol, undoing compiler name mangling

No parameter schema in public metadata yet.

get_diagnosticsList compiler errors, warnings, and Roslyn analyzer diagnostics

List compiler errors, warnings, and Roslyn analyzer diagnostics

No parameter schema in public metadata yet.

get_code_fixesGet available code fixes with structured text edits for any diagnostic

Get available code fixes with structured text edits for any diagnostic

No parameter schema in public metadata yet.

search_symbolsFuzzy workspace symbol search by name

Fuzzy workspace symbol search by name

No parameter schema in public metadata yet.

get_nuget_dependenciesList NuGet package references per project

List NuGet package references per project

No parameter schema in public metadata yet.

find_attribute_usagesFind types and members decorated with a specific attribute

Find types and members decorated with a specific attribute

No parameter schema in public metadata yet.

find_obsolete_usageEvery [Obsolete] call site grouped by deprecation message and severity, errors first; for planning migrations

Every [Obsolete] call site grouped by deprecation message and severity, errors first; for planning migrations

No parameter schema in public metadata yet.

find_circular_dependenciesDetect cycles in project or namespace dependency graphs

Detect cycles in project or namespace dependency graphs

No parameter schema in public metadata yet.

check_architectureEnforce layering rules you supply (forbid and allowOnly) against the real semantic type graph rather than using directives

Enforce layering rules you supply (forbid and allowOnly) against the real semantic type graph rather than using directives

No parameter schema in public metadata yet.

get_complexity_metricsCyclomatic complexity, cognitive complexity and max nesting depth per member

Cyclomatic complexity, cognitive complexity and max nesting depth per member

No parameter schema in public metadata yet.

find_naming_violationsCheck .NET naming convention compliance

Check .NET naming convention compliance

No parameter schema in public metadata yet.

find_async_violationsSync-over-async, async void misuse, missing awaits, fire-and-forget tasks; per-violation report with severity

Sync-over-async, async void misuse, missing awaits, fire-and-forget tasks; per-violation report with severity

No parameter schema in public metadata yet.

find_disposable_misuseIDisposable/IAsyncDisposable instances not wrapped in using/await using/returned/assigned to field; severity error/warning per violation.

IDisposable/IAsyncDisposable instances not wrapped in using/await using/returned/assigned to field; severity error/warning per violation.

No parameter schema in public metadata yet.

find_large_classesFind oversized types by member or line count

Find oversized types by member or line count

No parameter schema in public metadata yet.

find_god_objectsTypes combining high size with high cross-namespace coupling; sharper signal than raw size for SRP violations

Types combining high size with high cross-namespace coupling; sharper signal than raw size for SRP violations

No parameter schema in public metadata yet.

find_unused_symbolsDead code detection via reference analysis with automatic filtering of test methods, entry points, generated code, MEF services and interop fields

Dead code detection via reference analysis with automatic filtering of test methods, entry points, generated code, MEF services and interop fields

No parameter schema in public metadata yet.

get_project_healthComposite audit aggregating 7 quality dimensions per project with counts and top-N hotspots inline

Composite audit aggregating 7 quality dimensions per project with counts and top-N hotspots inline

No parameter schema in public metadata yet.

get_source_generatorsList source generators and their output per project

List source generators and their output per project

No parameter schema in public metadata yet.

get_generated_codeInspect generated source code from source generators

Inspect generated source code from source generators

No parameter schema in public metadata yet.

inspect_external_assemblyBrowse types, members, and XML docs from closed-source NuGet packages and referenced assemblies

Browse types, members, and XML docs from closed-source NuGet packages and referenced assemblies

No parameter schema in public metadata yet.

peek_ilDecompile any method to ilasm-style IL bytecode from closed-source or generated assemblies

Decompile any method to ilasm-style IL bytecode from closed-source or generated assemblies

No parameter schema in public metadata yet.

get_code_actionsDiscover available refactorings and fixes at any position

Discover available refactorings and fixes at any position

No parameter schema in public metadata yet.

apply_code_actionExecute any Roslyn refactoring by title, with preview mode (returns a diff before writing to disk)

Execute any Roslyn refactoring by title, with preview mode (returns a diff before writing to disk)

No parameter schema in public metadata yet.

rename_symbolSolution-wide safe rename of a type or member via Roslyn's Renamer, with preview mode, conflict reporting, and a freshness check against on-disk edits

Solution-wide safe rename of a type or member via Roslyn's Renamer, with preview mode, conflict reporting, and a freshness check against on-disk edits

No parameter schema in public metadata yet.

change_signatureAdd, remove, and reorder a method's parameters and rewrite every call site

Add, remove, and reorder a method's parameters and rewrite every call site

No parameter schema in public metadata yet.

list_solutionsList all loaded solutions and which one is currently active

List all loaded solutions and which one is currently active

No parameter schema in public metadata yet.

set_active_solutionSwitch the active solution by partial name (all subsequent tools operate on it)

Switch the active solution by partial name (all subsequent tools operate on it)

No parameter schema in public metadata yet.

load_solutionLoad an additional .sln/.slnx at runtime and make it the active solution

Load an additional .sln/.slnx at runtime and make it the active solution

No parameter schema in public metadata yet.

unload_solutionUnload a loaded solution to free memory

Unload a loaded solution to free memory

No parameter schema in public metadata yet.

rebuild_solutionForce a full reload of the analyzed solution

Force a full reload of the analyzed solution

No parameter schema in public metadata yet.

start_background_taskQueue a long-running tool (currently rebuild_solution) to run in the background; returns a taskId to poll

Queue a long-running tool (currently rebuild_solution) to run in the background; returns a taskId to poll

No parameter schema in public metadata yet.

get_task_statusGet the current status, result, or error of a background task by its taskId

Get the current status, result, or error of a background task by its taskId

No parameter schema in public metadata yet.

list_running_tasksList background tasks running or completed within the last 5 minutes

List background tasks running or completed within the last 5 minutes

No parameter schema in public metadata yet.

trust_solutionAuthorize a solution to run Roslyn analyzers (required before get_diagnostics with includeAnalyzers: true)

Authorize a solution to run Roslyn analyzers (required before get_diagnostics with includeAnalyzers: true)

No parameter schema in public metadata yet.

list_trusted_pathsInspect the persistent trust store + session-trusted solutions

Inspect the persistent trust store + session-trusted solutions

No parameter schema in public metadata yet.

revoke_trustRevoke a previously-granted trust for a solution path

Revoke a previously-granted trust for a solution path

No parameter schema in public metadata yet.

analyze_data_flowVariable read/write/capture analysis within a statement range

Variable read/write/capture analysis within a statement range

No parameter schema in public metadata yet.

analyze_control_flowBranch/loop reachability analysis within a statement range (start/end reachability, return statements, exit points)

Branch/loop reachability analysis within a statement range (start/end reachability, return statements, exit points)

No parameter schema in public metadata yet.

analyze_change_impactShow all files, projects, and call sites affected by changing a symbol

Show all files, projects, and call sites affected by changing a symbol

No parameter schema in public metadata yet.

get_type_overviewCompound tool: type context + hierarchy + file diagnostics in one call

Compound tool: type context + hierarchy + file diagnostics in one call

No parameter schema in public metadata yet.

analyze_methodCompound tool: method signature + callers + outgoing calls in one call

Compound tool: method signature + callers + outgoing calls in one call

No parameter schema in public metadata yet.

get_overloadsEvery overload of a method/constructor (source + metadata) with full parameter and modifier detail in one call

Every overload of a method/constructor (source + metadata) with full parameter and modifier detail in one call

No parameter schema in public metadata yet.

get_extension_methodsEvery extension member applicable to a type from the solution and referenced assemblies, using Roslyn's own applicability rules

Every extension member applicable to a type from the solution and referenced assemblies, using Roslyn's own applicability rules

No parameter schema in public metadata yet.

get_operatorsEvery user-defined operator and conversion operator on a type (source + metadata) with kind, signature, parameters, and source location

Every user-defined operator and conversion operator on a type (source + metadata) with kind, signature, parameters, and source location

No parameter schema in public metadata yet.

Sponsors

Readme

Roslyn CodeLens MCP Server

MCP Toplist


View the full README on GitHub

Details

Repository
github.com/marcelroozekrans/roslyn-codelens-mcp
Package
roslyn-codelens-mcp
Transport
STDIO
Registry
MCP registry, active

More from marcelroozekrans