Skip to main content
MCP server CX Codex

Roslyn CodeLens — Claude Code MCP server: features and setup

This MCP server gives agents Roslyn-based insight into .NET code, from symbol relationships to diagnostics and fixes. Use it to navigate a codebase, inspect tests, or review API changes.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add roslyn-codelens -- npx -y roslyn-codelens-mcp
Open on GitHub

What Roslyn CodeLens does

Roslyn CodeLens lets an agent inspect .NET code with semantic context. It can locate interface implementations, method callers, and symbol references, then show type hierarchies, DI registrations, and compiler or analyzer diagnostics with available fixes. It can also trace exceptions through methods or map a .NET stack trace to source locations.

For test work, the server finds tests that exercise a symbol, summarizes test methods, and identifies public methods and properties that tests do not reach. It can draft a test-class skeleton for xUnit, NUnit, or MSTest. The result is text, not a finished test; constructor dependencies appear as TodoNotes.

API review tools list the public surface and compare it with a baseline JSON file or DLL. The server can be added to Claude Code with npx. Its semantic analysis is aimed at .NET code, so it is not a general-purpose code intelligence server for unrelated languages.

What it helps with

  • locate implementations of an interface or base class
  • trace calls to a method across the project
  • find public members that tests do not reach
  • compare the public API against a baseline
  • inspect compiler diagnostics and available fixes

Example prompts for the agent

  • Find every implementation of IOrderService and show where each one is defined.
  • Check which tests exercise CalculateTotal and identify public methods that tests do not reach.
  • Compare the current public API with the baseline DLL and report breaking changes.

How to install Roslyn CodeLens

Platform CLI

claude mcp add roslyn-codelens -- npx -y roslyn-codelens-mcp

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Roslyn CodeLens

How do I install Roslyn CodeLens in Claude Code?

Run claude mcp add roslyn-codelens -- npx -y roslyn-codelens-mcp. This registers Roslyn CodeLens as an MCP server in Claude Code.

What does Roslyn CodeLens do?

It gives agents semantic insight into .NET code, including symbol references, callers, tests, DI registrations, and diagnostics. It can also inspect public API changes.

Which test frameworks can it use for generated test skeletons?

It detects xUnit, NUnit, and MSTest when generating a test-class skeleton. Constructor dependencies are included as TodoNotes.

Similar MCP servers

Everything for Programming languages →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor