Roslyn Codelens MCP logo

Roslyn Codelens MCP

by MarcelRoozekrans

Roslyn-powered MCP tools for inspecting, analyzing, testing, and refactoring .NET codebases.

Install Roslyn Codelens MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "marcelroozekrans-roslyn-codelens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "roslyn-codelens-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

MarcelRoozekrans/roslyn-codelens-mcp gives AI agents Roslyn-based semantic analysis for .NET codebases. Its tools traverse type hierarchies, call graphs, references, dependency injection registrations, diagnostics, tests, API changes, and architectural relationships. It also generates test skeletons, returns structured code fixes, inspects generated or external assembly code, and reports maintainability issues. Reach for it when syntax-only search is insufficient and you need symbol-aware answers across a solution.

Use cases

  • Trace callers, implementations, and references for a .NET symbol
  • Generate test skeletons and find untested production members
  • Review API changes against a JSON or DLL baseline
  • Inspect dependency injection registrations and construction paths
  • Audit complexity, architecture, async usage, and disposable resources

Key features

  • Roslyn semantic analysis for .NET solutions
  • Type hierarchy, call graph, and reference navigation
  • Diagnostics, code fixes, and refactoring actions
  • Test discovery, coverage gaps, and skeleton generation
  • API, dependency, architecture, and quality analysis
  • External assembly, generated code, and IL inspection

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

20/24 checks healthy over the last 79d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · roslyn-codelens-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars69Stargazers on the source repository.
npm downloads347Package downloads in the last 30 days.
Last commitTodayMost recent push to the default branch.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Roslyn Codelens MCP works

What MarcelRoozekrans/roslyn-codelens-mcp does

MarcelRoozekrans/roslyn-codelens-mcp exposes semantic code-intelligence operations for .NET projects through MCP. It is designed for agents that need to understand symbols and their relationships rather than merely search file text. The server can locate definitions and references, trace callers, inspect implementations, reconstruct type hierarchies, and identify event subscriptions.

Testing workflows are covered as well. Agents can find tests for a production symbol, summarize test inventories, identify public members that no test reaches transitively, and generate a compilable test-class skeleton. The generated skeleton can detect xUnit, NUnit, or MSTest usage, include constructor dependencies as TODO notes, and suggest a file path.

How it works

Roslyn supplies the semantic model used to inspect source code, projects, referenced assemblies, and generated output. Pre-built indexes support fast lookups for code-navigation queries. Project-aware analysis includes project references, NuGet dependencies, source generators, and dependency-injection registrations. DI discovery handles generic registrations, typeof pairs, and factory-lambda forms.

Several operations follow relationships beyond a single declaration. Exception-flow analysis walks callees to a bounded depth and tracks propagation through enclosing handlers. Reference results identify occurrence types such as reads, writes, invocations, casts, declarations, and attributes. Stack-trace resolution maps .NET traces back to source locations while accounting for compiler-generated names, nested exceptions, and common trace transformations.

The server also analyzes quality and architecture. It can measure cyclomatic or cognitive complexity, flag async and disposable-resource issues, detect unused symbols, enforce semantic layering rules, find circular dependencies, and combine seven quality dimensions into a per-project health report. Public API analysis can compare the current surface with a JSON or DLL baseline to identify breaking changes.

Tools and capabilities

Available operations include:

  • Navigate symbols with definition lookup, fuzzy search, reference analysis, source retrieval, and stack-trace resolution.
  • Explore designs through implementations, type hierarchies, callers, project dependencies, DI registrations, instantiation options, and architecture checks.
  • Review correctness with diagnostics, code fixes, code actions, exception-flow analysis, throw-site searches, catch-block searches, and reflection-usage detection.
  • Assess tests through test discovery, summaries, uncovered-symbol reports, and generated test skeletons.
  • Review maintainability with complexity metrics, naming and async checks, disposable-use analysis, large-class and god-object detection, unused-symbol analysis, and project health reports.
  • Inspect APIs and assemblies using public-surface enumeration, breaking-change comparison, source-generator output, external-assembly browsing, and IL inspection.

A hosted deployment is available through Fronteir AI. The project is also published through NuGet and npm package listings, providing package distribution options for deployments that use those ecosystems.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Roslyn Codelens MCP

MarcelRoozekrans/roslyn-codelens-mcp is an MCP server that connects AI agents to .NET codebases through Roslyn semantic analysis. Its main tools inspect type hierarchies, call sites, references, diagnostics, code fixes, dependency injection registrations, test coverage, API changes, complexity, architecture, and other source and assembly details.

Use the find_callers tool to locate every call site for a method, property, or constructor. For broader symbol usage, find_references reports each occurrence with categories such as read, write, invocation, cast, declaration, or object creation.

Yes. Use find_uncovered_symbols to identify public methods and properties that no test reaches transitively. The results are sorted by cyclomatic complexity so higher-priority testing targets can be reviewed first.

Use get_public_api_surface to enumerate public and protected production APIs, then use find_breaking_changes to compare the current API with a JSON or DLL baseline. The comparison reports removed members, kind changes, and accessibility changes with Breaking or NonBreaking severity.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewRoslyn Codelens MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/marcelroozekrans-roslyn-codelens-mcp?style=directory)](https://allmcps.com/mcp/marcelroozekrans-roslyn-codelens-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/marcelroozekrans-roslyn-codelens-mcp"><img src="https://allmcps.com/api/badge/marcelroozekrans-roslyn-codelens-mcp?style=directory" alt="Roslyn Codelens MCP on AllMCPs" /></a>