# SharpLens (nuget · SharpLensMcp)

67 semantic C#/.NET analysis tools via Roslyn: navigation, refactoring, codegen, audit.

- Trust score: 39/100 (low)
- Change this week: −8
- Registry status: active
- Liveness: live
- Owner verified: no
- Last scored: 2026-08-03

## Components

- npm · `sharplens-mcp`: 39/100, [markdown](https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplens-mcp.md), [page](https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplens-mcp)
- nuget · `SharpLensMcp`: 39/100 (this document), [markdown](https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp.md), [page](https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp)

## Channel facts

- Registry: `nuget`
- Package: `SharpLensMcp`
- Version: `1.5.3`
- Transport: `stdio`

## Trust breakdown

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. Scores are 0–100 per category. Scoring method: https://verifymcp.io/docs/scoring (what has changed: https://verifymcp.io/docs/scoring/changelog)

Scored 2026-08-03.

- **Supply Chain Security**: 100/100
  - No malware found by supply-chain analysis.
  - No known CVEs affecting this package version or its production dependencies.
  - No install/post-install scripts declared.
  - No production dependencies, so there is no dependency health to assess.
- **Provenance & Transparency**: 45/100
  - Source repository is publicly reachable at the declared URL.
  - Provenance check failed: no build-provenance attestation is published.
  - Clear OSI-approved license (MIT).
  - Actively maintained (last published 30 days ago).
  - Disclosure check failed: no security disclosure policy was found in the source repository.
- **Schema Quality & AI Usability**: 0/100
  - Schema quality not yet verified: our sandbox run of this package did not complete, so we have no schema to assess.
- **Stability & Change Management**: 0/100
  - Stability not yet verified: our sandbox run of this package did not complete, so we have no schema to compare.
- **Tool Coverage**: 0/100
  - Tool coverage not yet verified: our sandbox run of this package did not complete, so we have no tool definitions to assess.
- **Capabilities**: 0/100
  - Protocol version not yet verified: our sandbox run of this package did not complete, so we never saw its MCP handshake.

**Unverified: 4 categories.** Categories scored 0 because our sandbox run of this package has not given us the schema these checks need to read. That is a gap on our side rather than a finding about the package, and we only credit what we can confirm, so the score stands at 0 until the capture succeeds. We are working through the fleet, so this normally clears without any action from you.

## Install

### Claude

```bash
claude mcp add pzalutski-pixel-sharplens -- dnx SharpLensMcp@1.5.3 --yes
```

### Codex

```bash
codex mcp add pzalutski-pixel-sharplens -- dnx SharpLensMcp@1.5.3 --yes
```

### opencode

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "pzalutski-pixel-sharplens": {
      "type": "local",
      "command": [
        "dnx",
        "SharpLensMcp@1.5.3",
        "--yes"
      ],
      "enabled": true
    }
  }
}
```

### Hermes

```yaml
mcp_servers:
  pzalutski-pixel-sharplens:
    command: "dnx"
    args: ["SharpLensMcp@1.5.3", "--yes"]
