npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sharplens-mcp

v1.6.0

Published

MCP server providing 91 AI-optimized tools for .NET/C# semantic code analysis using Roslyn.

Readme

sharplens-mcp

NuGet npm License: MIT

An MCP server providing 91 semantic analysis tools for .NET/C#, built on Microsoft Roslyn for compiler-accurate code understanding.

Requirements

  • .NET 8.0 SDK or later — works with .NET 8, 9, 10, and future versions. Analyzes any .NET 8+ project/solution.

Quick Start

{
  "mcpServers": {
    "sharplens": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "sharplens-mcp"],
      "env": {
        "DOTNET_SOLUTION_PATH": "/path/to/your/Solution.sln"
      }
    }
  }
}

What This Package Does

This npm package is a thin wrapper around the SharpLensMcp .NET global tool. It:

  1. Checks that the .NET SDK is installed
  2. Installs or updates the SharpLensMcp .NET tool to the exact version matching this npm package
  3. Launches sharplens and pipes stdin/stdout for MCP protocol communication

The npm package version and .NET tool version are always kept in sync.

Why SharpLens?

AI systems need compiler-accurate insights that reading source files cannot provide. When an AI uses grep to find usages of a method, it cannot distinguish overloaded methods, partial classes, or interface implementations.

| Approach | Result | |----------|--------| | grep "Save(" | 34 matches including SaveAsync(), SaveButton, XML comments | | find_references | Exactly 8 calls to UserService.Save() |

Features

Navigation & Discovery (23 tools)

Symbol info, go to definition, find references (reports read/write/invocation/cast/typeof/nameof/attribute kind with optional server-side filter), find implementations, find callers, multi-hop call graph with depth bound + cycle detection, type hierarchy, symbol search (glob or fuzzy camel-hump matching), semantic query, type members, batch type members, method signatures, derived types, base types, attributes, containing member, method overloads, attribute usage search, external type inspection (NuGet/BCL/closed-source assemblies with members + XML doc summaries), stack-trace resolution (map a .NET trace to source with compiler mangling undone), applicable extension methods (classic this-parameter and C# 14 extension blocks), symbol documentation with <inheritdoc> resolved recursively, and super-method navigation (jump to the overridden or implemented member).

Analysis (17 tools)

Diagnostics (runs configured DiagnosticAnalyzers — StyleCop, Roslynator, NetAnalyzers, custom — by default; matches CI output), API-surface diff against a git ref, exception-flow analysis (which exceptions can escape a method and where each is caught), structural similar-code search, remove-unused-code computation (generation-only), dead-branch detection (unreachable code from the real control-flow graph), add-missing-imports computation (compiler-accurate), data flow analysis, control flow analysis, change impact analysis, type compatibility, outgoing calls, unused code detection, code validation, complexity metrics, circular dependency detection, and missing members.

Refactoring (16 tools)

Rename, change signature (fully applies declaration + every call site across Foo(...) / new Foo(...) / : this(...) / : base(...) / new(...)), extract method, extract interface, generate constructor, move type to file, split type into a new partial, organize usings, batch organize, batch format, code actions, apply code action by title, implement missing members, encapsulate field, inline variable, and extract variable. Refactoring tools also accept typeName/memberName name-based addressing as an alternative to zero-based coordinates.

Code Generation (3 tools)

Null check generation, equality member generation, test-stub generation (test framework auto-detected from the solution).

Compound Tools (7 tools)

Type overview, method analysis, file overview, method source, batch method source, instantiation options, project health audit (composite dashboard: diagnostics + unused + coupling + coverage in one call) — combining multiple queries to reduce round-trips.

Audit & Quality (10 tools)

Detect god-objects via efferent + afferent coupling + member-count thresholds (audit-time scoring). Find untested code — public/internal surface not transitively reachable from any [Fact]/[Theory]/[Test]/[TestMethod], sorted by cyclomatic complexity so the riskiest gaps surface first. Find tests that cover a symbol. Fine-grained type-usage searches — type instantiations, pattern usages (is/as/patterns), throw sites, and catch blocks for a type. Find async issues (async void, blocking-on-async, unforwarded CancellationToken). Check architecture — enforce dependency rules over the real type-dependency graph. Find naming violations honoring the solution's .editorconfig, with conventional defaults.

Discovery (3 tools)

DI registration scanning, reflection usage detection, and interceptor discovery ([InterceptsLocation] call rerouting, generated code included).

Infrastructure (12 tools)

Health check, unused dependency detection (PackageReference/ProjectReference the compiler never needs), fix-all for a diagnostic across a file, project, or solution, solution loading, document synchronization, project structure, dependency graph, code fixes, apply code fix, NuGet dependency listing, source generator inspection, and generated code viewer.

Configuration

| Environment Variable | Description | Default | |---------------------|-------------|---------| | DOTNET_SOLUTION_PATH | Auto-load .sln or .slnx on startup | (none) | | SHARPLENS_LOG_LEVEL | Trace/Debug/Information/Warning/Error | Information | | SHARPLENS_TIMEOUT_SECONDS | Operation timeout | 30 | | SHARPLENS_MAX_DIAGNOSTICS | Maximum diagnostics to return | 100 | | SHARPLENS_ENABLE_SEMANTIC_CACHE | Enable semantic model caching | true | | SHARPLENS_ABSOLUTE_PATHS | Use absolute paths instead of relative | false |

The legacy ROSLYN_* spellings (e.g. ROSLYN_LOG_LEVEL) remain accepted as a one-release migration fallback.

Uninstall

If installed globally: npm uninstall -g sharplens-mcp (automatically removes the .NET tool)

If used via npx: dotnet tool uninstall --global SharpLensMcp

Documentation

Full documentation, tool reference, and architecture details: GitHub