Roslyn CodeLens
NUGET · ROSLYNCODELENS.MCP · 2 COMPONENTS · SCANNED SEP 20
Roslyn MCP server: semantic .NET/C# intelligence - analysis, refactoring, tests, IL inspection.
Available components
How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →
Supply Chain Security100
- No malware found by supply-chain analysis.Pass
- No known CVEs affecting this package version or its production dependencies.Pass
- No install/post-install scripts declared.Pass
- No production dependencies, so there is no dependency health to assess. View diagnostics → Pass
Provenance & Transparency48
- Source repository is publicly reachable at the declared URL. View diagnostics → Pass
- Provenance check failed: no build-provenance attestation is published. See how to fix → View diagnostics → Fail
- Clear OSI-approved license (MIT).Pass
- Actively maintained (last published 2 days ago).Pass
- Publishes a security disclosure policy (SECURITY.md).Pass
Schema Quality & AI Usability72
- AI-judged instruction clarity (excellent).Pass
- Context-footprint check failed: tool/resource definitions use about 10271 tokens (~153/item across 67 items; 67 tools + 0 resources), over budget; trim descriptions and params. See how to fix → Fail
- Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management100
- No destabilizing schema changes in the last 30 days.Pass
Tool Coverage100
- 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
- 100% of tool parameters carry a description.Pass
Tool Safety75
- No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
- 0 of 1 tool(s) whose name or description implies an irreversible operation declare an MCP destructiveHint annotation; "revoke_trust" implies "revoke" and declares no destructiveHint at all, which the MCP spec reads as destructive by default. See how to fix → Fail
- An AI judge read all 67 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
- Implements a current MCP spec version (2026-07-28).Pass
How do I install the Roslyn CodeLens MCP server?
Roslyn CodeLens runs locally as a NuGet package, launched with dnx RoslynCodeLens.Mcp@2.18.1 --yes. Ready-made configuration for Claude, Cursor, VS Code, Codex and 3 more is on this page, copied from each client's own documentation.
nuget · RoslynCodeLens.Mcp
claude mcp add marcelroozekrans-roslyn-codelens -- dnx RoslynCodeLens.Mcp@2.18.1 --yes
{
"mcpServers": {
"marcelroozekrans-roslyn-codelens": {
"command": "dnx",
"args": [
"RoslynCodeLens.Mcp@2.18.1",
"--yes"
]
}
}
} {
"servers": {
"marcelroozekrans-roslyn-codelens": {
"command": "dnx",
"args": [
"RoslynCodeLens.Mcp@2.18.1",
"--yes"
]
}
}
} codex mcp add marcelroozekrans-roslyn-codelens -- dnx RoslynCodeLens.Mcp@2.18.1 --yes
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"marcelroozekrans-roslyn-codelens": {
"type": "local",
"command": [
"dnx",
"RoslynCodeLens.Mcp@2.18.1",
"--yes"
],
"enabled": true
}
}
} mcp_servers:
marcelroozekrans-roslyn-codelens:
command: "dnx"
args: ["RoslynCodeLens.Mcp@2.18.1", "--yes"] {
"McpServers": {
"marcelroozekrans-roslyn-codelens": {
"Transport": "stdio",
"Command": "dnx",
"Arguments": [
"RoslynCodeLens.Mcp@2.18.1",
"--yes"
]
}
}
} {
"mcpServers": {
"marcelroozekrans-roslyn-codelens": {
"command": "dnx",
"args": [
"RoslynCodeLens.Mcp@2.18.1",
"--yes"
]
}
}
} Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.
- 19 Sept 26 0
- Stability: 0.97 → pass security
- 18 Sept 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 93 to 97. That category is still filling its 30-day observation window: 28 days of observed history at the previous scan, 29 at this one. The score rises as the window fills, whether or not the server changes.
- 17 Sept 26 0
- Tool safety: pass → unverified ▼ security
- Stability: 0.90 → unverified ▼ security
- Tool coverage: 100 → unverified ▼ functional
- Capabilities: pass → unverified ▼ functional
- Schema quality: Schema quality not yet verified: we do not have a sandbox capture of the MCP schema this version of the package serves yet. functional
- Package version: 2.18.0 → 2.18.1 functional
- 16 Sept 26 +1
No change was recorded against any check on this day. Stability & Change Management went from 87 to 90. That category is still filling its 30-day observation window: 26 days of observed history at the previous scan, 27 at this one. The score rises as the window fills, whether or not the server changes.
- 14 Sept 26 −2
- Stability: pass → 0.83 functional
- 13 Sept 26 0
- Stability: 0.97 → pass security
- 12 Sept 26 0
- Stability: pass → 0.97 functional
- 11 Sept 26 0
- Stability: 0.97 → pass security
Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.
Captured 20 Sept 2026 · Analysed nuget/RoslynCodeLens.Mcp@2.18.1
Provenance No attestation
The registry publishes no build provenance for this version, so there is nothing to verify.
| Result | No attestation |
|---|---|
| Ecosystem | nuget |
| Reason | Signature present, unreadable |
Background: How many MCP packages publish verified provenance →
Dependencies 0 packages
| Packages resolved | 0 |
|---|---|
| Tree resolution | Complete |
Background: SBOMs and build attestations, explained →
The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →
analyze_change_impact ~80
Analyze the blast radius of changing a symbol — shows every file, project, and call site affected. Combines find_references and find_callers into a single impact summary. Use before renaming, changing signatures, or removing a type/method.
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Symbol name to analyze (type name, 'Type.Method', etc.) |
No output schema declared.
No examples provided.
analyze_control_flow ~97
Analyze control flow within a range of statements in a C# method. Returns reachability of start/end points, return statements, and exit points. Useful for detecting unreachable code and understanding branching.
| Name | Type | Req | Description |
|---|---|---|---|
| endLine | integer | yes | Last line of the statement range (1-based) |
| filePath | string | yes | Full path to the C# source file |
| startLine | integer | yes | First line of the statement range (1-based) |
No output schema declared.
No examples provided.
analyze_data_flow ~103
Analyze data flow within a range of statements in a C# method. Returns variables declared, read, written, captured by lambdas, and flowing in/out of the region. Useful for understanding variable lifecycle before extracting code.
| Name | Type | Req | Description |
|---|---|---|---|
| endLine | integer | yes | Last line of the statement range (1-based) |
| filePath | string | yes | Full path to the C# source file |
| startLine | integer | yes | First line of the statement range (1-based) |
No output schema declared.
No examples provided.
analyze_method ~72
Get a comprehensive analysis of a method in one call: signature, location, all callers, and all outgoing calls (methods this method invokes). More efficient than calling find_callers separately.
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Method symbol (e.g. 'Greeter.Greet' or 'MyNamespace.MyClass.MyMethod') |
No output schema declared.
No examples provided.
apply_code_action ~172
Apply a code action (refactoring or fix) by its title. Use get_code_actions first to discover available actions. Defaults to preview mode (returns diff without writing files). Set preview=false to apply changes to disk.
| Name | Type | Req | Description |
|---|---|---|---|
| actionTitle | string | yes | Exact title of the code action to apply (from get_code_actions) |
| column | integer | yes | Column number (1-based) |
| endColumn | integer|null | – | End column for text selection (1-based, optional) |
| endLine | integer|null | – | End line for text selection (1-based, optional) |
| filePath | string | yes | Full path to the C# source file |
| line | integer | yes | Line number (1-based) |
| preview | boolean | – | Preview only — return diff without writing to disk (default: true) |
No output schema declared.
No examples provided.
change_signature ~446
Add, remove, or reorder a method's parameters and update every call site (Roslyn's own change-signature engine). Cascades to overrides and interface implementations, rewrites named and optional arguments, and preserves an extension method's `this` parameter; the overrides and implementations it also rewrote are listed in `CascadedTo`. Operations apply in order: `remove` drops `parameter`; `reorder` takes `order`, a full permutation of the parameters surviving at that point; `add` appends `name` plus `type` and REQUIRES `callSiteValue` — the expression every existing call site will pass, since the tool never guesses call-site semantics — with an optional `defaultValue` that instead makes the parameter optional and leaves existing calls untouched. Rejected as unsafe: an added name that is not a valid C# identifier or collides with an existing parameter; a `type` that does not resolve, or resolves ambiguously (qualify it); moving or removing an extension method's `this` parameter (it must stay first); and any signature that would leave a surviving `params` array anywhere but last — add the parameter and reorder it before the `params` array, or remove that array. Defaults to preview mode (returns edits without writing files); set `preview=false` to apply. New compiler errors the change would introduce are reported as Conflicts, and apply mode refuses to write them unless `force=true`. Source-defined methods only; overloaded names must be disambiguated.
| Name | Type | Req | Description |
|---|---|---|---|
| force | boolean | – | Apply even when Conflicts are reported (default: false) |
| method | string | yes | Method to change: `MyClass.MyMethod` or fully qualified `Namespace.MyClass.MyMethod` |
| operations | array | yes | Parameter edits applied in order. Each has `kind` (`remove`, `reorder` or `add`) plus: `parameter` for `remove`; `order` for `reorder`; `name`, `type`, `callSiteValue` and optional `defaultValue` for… |
| preview | boolean | – | Preview only — return edits without writing to disk (default: true) |
No output schema declared.
No examples provided.
check_architecture ~446
Check user-supplied layering rules against the solution's real semantic type graph (resolved symbols, not `using` directives — so a fully qualified reference with no `using` is still caught, and an unused `using` is not reported). Rule kinds: `forbid` (a dependency from `from` to `to` is a violation) and `allowOnly` (a dependency from `from` to anything outside `to` is a violation). TWO SEMANTICS YOU MUST KNOW TO READ AN EMPTY RESULT CORRECTLY. (1) `allowOnly` evaluates ONLY solution-internal, non-generated targets: references to framework and NuGet namespaces such as `System.Collections.Generic` are ignored (otherwise every file would violate every `allowOnly` rule), and so are types declared entirely in generated code, which the caller cannot remove. To restrict a framework or generated namespace, write an explicit `forbid` — that path DOES evaluate metadata and generated targets. (2) Self-references are always allowed: a scope depending on itself is never a violation, under either kind. Results are grouped per violated `rule` plus `sourceScope` plus `targetScope` edge, each with a full `referenceCount` and the first `maxSitesPerViolation` sites. Sorted by rule order, then by descending reference count. Generated code is never reported as the SOURCE of a violation under either kind. Envelope adds a `byRule` / `totalReferences` / `rulesEvaluated` summary.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by rule order, then by descending reference count. |
| maxSitesPerViolation | integer | – | Maximum example sites recorded per violated edge (default: 5). The full reference count is reported regardless. |
| rules | array | yes | Layering rules to evaluate, in priority order. Each is `kind` (`forbid` or `allowOnly`), `from`, `to` (array of patterns), and an optional `description`. |
| scope | string | – | Scope compared by the rules: `namespace` (default) or `project`. |
No output schema declared.
No examples provided.
find_async_violations ~99
Detect six classes of async/await misuse across all production projects: sync-over-async (.Result, .Wait*, GetAwaiter().GetResult()), async void outside event handlers, missing await in async methods, and fire-and-forget tasks. Returns a summary plus a per-violation list (severity error/warning, location, containing method, snippet). Skips test projects and generated code. Static analysis only — no fix suggestions.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
find_attribute_usages ~99
Find all types and members decorated with a specific attribute (e.g., Obsolete, Authorize, Serializable). Returns an envelope with items, totalCount, truncated, limit, and a byProject summary.
| Name | Type | Req | Description |
|---|---|---|---|
| attribute | string | yes | Attribute name to search for (with or without 'Attribute' suffix) |
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by file, then line. |
No output schema declared.
No examples provided.
find_breaking_changes ~166
Diff the current solution's public API surface against a baseline (JSON snapshot from a prior get_public_api_surface run, or a baseline .dll file). Reports five change kinds: Removed/KindChanged/AccessibilityNarrowed (Breaking) plus Added/AccessibilityWidened (NonBreaking). Returns a summary plus a per-change list (kind, severity, fully-qualified name, entity kind, project, file, line, details). Sort: Breaking before NonBreaking, then name ASC. Limitations: return type changes, sealed-ness changes, and nullable annotation changes are not detected (PublicApiEntry schema doesn't capture them).
| Name | Type | Req | Description |
|---|---|---|---|
| baselinePath | string | yes | Path to a baseline .json snapshot (from a prior get_public_api_surface call) or a baseline .dll file. |
No output schema declared.
No examples provided.
find_callers ~81
Find every call site for a method. Returns an envelope with items, totalCount, truncated, limit, and a byProject summary.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by file, then line. |
| symbol | string | yes | Method name as Type.Method (simple or fully qualified) |
No output schema declared.
No examples provided.
find_catch_blocks ~278
Find the `catch` clauses that handle an exception type across the solution, and say what each one does with it. Each item reports `hasFilter` (a `when` clause, so the handler may decline at runtime), `rethrows` (the body contains a bare `throw;`) and `isEmpty` (an empty handler body) — together these answer 'who is silently swallowing this exception?' in a single call. By default only clauses declaring exactly the requested type match; set `includeBaseClauses` to also surface handlers that catch a base type, including `catch (Exception)` and bare `catch`, since those bind the requested type too. `caughtType` is null for a bare `catch`. The exception type may live in source or in metadata. Returns an envelope with items, totalCount, truncated, limit and a `byType` / `byProject` summary, sorted by file, line, column.
| Name | Type | Req | Description |
|---|---|---|---|
| exceptionType | string | yes | Exception type to search for (e.g. `System.IO.IOException` or `MyApp.DomainException`). |
| includeBaseClauses | boolean | – | Also match clauses catching a base type of the requested one, including bare `catch`. Default false. |
| limit | integer|null | – | Maximum number of items to return (default: 500). |
No output schema declared.
No examples provided.
find_circular_dependencies ~93
Detect circular dependencies in the project reference graph or namespace dependency graph. Returns an envelope with items sorted by cycle length desc, totalCount, truncated, and limit (default 100).
| Name | Type | Req | Description |
|---|---|---|---|
| level | string | – | Level: 'project' or 'namespace' (default: project) |
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by cycle length desc. |
No output schema declared.
No examples provided.
find_disposable_misuse ~130
Detect IDisposable / IAsyncDisposable instances at risk of leaking. Two patterns: local variables holding a disposable that aren't wrapped in using/await using/returned/assigned-to-field-or-out-parameter (warning), and bare-expression-statement discards of a disposable creator/factory (error). Returns a summary plus a per-violation list (severity error/warning, location, containing method, snippet). Skips test projects and generated code. Scope: methods only (not constructors/accessors/operators); ownership transfer via method/constructor argument is not detected. Static analysis only — no fix suggestions.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
find_event_subscribers ~215
Find every += and -= site for an event symbol across the solution. Accepts source events (e.g. 'MyClass.Clicked') or metadata events (e.g. 'System.Diagnostics.Process.Exited'). Each result reports the source location, the resolved handler (method FQN, or a synthetic name like 'lambda at File.cs:N' for inline handlers), and the subscription kind (Subscribe for +=, Unsubscribe for -=). Use this for memory-leak audits (compare subscribe/unsubscribe pairs), UI event subscriber inspection, or when Grep over '+= EventName' would miss qualified or fully-typed subscription sites. Returns an envelope with items sorted by file path then line, totalCount, truncated, and limit (default 500).
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by file path, then line. |
| symbol | string | yes | Event symbol (e.g. 'MyClass.Clicked' or 'System.Diagnostics.Process.Exited') |
No output schema declared.
No examples provided.
find_god_objects ~330
Find types that combine high size with high coupling — 'god classes' that violate single-responsibility and become refactoring nightmares. Sharper signal than find_large_classes alone: a 1000-line internal helper used only by its own namespace is not flagged, but a 200-line class called from 15 different namespaces is. Two axes: size (lines/members/fields) and coupling (incoming/outgoing namespace counts). A type qualifies when it crosses ALL THREE size thresholds AND at least one coupling threshold — keeps DTOs (high field count only) and dispatchers (high member count only) off the list. Defaults: lines >= 300, members >= 15, fields >= 10, incoming-namespaces >= 5, outgoing-namespaces >= 5. Each threshold is independently configurable. BCL namespaces (System.*, Microsoft.*) excluded from outgoing count. Test projects, generated code, interfaces, and nested types are skipped. Sort: total axes exceeded DESC, then line count DESC.
| Name | Type | Req | Description |
|---|---|---|---|
| minFields | integer | – | Min field count for size axis. Default 10. |
| minIncomingNamespaces | integer | – | Min incoming-namespace count for coupling axis. Default 5. |
| minLines | integer | – | Min lines for size axis. Default 300. |
| minMembers | integer | – | Min member count for size axis. Default 15. |
| minOutgoingNamespaces | integer | – | Min outgoing-namespace count for coupling axis. Default 5. |
| project | string|null | – | Optional: restrict to a single project by name (case-insensitive). |
No output schema declared.
No examples provided.
find_implementations ~80
Find all classes/structs implementing an interface or extending a class. Returns an envelope with items, totalCount, truncated, and limit.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 200). Items are sorted by file, then line. |
| symbol | string | yes | Type name (simple or fully qualified) |
No output schema declared.
No examples provided.
find_large_classes ~125
Find classes and structs that exceed member count or line count thresholds. Returns an envelope with items sorted worst-first (highest size first), totalCount, truncated, and limit (default 100).
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by size desc (worst first). |
| maxLines | integer | – | Maximum lines before flagging (default: 500) |
| maxMembers | integer | – | Maximum members before flagging (default: 20) |
| project | string|null | – | Optional project name filter |
No output schema declared.
No examples provided.
find_naming_violations ~104
Check .NET naming convention compliance: PascalCase types/methods/properties, camelCase parameters, I-prefix interfaces, _ prefix private fields. Returns an envelope with items, totalCount, truncated, limit (default 500), and a byRule summary.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by rule, then file. |
| project | string|null | – | Optional project name filter |
No output schema declared.
No examples provided.
find_obsolete_usage ~193
Find every call site referencing [Obsolete]-marked symbols in the solution, grouped by deprecation message and severity. Sharper than find_attribute_usages for migration-planning workflows: tells you 'we have 5 distinct deprecations pending; this one has 80 sites and is an error; that one has 3 sites and is a warning.' Includes both source-marked and metadata-marked obsoletes (third-party NuGet deprecations are surfaced too). Symbols with zero usages are omitted (no migration needed). Sort: errors first, then by usage count descending, then by symbol name. Test projects skipped. Project filter is case-insensitive.
| Name | Type | Req | Description |
|---|---|---|---|
| errorOnly | boolean | – | If true, only [Obsolete(..., true)] error-level deprecations are returned. Default false. |
| project | string|null | – | Optional: restrict to a single project by name (case-insensitive). |
No output schema declared.
No examples provided.
find_references ~263
Find all references to a symbol (type, method, property, field, or event) across the solution, each tagged with a kind. Kinds: `read`, `write`, `readwrite` (compound assignment / `++` / `ref`), `invocation`, `method_group`, `object_creation`, `cast`, `type_check` (`is` / patterns / `as`-tests), `typeof`, `base_type`, `type_constraint`, `type_argument`, `declaration`, `attribute`, `nameof`, `xml_doc`, and `usage` (rare fallback). Pass `kinds` to return only some (e.g. `["write","readwrite"]` for mutation sites). Envelope adds a `byKind` summary. Multiple references on one line are reported separately with a `column`.
| Name | Type | Req | Description |
|---|---|---|---|
| kinds | array|null | – | Optional kind filter - only references of these kinds are returned (see the kind list above) |
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by file, line, column. |
| symbol | string | yes | Symbol name: simple type (`MyClass`), fully qualified (`Namespace.MyClass`), or member (`MyClass.MyProperty`) |
No output schema declared.
No examples provided.
find_reflection_usage ~101
Detect dynamic/reflection-based usage like Type.GetType, Activator.CreateInstance, MethodInfo.Invoke. Returns an envelope with items, totalCount, truncated, limit (default 500), and a byKind summary.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by file, then line. |
| symbol | string|null | – | Optional type name to filter results (omit to scan entire solution) |
No output schema declared.
No examples provided.
find_tests_for_symbol ~117
List test methods that exercise the given production symbol. Recognises xUnit, NUnit, and MSTest. Set transitive=true to follow helper methods up to maxDepth levels (default 3, max 5).
| Name | Type | Req | Description |
|---|---|---|---|
| maxDepth | integer | – | Maximum walk depth when transitive=true. Clamped to [1, 5]. Default 3. |
| symbol | string | yes | Symbol name as Type.Method (simple or fully qualified) |
| transitive | boolean | – | Walk through helper methods to find indirect tests. Default false. |
No output schema declared.
No examples provided.
find_throw_sites ~242
Find every place an exception type is thrown across the solution — `throw new T(...)`, `throw expr;` and bare `throw;` rethrows (whose type comes from the enclosing `catch`). The exception type may live in source or in metadata, so `System.ArgumentNullException` works as well as your own `MyApp.DomainException`. Set `includeDerived` to also match subclasses of the requested type. Every throw in the file is reported, including throws inside lambdas and local functions, attributed to the member that contains them — use `get_exception_flow` instead when the question is which exceptions escape a specific method. Returns an envelope with items, totalCount, truncated, limit and a `byType` / `byProject` summary, sorted by file, line, column.
| Name | Type | Req | Description |
|---|---|---|---|
| exceptionType | string | yes | Exception type to search for (e.g. `System.InvalidOperationException` or `MyApp.DomainException`). |
| includeDerived | boolean | – | Also match types deriving from the requested one. Default false (exact type only). |
| limit | integer|null | – | Maximum number of items to return (default: 500). |
No output schema declared.
No examples provided.
find_uncovered_symbols ~78
Report public methods and properties that no test method transitively reaches (within 3 helper hops). Output sorted by cyclomatic complexity descending, with a coverage summary including a riskHotspotCount (uncovered with complexity >= 5). Recognises xUnit, NUnit, MSTest. Reference-based static analysis — does not parse runtime coverage data.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
find_unused_symbols ~138
Find potentially unused types and members (dead code detection). Checks public symbols for references across the solution. Filters out test methods, MCP tools, source-generator output, MEF-composed services, and interop-laid-out fields. Returns an envelope with items, totalCount, truncated, limit (default 500), and a summary including byKind + filteredOut counts.
| Name | Type | Req | Description |
|---|---|---|---|
| includeInternal | boolean | – | Include internal symbols (default: false) |
| limit | integer|null | – | Maximum number of items to return (default: 500). Items are sorted by project, then file. |
| project | string|null | – | Optional project name filter |
No output schema declared.
No examples provided.
generate_test_skeleton ~271
Emits a test-class skeleton (parseable C#) for a method or type. Pass a type FQN like 'MyApp.Services.OrderService' to get a full test class with one stub per public method, or a method FQN like 'MyApp.Services.OrderService.PlaceOrder' to get a single stub. Returns framework, suggested file path, class name, full file contents (as text), and TodoNotes for things to wire up (e.g. constructor dependencies). The tool does NOT write to disk — agent decides what to do with the text. Pairs naturally with find_uncovered_symbols / get_test_summary. Stubs include happy-path Fact, Theory + InlineData for primitive-param methods, and Assert.Throws assertions per distinct direct-throw exception type. Async (Task-returning) methods detected automatically. Properties, indexers, operators, and constructors are excluded from per-method enumeration. Framework auto-detected from solution test projects (tie → xUnit); override with framework='xunit' / 'nunit' / 'mstest'.
| Name | Type | Req | Description |
|---|---|---|---|
| framework | string|null | – | Optional framework override: 'xunit', 'nunit', or 'mstest'. Auto-detected if null. |
| symbol | string | yes | FQN of a type or method to generate a test skeleton for. |
No output schema declared.
No examples provided.
get_call_graph ~270
Transitive caller and/or callee graph for a method symbol, depth-bounded with cycle detection. Output is an adjacency-list dict per direction (callees and/or callers), where each visited symbol maps to its outgoing edges. Direction: 'callees' (what this method transitively calls), 'callers' (who reaches this method), or 'both'. External (BCL/NuGet) callees appear as terminal leaves with isExternal=true. Declared signature only on callee side — no virtual dispatch resolution; agent uses find_implementations separately if needed. Callers side resolves dispatch naturally via Roslyn SymbolFinder. Hard cap on total visited nodes (default 500) — sets truncated=true if hit; edges to truncated targets are still recorded against the source node. Use this instead of recursive find_callers / analyze_method calls when you need depth > 1.
| Name | Type | Req | Description |
|---|---|---|---|
| direction | string | – | 'callees' (default), 'callers', or 'both'. |
| maxDepth | integer | – | Max traversal depth from root. Default 3. |
| maxNodes | integer | – | Hard cap on total visited nodes. Default 500. |
| symbol | string | yes | Method symbol (e.g. 'Greeter.Greet' or 'MyNamespace.MyClass.MyMethod') |
No output schema declared.
No examples provided.
get_code_actions ~188
List available code actions (refactorings and fixes) at a position in a C# file. Optionally specify endLine/endColumn to select a range for extract-method style refactorings. Returns action titles that can be passed to apply_code_action. Returns an envelope with items sorted by kind then title, totalCount, truncated, and limit (default 100).
| Name | Type | Req | Description |
|---|---|---|---|
| column | integer | yes | Column number (1-based) |
| endColumn | integer|null | – | End column for text selection (1-based, optional) |
| endLine | integer|null | – | End line for text selection (1-based, optional) |
| filePath | string | yes | Full path to the C# source file |
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by kind then title. |
| line | integer | yes | Line number (1-based) |
No output schema declared.
No examples provided.
get_code_fixes ~130
Get available code fixes for a specific diagnostic at a file location. Returns structured text edits that can be reviewed and applied. Returns an envelope with items sorted by title, totalCount, truncated, and limit (default 100).
| Name | Type | Req | Description |
|---|---|---|---|
| diagnosticId | string | yes | Diagnostic ID (e.g., 'CA1822', 'CS0168') |
| filePath | string | yes | Full path to the source file |
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by title. |
| line | integer | yes | Line number where the diagnostic occurs |
No output schema declared.
No examples provided.
get_complexity_metrics ~230
Calculate complexity for members (methods, constructors, properties, indexers, operators). Reports both 'complexity' (cyclomatic - the number of paths, starts at 1) and 'cognitive' (how hard the code is to follow, starts at 0 - a 0 is not a bug), plus 'maxNesting'. The 'metric' parameter selects which of the two the threshold filters on and the sort uses. Returns an envelope with items sorted worst-first, totalCount, truncated, limit (default 100), and a summary with max/avg/overThreshold plus maxCognitive.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by the selected metric desc (worst first). |
| metric | string | – | Which metric drives the threshold and the sort: 'cyclomatic' (default) or 'cognitive'. Both are always reported. |
| project | string|null | – | Optional project name filter |
| threshold | integer | – | Minimum complexity threshold, applied to the selected metric (default: 10) |
No output schema declared.
No examples provided.
get_di_registrations ~88
Scan IServiceCollection extension methods for DI registrations of a type. Returns an envelope with items sorted by service name, totalCount, truncated, and limit (default 200).
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 200). Items are sorted by service name. |
| symbol | string | yes | Type name to search for (simple or fully qualified) |
No output schema declared.
No examples provided.
get_diagnostics ~145
List compiler errors and warnings across the solution, optionally including analyzer diagnostics. Analyzer diagnostics require the solution to be trusted (see 'trust_solution'). Returns an envelope with items, totalCount, truncated, limit, and a severity summary.
| Name | Type | Req | Description |
|---|---|---|---|
| includeAnalyzers | boolean | – | Include analyzer diagnostics (default: false — requires trust_solution to be called first) |
| limit | integer|null | – | Maximum number of items to return (default: 1000). Items are sorted severity-desc, then file, then line. |
| project | string|null | – | Optional project name filter |
| severity | string|null | – | Minimum severity: 'error' or 'warning' (default: warning) |
No output schema declared.
No examples provided.
get_exception_flow ~383
Which exceptions can escape a method — the 'is calling this safe?' question. Walks the method's callees depth-first (cycle-safe, depth- and node-bounded) collecting every explicit throw, then propagates each one back up the call chain, testing the enclosing `try`/`catch` at the throw and at every call site on the way out. Each item reports `escapes`, the `path` of methods from the analysed method to the one that raises it, and — when it is stopped — `caughtIn`, `caughtFile`, `caughtLine`. A handler with a `when` filter sets `hasFilter` and the exception is still reported as escaping, because the filter may decline at runtime. `origin` is `thrown` for a real throw site in source, or `documented` for an `exception` XML doc tag on a metadata (BCL/NuGet) callee — set `includeDocumented` to false to drop the latter. Throws inside lambdas and local functions are excluded: they escape when that body runs, not at this method's boundary — use `find_throw_sites` for a plain textual scan of throws. Static analysis only: no reflection, no virtual-dispatch resolution, and no implicit runtime failures such as null dereferences. Hitting `maxDepth` or `maxNodes` sets `truncated`.
| Name | Type | Req | Description |
|---|---|---|---|
| includeDocumented | boolean | – | Include exceptions documented by `exception` XML tags on metadata callees. Default true. |
| maxDepth | integer | – | Max callee depth to walk from the analysed method. Default 3. |
| maxNodes | integer | – | Hard cap on methods visited. Default 500. |
| method | string | yes | Method symbol to analyse (e.g. `OrderService.Place` or `MyNamespace.MyClass.MyMethod`). |
No output schema declared.
No examples provided.
get_extension_methods ~441
Answer 'what extension members can I call on this type?' — every extension method and C# 14 extension property applicable to a receiver type, from solution source AND referenced metadata (so BCL LINQ such as `Where`, `Select`, `Chunk` is included). Applicability is decided by the compiler's own reduction, not by name matching: `this IEnumerable<T>` is reported for `string` (which is `IEnumerable<char>`) while `this IEnumerable<string>` is not. Each entry carries the reduced call-site signature (receiver dropped, generic inference applied, return type first: `IEnumerable<int> Where<int>(Func<int, bool>)`, `int Tripled`), kind (`method` or `property`), declaring type, namespace, origin (`source` or `metadata`), source file/line for source members, XML doc summary, and `isStatic`. Read `isStatic` before writing the call: false means an instance call (`value.Doubled()`) and is the normal case even though every extension method is DECLARED static; true means a C# 14 static extension member, called on the type itself (`int.Zero`). Results are NOT filtered by `using` scope — the tool has no call-site position, so every applicable member is reported and its namespace is given for you to add the import. Pass a type name: simple (`Widget`), fully qualified (`MyApp.Widget`), a C# keyword (`int`, `string`), a constructed generic (`List<int>`), an array (`string[]`), a nullable (`int?`), or a tuple (`(int, string)`). Sort: source before metadata, then declaring type, then name.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100) |
| nameFilter | string|null | – | Optional case-insensitive substring filter on the member name — e.g. `chunk` |
| type | string | yes | Receiver type — e.g. `Widget`, `MyApp.Widget`, `int`, `List<int>`, `string[]`, `int?`, `(int, string)` |
No output schema declared.
No examples provided.
get_file_overview ~88
Get a summary of a C# file: which types are defined in it and any compiler diagnostics. Useful for quickly understanding a file's contents without reading it. Also accepts .razor/.cshtml markup, resolving it to the C# document its source generator produced.
| Name | Type | Req | Description |
|---|---|---|---|
| filePath | string | yes | Full path to the source file (.cs, or .razor/.cshtml) |
No output schema declared.
No examples provided.
get_generated_code ~101
Inspect generated source code from source generators. Returns an envelope with items sorted by project then file path, totalCount, truncated, and limit (default 200).
| Name | Type | Req | Description |
|---|---|---|---|
| file | string|null | – | File path (or partial match) to filter by |
| generator | string|null | – | Generator name to filter by |
| limit | integer|null | – | Maximum number of items to return (default: 200). Items are sorted by project, then file path. |
No output schema declared.
No examples provided.
get_instantiation_options ~349
Answer 'how do I construct this type?' in one call — accessible constructors, static factory methods declared anywhere in the solution, and DI registrations. Constructors report every parameter's type and name, declared accessibility, whether the constructor is compiler-supplied (`isImplicit` — a struct or a class with no declared constructor still has a usable parameterless one), and whether it is obsolete. Factories are static members returning the type, including ones declared on a DIFFERENT type such as `WidgetFactory.Create()`, with `Task<T>`/`ValueTask<T>` unwrapped and flagged `isAsync`. Instance builder methods are excluded because the builder itself would need constructing. Pass `fromProject` to get `accessible` computed for that project, which honours `InternalsVisibleTo` — this is how you find out whether your test project can reach an internal constructor. Without it, `accessible` is null, meaning NOT COMPUTED — which is not the same as false, so do not read a null as 'you cannot call this'. `requiredMembers` lists members that must be set in an object initializer. `diRegistrations` shows where the type is registered in a container — a registered type is usually meant to be resolved rather than constructed by hand. For interfaces, abstract classes and static classes, `instantiable` is false and `note` explains why; use `find_implementations` to find concrete types.
| Name | Type | Req | Description |
|---|---|---|---|
| fromProject | string|null | – | Optional project name whose viewpoint decides `accessible` (e.g. `MyApp.Tests`). |
| symbol | string | yes | Type to construct — simple (`Widget`) or fully qualified (`MyApp.Widget`). |
No output schema declared.
No examples provided.
get_method_source ~193
Return the full declaration source (XML docs, attributes, signature, body — original formatting) of one or more members by name: methods (all overloads returned), constructors (request as `Widget.Widget` or fully qualified `Ns.Widget.Widget`; nested types need full qualification), properties, indexers (request as `Type.this` or `Type.this[]`), fields, events. Batch-friendly: pass many names in one call instead of reading whole files. Per-item statuses: ok, notFound, ambiguous (with candidates), metadata (use `peek_il` or `inspect_external_assembly`), unsupportedKind (whole types — use `get_type_overview`). Items keep request order.
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100) |
| symbols | array | yes | Member names: simple (`MyClass.MyMethod`) or fully qualified (`Ns.MyClass.MyMethod`) |
No output schema declared.
No examples provided.
get_nuget_dependencies ~39
List NuGet package references for projects in the solution
| Name | Type | Req | Description |
|---|---|---|---|
| project | string|null | – | Optional project name filter (omit to list all) |
No output schema declared.
No examples provided.
get_operators ~188
Return every user-defined operator and conversion operator on a type in one call — source AND metadata. Each entry includes the operator kind (such as +, ==, implicit, explicit, plus all comparison and bitwise operators), full signature, parameter names/types/modifiers, return type, accessibility, an IsCheckedVariant flag for .NET 7+ checked operators (op_CheckedAddition etc.), XML doc summary, and source location (empty for metadata). Includes compiler-synthesized record equality operators. Returns declared operators only — operators do not inherit in C#. Pass a type name, simple or fully qualified (e.g. 'Vector2', 'MyApp.Money', 'System.Decimal'). Sort: kind ordinal ASC, then parameter count ASC, then signature ordinal ASC.
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Type name (simple or fully qualified) — e.g. Vector2, MyApp.Money |
No output schema declared.
No examples provided.
get_overloads ~158
Return every overload of a method (or constructor) in one call — source AND metadata. Each overload includes the full signature, parameter names/types/modifiers (ref/out/in/params/optional with defaults), return type, accessibility, modifiers (static/virtual/abstract/override/async/extension), generic type parameters, XML doc summary, and source location (empty for metadata). Pass 'Type.Method' for ordinary methods or 'Type.Type' for constructors. Operator overloads are excluded — use get_operators for those. Sort: parameter count ASC, then signature ordinal ASC.
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Method or constructor symbol (e.g. 'Greeter.Greet', 'Greeter.Greeter', 'System.Console.WriteLine'). |
No output schema declared.
No examples provided.
get_project_dependencies ~35
Return the project reference graph (direct and transitive dependencies)
| Name | Type | Req | Description |
|---|---|---|---|
| project | string | yes | Project name or .csproj filename |
No output schema declared.
No examples provided.
get_project_health ~221
Aggregate 7 health dimensions per project in one call: complexity hotspots, large classes, naming violations, unused symbols, reflection usage, async violations, and disposable misuse. Returns counts per dimension plus the top-N hotspots inline (default 5) so the caller can prioritise without follow-up calls. Use this when answering 'how is this project doing?' / 'where should I focus?' / 'what's the technical debt picture?'. Underlying defaults: complexity threshold 10, large-class limits 20 members / 500 lines, unused symbols excludes internals. Test projects are skipped. Project filter is case-insensitive. Sort: projects ASC by name; hotspots sorted by severity proxy per dimension (cyclomatic complexity desc, line count desc, severity enum desc for async/disposable).
| Name | Type | Req | Description |
|---|---|---|---|
| hotspotsPerDimension | integer | – | How many hotspots to include per dimension. Default: 5. Pass 0 for counts-only output. |
| project | string|null | – | Optional: restrict to a single project by name. Default: whole solution, grouped per project. |
No output schema declared.
No examples provided.
get_public_api_surface ~109
Enumerate every public and protected type and member declared in production projects of the active solution. Returns a deterministically-sorted (name ASC) flat list of API entries (kind, fully-qualified name, accessibility, project, file, line) plus per-kind/per-project/per-accessibility summary buckets. Skips test projects, generated code, compiler-generated members, internal symbols, and protected members on sealed types (unreachable). Inherited members are not repeated under derived types — only declared members appear.
Input schema present but exposes no named parameters.
No output schema declared.
No examples provided.
get_source_generators ~84
List source generators and their output per project. Returns an envelope with items sorted by project then generator name, totalCount, truncated, and limit (default 100).
| Name | Type | Req | Description |
|---|---|---|---|
| limit | integer|null | – | Maximum number of items to return (default: 100). Items are sorted by project, then generator name. |
| project | string|null | – | Optional project name filter |
No output schema declared.
No examples provided.
get_symbol_context ~44
One-shot context dump for a type: namespace, base class, interfaces, injected dependencies, public members
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Type name (simple or fully qualified) |
No output schema declared.
No examples provided.
get_task_status ~38
Get the current status of a background task by its taskId.
| Name | Type | Req | Description |
|---|---|---|---|
| taskId | string | yes | The taskId returned by start_background_task |
No output schema declared.
No examples provided.
get_test_summary ~174
Per-project inventory of test methods. Each test reports framework (xUnit/NUnit/MSTest), attribute kind ([Fact]/[Theory]/[Test]/[TestCase]/[TestMethod]/[DataTestMethod]), data-driven row count, location, and the production symbols it references. Complements find_tests_for_symbol (which goes test → production); this goes project → tests. Use to answer 'what does this test suite cover?' or to break down test counts by framework/attribute. Production projects, generated code, and BCL/framework calls are filtered out of the per-test referenced-symbols list. Project filter is case-insensitive. Sort: tests by (file, line); projects by name ASC.
| Name | Type | Req | Description |
|---|---|---|---|
| project | string|null | – | Optional: restrict to a single test project by name (case-insensitive). |
No output schema declared.
No examples provided.
get_type_hierarchy ~42
Walk up (base classes, interfaces) and down (derived types) from a type
| Name | Type | Req | Description |
|---|---|---|---|
| symbol | string | yes | Type name (simple or fully qualified) |
No output schema declared.
No examples provided.
What is the Roslyn CodeLens MCP server?
Roslyn CodeLens is an MCP server listed in the public MCP registry as io.github.MarcelRoozekrans/roslyn-codelens. Roslyn MCP server: semantic .NET/C# intelligence - analysis, refactoring, tests, IL inspection. This page covers its NuGet package (RoslynCodeLens.Mcp).
Is the Roslyn CodeLens MCP server safe to use?
Roslyn CodeLens scores 83 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 20 September 2026. It declares no install or post-install scripts. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.
What tools does the Roslyn CodeLens MCP server expose?
Roslyn CodeLens exposes 67 tools: list_running_tasks, get_task_status, find_obsolete_usage, find_disposable_misuse, get_project_dependencies, and 62 more. Their descriptions and schemas cost roughly 10,271 tokens of context every time the server is loaded.
Is the Roslyn CodeLens MCP server still maintained?
Roslyn CodeLens is still listed as active in the MCP registry. We last reached this channel on 20 September 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.
What licence is the Roslyn CodeLens MCP server under?
Roslyn CodeLens declares the MIT licence, which is OSI-approved. That covers the source only, and says nothing about the cost of any service it calls.