Sharplens MCP logo

Sharplens MCP

by pzalutski-pixel

Analyzes C# and .NET solutions with Roslyn for semantic navigation, diagnostics, impact analysis, and refactoring workflows.

Install Sharplens MCP

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

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "pzalutski-pixel-sharplens-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sharplens-mcp"
      ],
      "env": {
        "DOTNET_SOLUTION_PATH": "YOUR_VALUE_HERE",
        "SHARPLENS_ABSOLUTE_PATHS": "YOUR_VALUE_HERE",
        "SHARPLENS_LOG_LEVEL": "YOUR_VALUE_HERE",
        "SHARPLENS_TIMEOUT_SECONDS": "YOUR_VALUE_HERE",
        "SHARPLENS_MAX_DIAGNOSTICS": "YOUR_VALUE_HERE",
        "SHARPLENS_ENABLE_SEMANTIC_CACHE": "YOUR_VALUE_HERE"
      }
    }
  }
}

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

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y sharplens-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 1mo ago.

Overview

Semantic C#/.NET analysis through the pzalutski-pixel/sharplens-mcp MCP server uses Microsoft Roslyn to expose navigation, code intelligence, diagnostics, and refactoring tools. It loads a .sln or .slnx solution and answers structured queries about symbols, references, inheritance, call paths, control flow, and API changes. Reach for it when text search or basic language-server navigation is insufficient, especially for overloaded methods, partial classes, dependency impact, or compiler-accurate analysis. The server runs locally over stdio through either the SharpLensMcp .NET tool or the sharplens-mcp npm package.

Use cases

  • Navigate overloaded C# methods and inheritance hierarchies
  • Trace callers, callees, and multi-hop impact paths
  • Review compiler and analyzer diagnostics before CI
  • Detect dead code and unreachable branches
  • Compare public API changes against a Git reference

Key features

  • Roslyn-based semantic C# and .NET analysis
  • Symbol navigation and reference classification
  • Call graphs, reachability, and change-impact analysis
  • Compiler and analyzer diagnostics
  • Batch lookups and refactoring previews
  • External assembly and XML documentation inspection

Tools80

What Sharplens MCP lets your agent do. Expand a tool for its parameters.

Self-reported~1.2k tokens of context

Security & health

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

ActiveLast checked Today

Recent health check succeeded.

18/19 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · sharplens-mcp (npm)

Adoption & maintenance

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

GitHub stars38Stargazers on the source repository.
npm downloads496Package downloads in the last 30 days.
Last commit10d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed80Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Sharplens MCP works

What pzalutski-pixel/sharplens-mcp MCP server does

The pzalutski-pixel/sharplens-mcp MCP server gives coding agents semantic access to C# and .NET solutions through Microsoft Roslyn. Rather than treating source files as plain text, it resolves symbols, types, members, overloads, inheritance, attributes, and external assembly information using the compiler’s model.

Its tool set covers navigation, discovery, diagnostics, code-quality analysis, impact assessment, and refactoring support. Examples include locating definitions and references, finding callers and implementations, constructing bounded call graphs, comparing a public API with a Git reference, tracing exception flow, identifying dead branches, and resolving pasted stack traces to source locations. Several operations support batches or preview-style generation so an agent can inspect proposed changes before applying them.

How it works

The server maintains an in-memory representation of the loaded solution for responsive queries. Set DOTNET_SOLUTION_PATH to load a .sln or .slnx file at startup, or call load_solution before using analysis tools. Responses use a structured success/error/data shape and can include suggested follow-up tools. Coordinates are zero-based.

Roslyn-based resolution is useful for cases where textual matching is ambiguous, such as overloaded methods, partial types, inheritance, dispatch, or read/write reference classification. The server can also inspect NuGet, BCL, and other external assembly types when the solution provides the relevant references.

Setup and configuration

Install the pzalutski-pixel/sharplens-mcp MCP server with the SharpLensMcp global .NET tool or run the npm package with npx -y sharplens-mcp. A stdio client configuration can invoke the npm package and pass DOTNET_SOLUTION_PATH in its environment. The README specifically documents Claude Code setup through a project .mcp.json file.

Supported configuration variables are:

  • DOTNET_SOLUTION_PATH: startup solution path; if absent, use load_solution.
  • SHARPLENS_ABSOLUTE_PATHS: return absolute rather than relative paths.
  • SHARPLENS_LOG_LEVEL: set logging verbosity.
  • SHARPLENS_TIMEOUT_SECONDS: set the long-operation timeout.
  • SHARPLENS_MAX_DIAGNOSTICS: limit returned diagnostics.
  • SHARPLENS_ENABLE_SEMANTIC_CACHE: enable or disable semantic caching.

Tools and capabilities

The pzalutski-pixel/sharplens-mcp MCP server exposes tools for:

  • Symbol lookup, definitions, references, implementations, callers, call graphs, and paths between methods.
  • Type hierarchies, derived and base types, members, overloads, attributes, documentation, extension methods, and super methods.
  • Compiler and analyzer diagnostics, API compatibility checks, data-flow and control-flow analysis, exception flow, and change-impact analysis.
  • Similar-code detection, dead-code and unreachable-branch analysis, stack-trace resolution, and external type inspection.
  • Refactoring and generation workflows, including safe previews and batch operations, where provided by the server.

Limitations and notes

The in-memory model can become stale after files are changed by external editor or file tools. Call sync_documents for modified, created, or deleted C# files. Changes made through the server’s own refactoring tools are updated automatically; project-file changes require load_solution instead.

If no startup solution path is configured, analysis cannot begin until load_solution has been called.

Reviews

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

Frequently Asked Questions about Sharplens MCP

Install the SharpLensMcp global .NET tool with `dotnet tool install -g SharpLensMcp`, or run `npx -y sharplens-mcp`.

Set `DOTNET_SOLUTION_PATH` to a `.sln` or `.slnx` file. If it is not set, call the `load_solution` tool before other tools.

The server keeps an in-memory solution model. After external edits, creation, or deletion of C# files, call `sync_documents` with the affected paths or without paths for a bulk synchronization.

Yes.

Related MCP servers

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

AllMCPs Directory Badge

Full Badge Customizer

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

Badge Style:
Live Dynamic SVG PreviewSharplens MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pzalutski-pixel-sharplens-mcp?style=directory)](https://allmcps.com/mcp/pzalutski-pixel-sharplens-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/pzalutski-pixel-sharplens-mcp"><img src="https://allmcps.com/api/badge/pzalutski-pixel-sharplens-mcp?style=directory" alt="Sharplens MCP on AllMCPs" /></a>