```

### Other

```json
{
  "mcpServers": {
    "pzalutski-pixel-sharplens": {
      "command": "dnx",
      "args": [
        "SharpLensMcp@1.5.3",
        "--yes"
      ]
    }
  }
}
```

## Changelog

Every change recorded for this component, newest first. Days that predate change tracking, or that we cannot explain, say so: "we were watching and nothing happened" and "we were not watching" are different claims.

### 2026-08-02 (score 39, +15)

- [security improvement] Malware scan: unverified → pass

### 2026-07-31 (score 24, −5)

- [functional] We updated how we score, so this day's move reflects our rubric, not a change to the server

### 2026-07-30 (score 29, −18)

- [security regression] Malware scan: pass → unverified

### 2026-07-27 (score 47, 0)

- [functional] Tool coverage: Tool coverage not yet verified: our sandbox run of this package did not complete, so we have no tool definitions to assess.
- [functional] Schema quality: Schema quality not yet verified: our sandbox run of this package did not complete, so we have no schema to assess.

### 2026-07-26 (score 47)

First indexed and scored.

- [functional] We updated how we score, so this day's move reflects our rubric, not a change to the server

## MCP tools (67)

### `roslyn:health_check` (~51 tokens)

Check the health and status of the Roslyn MCP server and workspace. Returns: server status, solution loaded state, project count, and memory usage. Call this first to verify the server is ready.

### `roslyn:load_solution` (~69 tokens)

Load a .NET solution for analysis. MUST be called before using any other analysis tools. Returns: projectCount, documentCount, and load time. Use health_check to verify current state.

Input parameters:

- `solutionPath` (string, required): Absolute path to .sln or .slnx file

### `roslyn:sync_documents` (~193 tokens)

Synchronize document changes from disk into the loaded solution. Call this after using Edit/Write tools to ensure Roslyn has fresh content.

USAGE:
\- sync_documents(filePaths: ["src/Foo.cs", "src/Bar.cs"]) - sync specific files
\- sync_documents() - sync ALL documents (refresh entire solution)

WHEN TO CALL:
\- After using Edit tool to modify .cs files
\- After using Write tool to create new .cs files
\- After deleting .cs files
\- NOT needed after using SharpLensMcp refactoring tools (they auto-update)

HANDLES: Modified files (updates content), new files (adds to solution), deleted files (removes from solution).
Much faster than load_solution - only updates documents, doesn't re-parse projects.

Input parameters:

- `filePaths` (array): Optional: specific file paths to sync. If omitted, syncs ALL documents from disk.

### `roslyn:get_symbol_info` (~124 tokens)

Get detailed semantic information about a symbol at a specific position. IMPORTANT: Uses ZERO-BASED coordinates. If your editor shows 'Line 14, Column 5', pass line=13, column=4. Returns symbol kind, type, namespace, documentation, and location.

Input parameters:

- `column` (integer, required): Zero-based column number (Visual Studio col 5 = col 4 here)
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number (Visual Studio line 14 = line 13 here)

### `roslyn:go_to_definition` (~96 tokens)

Fast navigation to symbol definition. Returns the definition location without finding all references. IMPORTANT: Uses ZERO-BASED coordinates (editor line 10 = pass line 9).

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `filePath` (string, required): Absolute path to source file containing the symbol
- `line` (integer, required): Zero-based line number (editor line - 1)

### `roslyn:find_references` (~229 tokens)

Find all references to a symbol across the entire solution. Returns file paths, line numbers, code context, and a `kind` for each reference: write (assignment LHS, ++/--, ref/out arg), invocation (call target), cast (cast target type), typeof, nameof, attribute, or read. IMPORTANT: Uses ZERO-BASED coordinates (editor line 10 = pass line 9).

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `filePath` (string, required): Absolute path to source file containing the symbol
- `kind` (string): Optional kind filter (case-insensitive). One of: write, invocation, cast, typeof, nameof, attribute, read. When set, the response includes totalReferences (unfiltered) and totalReferencesAfterFilter…
- `line` (integer, required): Zero-based line number (editor line - 1)
- `maxResults` (integer): Maximum number of references to return (default: 100). Results are truncated with a hint if limit is exceeded.

### `roslyn:find_implementations` (~110 tokens)

Find all implementations of an interface or abstract class. Returns implementing types with their locations. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number
- `maxResults` (integer): Maximum number of implementations to return (default: 50). Results are truncated with a hint if limit is exceeded.

### `roslyn:get_type_hierarchy` (~118 tokens)

Get the inheritance hierarchy (base types and derived types) for a type. Returns baseTypes chain and derivedTypes list. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number
- `maxDerivedTypes` (integer): Maximum number of derived types to return (default: 50). Results are truncated with a hint if limit is exceeded.

### `roslyn:search_symbols` (~255 tokens)

Search for types, methods, properties, etc. by name across the solution. Supports glob patterns (e.g., '*Handler' finds classes ending with 'Handler', 'Get*' finds symbols starting with 'Get'). Use ? for single character wildcard. PAGINATION: Returns totalCount and hasMore. Use offset to paginate through results.

Input parameters:

- `kind` (string): Optional: filter by symbol kind. For types use: Class, Interface, Struct, Enum, Delegate. For members use: Method, Property, Field, Event. Other: Namespace. Case-insensitive.
- `maxResults` (integer): Maximum number of results per page (default: 50)
- `namespaceFilter` (string): Optional: filter by namespace (supports wildcards). Examples: 'MyApp.Core.*', '*.Services', 'MyApp.*.Handlers'. Case-insensitive.
- `offset` (integer): Offset for pagination (default: 0). Use pagination.nextOffset from previous response to get next page.
- `query` (string, required): Search query - supports wildcards: * (any characters), ? (single character). Examples: 'Handler', '*Handler', 'Get*', 'I?Service'. Case-insensitive.

### `roslyn:semantic_query` (~419 tokens)

Advanced semantic code query with multiple filters. Find symbols based on their semantic properties.

EXAMPLES:
\- Async methods without CancellationToken: isAsync=true, parameterExcludes=["CancellationToken"]
\- Public static methods: accessibility="Public", isStatic=true
\- Classes with [Obsolete]: kinds=["Class"], attributes=["ObsoleteAttribute"]

FILTERS: All specified filters are combined with AND logic. Omit a filter to skip it. Returns symbol details with locations.

Input parameters:

- `accessibility` (string): Optional: filter by accessibility. Values: Public, Private, Internal, Protected, ProtectedInternal, PrivateProtected
- `attributes` (array): Optional: filter by attributes (must have ALL specified). Example: ['ObsoleteAttribute', 'EditorBrowsableAttribute']
- `isAsync` (boolean): Optional: filter methods by async/await (true for async methods, false for sync methods)
- `isStatic` (boolean): Optional: filter by static modifier (true for static, false for instance)
- `kinds` (array): Optional: filter by symbol kinds (can specify multiple). For types: Class, Interface, Struct, Enum, Delegate. For members: Method, Property, Field, Event. Example: ['Class', 'Interface']
- `maxResults` (integer): Maximum number of results (default: 100)
- `namespaceFilter` (string): Optional: filter by namespace (supports wildcards). Examples: 'MyApp.Core.*', '*.Services'
- `parameterExcludes` (array): Optional: filter methods that must NOT have these parameter types (partial match). Example: ['CancellationToken']
- `parameterIncludes` (array): Optional: filter methods that MUST have these parameter types (partial match). Example: ['CancellationToken']
- `returnType` (string): Optional: filter methods by return type. Partial match. Example: 'Task' finds all methods returning Task
- `type` (string): Optional: filter fields/properties by their type. Partial match. Example: 'ILogger' finds all ILogger fields/properties

### `roslyn:get_diagnostics` (~192 tokens)

Get compiler errors, warnings, info messages, AND configured analyzer findings (StyleCop, Roslynator, NetAnalyzers, custom analyzers; editorconfig-resolved severities) for a file or project. Use before committing - this matches what CI will fail on. Response includes analyzersRan and analyzerCount so callers know whether analyzers contributed.

Input parameters:

- `filePath` (string): Optional: path to specific file, omit for all files
- `includeHidden` (boolean): Include hidden diagnostics (default: false)
- `projectPath` (string): Optional: path to specific project
- `runAnalyzers` (boolean): Run configured DiagnosticAnalyzers in addition to the compiler (default: true). Set false for a fast compiler-only pass when speed matters; otherwise leave true so output matches CI build behavior.
- `severity` (string): Optional: filter by severity (Error, Warning, Info)

### `roslyn:get_code_fixes` (~114 tokens)

Get available code fixes for a specific diagnostic. Returns list of fix titles and descriptions. WORKFLOW: (1) get_diagnostics to find issues, (2) get_code_fixes to see options, (3) apply_code_fix to fix.

Input parameters:

- `column` (integer, required): Zero-based column number
- `diagnosticId` (string, required): Diagnostic ID (e.g., CS0246)
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number

### `roslyn:apply_code_fix` (~196 tokens)

Apply automated code fix for a diagnostic. WORKFLOW: (1) Call with no fixIndex to list available fixes, (2) Call with fixIndex and preview=true to preview changes, (3) Call with preview=false to apply. IMPORTANT: Uses ZERO-BASED coordinates.

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `diagnosticId` (string, required): Diagnostic ID (e.g., CS0168, CS1998, CS4012)
- `filePath` (string, required): Absolute path to source file
- `fixIndex` (integer): Index of fix to apply (omit to list available fixes). Call without this parameter first to see available fixes.
- `line` (integer, required): Zero-based line number (editor line - 1)
- `preview` (boolean): Preview mode (default: true). Set to false to apply changes to disk. ALWAYS preview first!

### `roslyn:get_project_structure` (~174 tokens)

Get solution/project structure. IMPORTANT: For large solutions (100+ projects), use summaryOnly=true or projectNamePattern to avoid token limit errors. Maximum output is limited to 25,000 tokens.

Input parameters:

- `includeDocuments` (boolean): Include document lists (default: false, limited to 500 per project)
- `includeReferences` (boolean): Include package references (default: true, limited to 100 per project)
- `maxProjects` (integer): Maximum number of projects to return (e.g., 10 for large solutions)
- `projectNamePattern` (string): Filter projects by name pattern (supports * and ? wildcards, e.g., '*.Application' or 'MyApp.*')
- `summaryOnly` (boolean): Return only project names and counts (default: false, recommended for large solutions)

### `roslyn:organize_usings` (~52 tokens)

Sort and remove unused using directives in a file. Returns the modified file content. Automatically removes unused usings and sorts alphabetically.

Input parameters:

- `filePath` (string, required): Absolute path to source file

### `roslyn:organize_usings_batch` (~142 tokens)

Organize using directives for multiple files in a project. Supports file pattern filtering (e.g., '*.cs', 'Services/*.cs'). PREVIEW mode by default - set preview=false to apply changes.

Input parameters:

- `filePattern` (string): Optional: Glob pattern to filter files (e.g., '*.cs', 'Services/*.cs', '*Repository.cs'). Matches against file names, not full paths.
- `preview` (boolean): Preview mode (default: true). Set to false to apply changes to disk. ALWAYS preview first!
- `projectName` (string): Optional: Project name to process. If omitted, processes all projects in solution.

### `roslyn:format_document_batch` (~166 tokens)

Format multiple documents in a project using Roslyn's NormalizeWhitespace. Ensures consistent indentation, spacing, and line breaks. PREVIEW mode by default - set preview=false to apply changes.

Input parameters:

- `filePattern` (string): Optional: Glob pattern to filter files (e.g., '*.cs', 'Services/*.cs', '*Repository.cs'). Matches against file names, not full paths.
- `includeTests` (boolean): Include test projects (default: true). Set to false to skip projects with 'Test' in the name.
- `preview` (boolean): Preview mode (default: true). Set to false to apply changes to disk. ALWAYS preview first!
- `projectName` (string): Optional: Project name to format. If omitted, formats all projects in solution.

### `roslyn:get_method_overloads` (~88 tokens)

Get all overloads of a method. Returns list of signatures with parameter details. Use when you need to choose between overloads. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number

### `roslyn:get_containing_member` (~91 tokens)

Get information about the containing method/property/class at a position. Returns the enclosing symbol's name, kind, and signature. Useful for understanding context. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number

### `roslyn:find_callers` (~136 tokens)

Find all methods/properties that call or reference a specific symbol (inverse of find_references). Essential for impact analysis: 'If I change this method, what code will be affected?' IMPORTANT: Uses ZERO-BASED coordinates.

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number (editor line - 1)
- `maxResults` (integer): Maximum number of call sites to return (default: 100). Results are truncated with a hint if limit is exceeded.

### `roslyn:find_unused_code` (~188 tokens)

Find unused types, methods, properties, and fields in a project or entire solution. Returns symbols with zero references (excluding their declaration).

USAGE: find_unused_code() for entire solution, or find_unused_code(projectName="MyProject") for specific project.
OUTPUT: List of unused symbols with location, kind, and accessibility. Default limit: 50 results.

Input parameters:

- `includeInternal` (boolean): Include internal members (default: false - usually want to keep internal APIs)
- `includePrivate` (boolean): Include private members (default: true)
- `maxResults` (integer): Maximum results to return (default: 50, helps manage large outputs)
- `projectName` (string): Optional: analyze specific project by name, omit to analyze entire solution
- `symbolKindFilter` (string): Optional: filter by symbol kind (Class, Method, Property, Field)

### `roslyn:rename_symbol` (~229 tokens)

Safely rename a symbol (type, method, property, etc.) across the entire solution. Uses Roslyn's semantic analysis to ensure all references are updated. SUPPORTS PREVIEW MODE - always preview first! IMPORTANT: Uses ZERO-BASED coordinates. Default shows first 20 files with summary verbosity.

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `filePath` (string, required): Absolute path to source file containing the symbol
- `line` (integer, required): Zero-based line number (editor line - 1)
- `maxFiles` (integer): Max files to show in preview (default: 20, prevents large outputs)
- `newName` (string, required): New name for the symbol
- `preview` (boolean): Preview changes without applying (default: true). ALWAYS preview first!
- `verbosity` (string): Output detail level: 'summary' (default, file paths + counts only ~200 tokens/file), 'compact' (add locations ~500 tokens/file), 'full' (include old/new text ~3000+ tokens/file)

### `roslyn:extract_interface` (~175 tokens)

Generate an interface from a class or struct. Extracts all public instance members (methods, properties, events).

USAGE: Position on class declaration, provide interfaceName="IMyService".
OUTPUT: Generated interface code ready to insert. Useful for dependency injection and testability.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number (editor column - 1)
- `filePath` (string, required): Absolute path to source file containing the class
- `includeMemberNames` (array): Optional: specific member names to include (omit to include all public members)
- `interfaceName` (string, required): Name for the new interface (e.g., 'IMyService')
- `line` (integer, required): Zero-based line number (editor line - 1)

### `roslyn:dependency_graph` (~95 tokens)

Visualize project dependencies as a graph. Shows which projects reference which, detects circular dependencies.

OUTPUT: format="json" returns structured data with nodes/edges. format="mermaid" returns diagram syntax.
USE CASE: Understand solution architecture, find circular dependencies, plan refactoring.

Input parameters:

- `format` (string): Output format: 'json' (default) returns structured data, 'mermaid' returns Mermaid diagram syntax

### `roslyn:get_type_members` (~238 tokens)

Get all members (methods, properties, fields, events) of a type BY NAME.

USAGE PATTERNS:
\- Basic: get_type_members("MyClass") - list all members
\- With inheritance: get_type_members("MyService", includeInherited=true)
\- Filter by kind: get_type_members("MyClass", memberKind="Method")
\- Verbosity control: verbosity="summary" (names only), "compact" (default, + signatures), "full" (+ docs, attrs)

WORKS WITH: Fully-qualified ("MyNamespace.MyClass"), simple ("MyClass"), or partial names.

Input parameters:

- `includeInherited` (boolean): Include members from base classes (default: false)
- `maxResults` (integer): Maximum members to return (default: 100)
- `memberKind` (string): Filter: 'Method', 'Property', 'Field', 'Event'
- `typeName` (string, required): Type name (e.g., 'MyClass', 'MyNamespace.MyService')
- `verbosity` (string): 'summary' (names only), 'compact' (default), 'full' (+ docs, attrs)

### `roslyn:get_method_signature` (~104 tokens)

Get detailed method signature BY NAME including parameters, return type, nullability, and modifiers.

USAGE: get_method_signature("MyClass", "ProcessData") or with overload selection: get_method_signature("MyClass", "ProcessData", overloadIndex=1)

Input parameters:

- `methodName` (string, required): Method name
- `overloadIndex` (integer): Which overload (0-based, default: 0)
- `typeName` (string, required): Containing type name

### `roslyn:get_attributes` (~138 tokens)

Find all symbols with specific attributes.

USAGE:
\- Find obsolete: get_attributes("Obsolete")
\- Find serializable: get_attributes("Serializable")
\- Scope to project: get_attributes("Obsolete", scope="project:MyProject")
\- Scope to file: get_attributes("Obsolete", scope="file:MyClass.cs")

Input parameters:

- `attributeName` (string, required): Attribute name (e.g., 'Obsolete', 'Serializable', 'JsonProperty')
- `maxResults` (integer): Maximum results (default: 100)
- `scope` (string): 'solution' (default), 'project:Name', or 'file:path'

### `roslyn:get_derived_types` (~101 tokens)

Find all types inheriting from a base type BY NAME.

USAGE:
\- Find all subclasses: get_derived_types("BaseService")
\- Direct children only: get_derived_types("BaseClass", includeTransitive=false)

Input parameters:

- `baseTypeName` (string, required): Base type name
- `includeTransitive` (boolean): Include indirect descendants (default: true)
- `maxResults` (integer): Maximum results (default: 100)

### `roslyn:get_base_types` (~50 tokens)

Get full inheritance chain BY NAME.

USAGE: get_base_types("MyService") returns: MyService → BaseService → ... → Object

Input parameters:

- `typeName` (string, required): Type name

### `roslyn:analyze_data_flow` (~110 tokens)

Analyze variable assignments and usage in a code region.

Returns: variablesDeclared, alwaysAssigned, dataFlowsIn/Out, readInside/Outside, writtenInside/Outside, captured.

USAGE: analyze_data_flow("path/to/file.cs", startLine=10, endLine=25)

Input parameters:

- `endLine` (integer, required): End line (0-based)
- `filePath` (string, required): Absolute path to source file
- `startLine` (integer, required): Start line (0-based)

### `roslyn:analyze_control_flow` (~101 tokens)

Analyze branching and reachability in a code region.

Returns: entryPoints, exitPoints, returnStatements, endPointIsReachable.

USAGE: analyze_control_flow("path/to/file.cs", startLine=10, endLine=25)

Input parameters:

- `endLine` (integer, required): End line (0-based)
- `filePath` (string, required): Absolute path to source file
- `startLine` (integer, required): Start line (0-based)

### `roslyn:get_type_overview` (~66 tokens)

Get comprehensive type overview in ONE CALL: type info + base types (first 3) + member counts.

USAGE: get_type_overview("MyService") - returns everything you need to understand a type quickly.

Input parameters:

- `typeName` (string, required): Type name

### `roslyn:analyze_method` (~157 tokens)

Get comprehensive method analysis in ONE CALL: signature + callers + outgoing calls + location.

USAGE: analyze_method("MyService", "ProcessData") or analyze_method("MyClass", "Calculate", includeCallers=true, includeOutgoingCalls=true)

Input parameters:

- `includeCallers` (boolean): Include caller analysis (default: true)
- `includeOutgoingCalls` (boolean): Include methods/properties this method calls (default: false)
- `maxCallers` (integer): Max callers to return (default: 20)
- `maxOutgoingCalls` (integer): Max outgoing calls to return (default: 50)
- `methodName` (string, required): Method name
- `typeName` (string, required): Containing type name

### `roslyn:get_file_overview` (~58 tokens)

Get comprehensive file overview in ONE CALL: diagnostics summary + type declarations + namespace + line count.

USAGE: get_file_overview("path/to/MyClass.cs")

Input parameters:

- `filePath` (string, required): Absolute path to source file

### `roslyn:get_missing_members` (~112 tokens)

Get all interface and abstract members that must be implemented for a type.

USAGE: Position on a class that implements interfaces or extends abstract classes.
OUTPUT: List of missing members with exact signatures ready to copy. Use before implementing interfaces.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number on the type declaration

### `roslyn:get_outgoing_calls` (~113 tokens)

Get all methods and properties that a method calls. Helps understand method dependencies and behavior. Returns list of called symbols with locations. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number inside the method
- `maxDepth` (integer): How deep to trace calls (1 = direct only, default: 1)

### `roslyn:validate_code` (~129 tokens)

Check if code would compile without writing to disk. Use to validate generated code before applying.

USAGE: validate_code(code="public void Foo() {}", contextFilePath="path/to/file.cs") to check with existing usings.
OUTPUT: compiles (bool), errors list with line numbers. Essential before inserting AI-generated code.

Input parameters:

- `code` (string, required): C# code to validate
- `contextFilePath` (string): Optional: file to use for context (usings, namespace)
- `standalone` (boolean): If true, treat code as complete file (default: false)

### `roslyn:check_type_compatibility` (~115 tokens)

Check if one type can be assigned to another. Use before generating assignments or casts.

USAGE: check_type_compatibility(sourceType="MyDerivedClass", targetType="MyBaseClass")
OUTPUT: compatible (bool), requiresCast (bool), conversionKind, and explanation of why/why not.

Input parameters:

- `sourceType` (string, required): The source type name (e.g., 'MyDerivedClass')
- `targetType` (string, required): The target type name (e.g., 'MyBaseClass')

### `roslyn:get_instantiation_options` (~87 tokens)

Get all ways to create an instance of a type: constructors, factory methods, and builder patterns.

USAGE: get_instantiation_options(typeName="HttpClient")
OUTPUT: List of constructors with signatures, static factory methods, and hints (e.g., "implements IDisposable").

Input parameters:

- `typeName` (string, required): The type name to check (e.g., 'HttpClient')

### `roslyn:analyze_change_impact` (~176 tokens)

Analyze what would break if you change a symbol. Identifies breaking changes before you make them.

USAGE: analyze_change_impact(filePath, line, column, changeType="rename|changeType|addParameter|removeParameter")
OUTPUT: List of impacted locations, whether change is safe, and specific issues at each location.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `changeType` (string, required): Type of change: rename, changeType, addParameter, removeParameter, changeAccessibility, delete
- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number of the symbol
- `newValue` (string): Optional: new value for rename/changeType

### `roslyn:get_method_source` (~132 tokens)

Get the actual source code of a method by type and method name. Eliminates need for file Read.

USAGE: get_method_source(typeName="MyService", methodName="ProcessData")
OUTPUT: Full method source including signature, body, location (file + line numbers), and line count.

Input parameters:

- `methodName` (string, required): The method name (e.g., 'ProcessData')
- `overloadIndex` (integer): Which overload to get (0-based, default: 0)
- `typeName` (string, required): The containing type name (e.g., 'MyService', 'MyController')

### `roslyn:get_method_source_batch` (~129 tokens)

Get source code for multiple methods in a single call (batch optimization).

USAGE: get_method_source_batch(methods: [{typeName: 'ServiceA', methodName: 'Process'}, {typeName: 'ServiceB', methodName: 'Handle'}])
OUTPUT: Results array with source for each method, plus errors array for any that failed.
BENEFIT: One call instead of multiple - reduces round trips when tracing code flows.

Input parameters:

- `maxMethods` (integer): Maximum methods to process (default: 20)
- `methods` (array, required): Array of method requests

### `roslyn:generate_constructor` (~149 tokens)

Generate a constructor from fields and/or properties of a type.

USAGE: Position on class/struct declaration. Use includeProperties=true for auto-properties.
OUTPUT: constructorCode string ready to paste, parameter list, and field assignments.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file containing the type
- `includeProperties` (boolean): Include properties with setters (default: false)
- `initializeToDefault` (boolean): Use ?? default for nullable types (default: false)
- `line` (integer, required): Zero-based line number on the type declaration

### `roslyn:change_signature` (~176 tokens)

Change a method signature and preview impact on all call sites.

ACTIONS: add (new param), remove, rename, reorder parameters.
WORKFLOW: (1) Call with preview=true (default) to see affected call sites, (2) Review changes, (3) Call with preview=false to apply.
OUTPUT: oldSignature, newSignature, list of call sites needing updates.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `changes` (array, required): Array of changes to apply
- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file containing the method
- `line` (integer, required): Zero-based line number on the method
- `preview` (boolean): Preview mode (default: true). Set to false to apply changes.

### `roslyn:extract_method` (~194 tokens)

Extract selected statements into a new method. Uses data flow analysis to determine parameters and return type.

USAGE: Specify startLine/endLine range containing complete statements inside a method.
OUTPUT: extractedCode (the new method), replacementCode (the call to insert), detected parameters and return type.
WORKFLOW: (1) Preview with preview=true, (2) Apply with preview=false.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `accessibility` (string): Accessibility: private, public, internal (default: private)
- `endLine` (integer, required): Zero-based end line of selection
- `filePath` (string, required): Absolute path to source file
- `methodName` (string, required): Name for the new method
- `preview` (boolean): Preview mode (default: true). Set to false to apply.
- `startLine` (integer, required): Zero-based start line of selection

### `roslyn:get_code_actions_at_position` (~230 tokens)

Get ALL available code actions (fixes + refactorings) at a position. This is the master tool that exposes 100+ Roslyn refactorings.

USAGE: get_code_actions_at_position(filePath, line, column) or with selection: add endLine, endColumn
OUTPUT: List of actions with title, kind (fix/refactoring), equivalenceKey
WORKFLOW: (1) Call this to see available actions, (2) Use apply_code_action_by_title to apply one
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `endColumn` (integer): Optional: end column for selection
- `endLine` (integer): Optional: end line for selection
- `filePath` (string, required): Absolute path to source file
- `includeCodeFixes` (boolean): Include fixes for diagnostics (default: true)
- `includeRefactorings` (boolean): Include refactorings (default: true)
- `line` (integer, required): Zero-based line number

### `roslyn:apply_code_action_by_title` (~196 tokens)

Apply a code action by its title. Supports exact and partial matching.

USAGE: apply_code_action_by_title(filePath, line, column, title)
OUTPUT: Changed files with preview or applied changes
WORKFLOW: (1) Call get_code_actions_at_position first, (2) Apply with preview=true, (3) Apply with preview=false
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `endColumn` (integer): Optional: end column for selection
- `endLine` (integer): Optional: end line for selection
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number
- `preview` (boolean): Preview mode (default: true). Set to false to apply.
- `title` (string, required): Action title (exact or partial match)

### `roslyn:implement_missing_members` (~114 tokens)

Generate stub implementations for interface/abstract members.

USAGE: Position cursor on class declaration that implements interface or extends abstract class.
OUTPUT: Generated stub code for all missing members.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number on the class declaration
- `preview` (boolean): Preview mode (default: true)

### `roslyn:encapsulate_field` (~108 tokens)

Convert a field to a property with getter/setter.

USAGE: Position cursor on a field declaration.
OUTPUT: Generated property wrapping the field.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number on the field
- `preview` (boolean): Preview mode (default: true)

### `roslyn:inline_variable` (~108 tokens)

Inline a variable, replacing all usages with its value.

USAGE: Position cursor on a variable declaration or usage.
OUTPUT: Variable removed and all usages replaced with the expression.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number
- `preview` (boolean): Preview mode (default: true)

### `roslyn:extract_variable` (~131 tokens)

Extract an expression to a local variable.

USAGE: Position cursor on or select an expression.
OUTPUT: Expression extracted to a new local variable.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `endColumn` (integer): Optional: end column for selection
- `endLine` (integer): Optional: end line for selection
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number
- `preview` (boolean): Preview mode (default: true)

### `roslyn:get_complexity_metrics` (~160 tokens)

Get complexity metrics for a method or entire file.

METRICS: cyclomatic (decision points), nesting (max depth), loc (lines), parameters (count), cognitive (Sonar-style)
USAGE: get_complexity_metrics(filePath) for file, or add line/column for specific method
OUTPUT: Per-method breakdown with all requested metrics
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer): Optional: zero-based column
- `filePath` (string, required): Absolute path to source file
- `line` (integer): Optional: zero-based line for specific method
- `metrics` (array): Optional: specific metrics [cyclomatic, nesting, loc, parameters, cognitive]

### `roslyn:add_null_checks` (~113 tokens)

Add ArgumentNullException.ThrowIfNull guard clauses for nullable parameters.

USAGE: Position cursor on a method with reference type parameters.
OUTPUT: Generated guard clauses inserted at method start.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `line` (integer, required): Zero-based line number on the method
- `preview` (boolean): Preview mode (default: true)

### `roslyn:generate_equality_members` (~136 tokens)

Generate Equals, GetHashCode, and == / != operators for a type.

USAGE: Position cursor on a class or struct declaration.
OUTPUT: Generated equality members comparing all instance fields and properties.
IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input parameters:

- `column` (integer, required): Zero-based column number
- `filePath` (string, required): Absolute path to source file
- `includeOperators` (boolean): Include == and != operators (default: true)
- `line` (integer, required): Zero-based line number on the type
- `preview` (boolean): Preview mode (default: true)

### `roslyn:get_type_members_batch` (~169 tokens)

Get members for multiple types in a single call (batch optimization).

USAGE: get_type_members_batch(typeNames: ['ServiceA', 'ServiceB', 'ControllerC'])
OUTPUT: Results for each type with members, or error if type not found
BENEFIT: One call instead of multiple - reduces context usage for AI agents

Input parameters:

- `includeInherited` (boolean): Include inherited members (default: false)
- `maxResultsPerType` (integer): Max members per type (default: 50)
- `memberKind` (string): Filter: 'Method', 'Property', 'Field', 'Event'
- `typeNames` (array, required): Array of type names to look up
- `verbosity` (string): 'summary', 'compact' (default), or 'full'

### `roslyn:find_attribute_usages` (~144 tokens)

Find all types and members decorated with a specific attribute.

USAGE: find_attribute_usages(attributeName: "Authorize")
USAGE: find_attribute_usages(attributeName: "HttpGet", projectName: "MyApi")

OUTPUT: List of symbols with the attribute, their kind, arguments, and source location.
Use for: finding all API endpoints, authorization points, serialization config, test fixtures.

Input parameters:

- `attributeName` (string, required): Attribute name (e.g. 'Authorize', 'HttpGet', 'Obsolete')
- `maxResults` (integer): Maximum results (default: 100)
- `projectName` (string): Filter to specific project

### `roslyn:get_di_registrations` (~100 tokens)

Scan for dependency injection service registrations (AddScoped, AddTransient, AddSingleton, etc.).

USAGE: get_di_registrations()
USAGE: get_di_registrations(projectName: "MyApi")

OUTPUT: List of DI registrations with lifetime, service type, implementation type, and location.
Use for: understanding service wiring, finding missing registrations, auditing lifetimes.

Input parameters:

- `projectName` (string): Filter to specific project

### `roslyn:find_reflection_usage` (~119 tokens)

Detect dynamic/reflection-based type and method usage that is invisible to static reference searches.

USAGE: find_reflection_usage()
USAGE: find_reflection_usage(projectName: "MyApp", maxResults: 50)

OUTPUT: List of reflection API calls with the API used, context, and location.
Use for: finding hidden dependencies before refactoring, security audits, understanding dynamic behavior.

Input parameters:

- `maxResults` (integer): Maximum results (default: 100)
- `projectName` (string): Filter to specific project

### `roslyn:find_circular_dependencies` (~89 tokens)

Detect cycles in project or namespace dependency graphs.

USAGE: find_circular_dependencies() — project-level cycles
USAGE: find_circular_dependencies(level: "namespace") — namespace-level cycles

OUTPUT: Dependency graph with any detected cycles listed.
Use for: architecture analysis, identifying tightly coupled components.

Input parameters:

- `level` (string): 'project' (default) or 'namespace'

### `roslyn:get_nuget_dependencies` (~89 tokens)

List NuGet package references per project with versions.

USAGE: get_nuget_dependencies()
USAGE: get_nuget_dependencies(projectName: "MyApp")

OUTPUT: List of projects with their NuGet packages, versions, and asset settings.
Use for: dependency audits, version checks, understanding external dependencies.

Input parameters:

- `projectName` (string): Filter to specific project

### `roslyn:get_source_generators` (~81 tokens)

List active source generators and their generated output per project.

USAGE: get_source_generators()
USAGE: get_source_generators(projectName: "MyApp")

OUTPUT: List of generators with their assembly info and generated files.
Use for: understanding generated code, debugging generator issues.

Input parameters:

- `projectName` (string): Filter to specific project

### `roslyn:get_generated_code` (~93 tokens)

View the source code produced by a source generator.

USAGE: get_generated_code(projectName: "MyApp", generatedFileName: "MyType.g.cs")

OUTPUT: Full source code of the generated file.
Use get_source_generators first to discover available generated files.

Input parameters:

- `generatedFileName` (string, required): Name of the generated file
- `projectName` (string, required): Project containing the generated file

### `roslyn:get_project_health` (~115 tokens)

Composite audit dashboard for one project: aggregates diagnostics (with analyzers), unused code, god-object candidates, and untested public surface. Returns counts + top-N hotspots per dimension. One call replaces 4+ separate tool calls for a project audit overview.

Input parameters:

- `includeAnalyzers` (boolean): Run configured DiagnosticAnalyzers in addition to compiler diagnostics (default: true).
- `projectName` (string, required): Project to audit. Required.
- `topN` (integer): Hotspots per dimension (default: 5).

### `roslyn:find_god_objects` (~188 tokens)

Detect over-coupled types ('god objects'). For each type computes efferent coupling (distinct types it depends on), afferent coupling (distinct types that depend on it), and member count; reports types meeting both threshold filters, scored as efferent*0.4 + members*0.4 + afferent*0.2. AUDIT-TIME tool — O(types*references); don't call in tight agent loops.

Input parameters:

- `maxResults` (integer): Cap on candidates returned (default: 20). totalCount reflects unbounded match count.
- `minEfferentCoupling` (integer): Minimum outbound type dependencies to qualify (default: 20)
- `minMembers` (integer): Minimum member count to qualify (default: 20)
- `projectName` (string): Limit scan to one project (default: scan all projects)

### `roslyn:find_untested_code` (~154 tokens)

Find public/internal surface in a project that no test method (xUnit [Fact]/[Theory], NUnit [Test]/[TestCase], MSTest [TestMethod]) transitively reaches. Sorted by cyclomatic complexity so the riskiest untested code is reported first. Audit-time tool; runs solution-wide BFS.

Input parameters:

- `includeInternal` (boolean): Include internal members (default: false; only public)
- `includeProperties` (boolean): Include properties (default: true)
- `maxResults` (integer): Cap on reported items (default: 50). totalCount reflects the true unbounded count.
- `projectName` (string): Project to audit (default: first project in solution)

### `roslyn:get_call_graph` (~203 tokens)

Multi-hop transitive call graph (callers, callees, or both) from a method. Replaces N round-trips of find_callers/get_outgoing_calls when tracing impact or understanding a subsystem. Returns nodes + edges (not a nested tree, to handle diamond shapes), with cycle detection and a mandatory maxDepth bound. IMPORTANT: Uses ZERO-BASED coordinates.

Input parameters:

- `column` (integer, required): Zero-based column
- `direction` (string): 'callees' (default), 'callers', or 'both'
- `filePath` (string, required): File containing the root method
- `line` (integer, required): Zero-based line of the method declaration or invocation
- `maxDepth` (integer): Max BFS depth, 1-10 (default: 3). Required bound; depths above 10 explode on connected graphs.
- `maxNodes` (integer): Max total nodes (default: 100). Sets truncatedByNodes when hit.

### `roslyn:get_external_type_info` (~182 tokens)

Inspect types from external assemblies (NuGet packages, BCL, closed-source) the solution references. Returns members, signatures, and XML docs for types whose source isn't in the solution. Eliminates the need for agents to guess at dependency APIs.

Input parameters:

- `assemblyName` (string): Optional: restrict resolution to a specific assembly when the type name is ambiguous.
- `includeInherited` (boolean): Include members from base types (default: true). Stops before System.Object.
- `includeXmlDocs` (boolean): Include XML doc summaries when available (default: true).
- `maxMembers` (integer): Cap on member entries (default: 200). totalCount reflects the unbounded member count.
- `typeName` (string, required): Fully-qualified type name. Use backtick-arity for generics, e.g. 'System.Collections.Generic.List`1'.

## Diagnostics

Captured diagnostic sections: Provenance, Dependencies. The full working is on the page: https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp#diagnostics

## Score history

- 2026-08-03: 39
- 2026-08-02: 39
- 2026-08-01: 24
- 2026-07-31: 24
- 2026-07-30: 29
- 2026-07-28: 47
- 2026-07-27: 47
- 2026-07-26: 47

## Links

- NuGet package: https://www.nuget.org/packages/SharpLensMcp
- Socket report: https://socket.dev/nuget/package/SharpLensMcp
- Repository: https://github.com/pzalutski-pixel/sharplens-mcp
- Changelog RSS feed: https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp/changelog.xml
- Changelog JSON feed: https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp/changelog.json
- HTML version of this page: https://verifymcp.io/servers/pzalutski-pixel-sharplens/sharplensmcp
