SharpLens MCP server
67 semantic C#/.NET analysis tools via Roslyn: navigation, refactoring, codegen, audit.
35 stars100 downloads/wk
Reviews
Write oneNobody has reviewed SharpLens yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
SharpLens tools
No tool declarations could be read from the package source. They show once the server is installed.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan2 source files scanned13/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 42 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Findings (1)
- highShell command built from a string (injection risk)
exec.shell-concatbin/sharplens-mcp.js: …${version} is installed...\n`); try { execSync( `dotnet tool update --global SharpLensMcp --version ${version}`, { stdio: ["ignore", "igno…
How SharpLens compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 69/100
- higher than 33% of 48,273 servers
- GitHub stars
- 35
- more than 92% of 28,534 servers
- Downloads a week
- 100
- more than 64% of 11,915 servers with a package
Install SharpLens in Claude Code, Cursor or VS Code
Runs npx -y sharplens-mcp on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add sharplens -- npx -y sharplens-mcp
What the publisher says
From the SharpLens repository's README, as published. We do not edit it. Read it on GitHub
SharpLensMcp
A Model Context Protocol (MCP) server providing 92 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn.
Built for AI coding agents - provides compiler-accurate code understanding that AI cannot infer from reading source files alone.
Installation
Via NuGet (Recommended)
dotnet tool install -g SharpLensMcpThen run with:
sharplensVia npm
npx -y sharplens-mcpBuild from Source
dotnet build -c Release
dotnet publish -c Release -o ./publishClaude Code Setup
- Install the tool (pick one):
dotnet tool install -g SharpLensMcp
# or
npx -y sharplens-mcp- Create .mcp.json in your project root:
{
"mcpServers": {
"sharplens": {
"type": "stdio",
"command": "npx",
"args": ["-y", "sharplens-mcp"],
"env": {
"DOTNET_SOLUTION_PATH": "/path/to/your/Solution.sln (or .slnx)"
}
}
}
}- Restart Claude Code to load the MCP server
- Verify by asking Claude to run a health check on the Roslyn server
Why Use This with Claude Code?
Claude Code has native LSP support for basic navigation (go-to-definition, find references). SharpLensMcp adds deep semantic analysis:
Configuration
The pre-1.6.0 ROSLYN spellings of the last four variables are still read as a fallback for one release; the SHARPLENS spelling wins when both are set.
If DOTNETSOLUTIONPATH is not set, you must call the load_solution tool before using other tools.
Migrating from 1.5.x tool names
Tool names no longer carry the roslyn: prefix — the colon violates the MCP tool-name pattern (^[a-zA-Z0-9_-]{1,64}$), which some clients enforce. Every tool keeps its name minus the prefix:
tools/list publishes only the new names. Calls using the old prefixed names are still accepted as aliases for one release and will be removed in the following one.
AI Agent Configuration Tips
AI models may have trained bias toward using their native tools (Grep, Read, LSP) instead of MCP server tools, even when SharpLensMcp provides better capabilities.
To ensure optimal tool usage:
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
SharpLens: common questions
- Is SharpLens MCP server safe?
- With care: it is graded C, so read the findings first (69/100). Read the SharpLens safety report
- How do I install SharpLens?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does SharpLens need an API key?
- No secret keys are declared. It reads 6 settings from the environment.
- Is SharpLens maintained?
- The last commit was 78 days ago (2026-08-16). The latest release is v1.5.3.
- What can I use instead of SharpLens?
- Servers from other publishers that do the same job: Sem MCP server.
- How does SharpLens compare with other MCP servers?
- safety score 69/100 (higher than 33% of 48,273 servers); github stars 35 (more than 92% of 28,534 servers); downloads a week 100 (more than 64% of 11,915 servers with a package). Full comparison.
Alternatives to SharpLens
Same job from other publishers: the closest match first, then the best rated.
- SemEntity-level code intelligence: semantic diff, impact analysis, blame, and context for AI agentsnot reviewedWidely usedB