SharpLens MCP
SharpLens is a Model Context Protocol server providing 92 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn. It enables AI coding agents to perform compiler-accurate code understanding, including finding async methods missing CancellationToken, impact analysis, dead code detection, complexity metrics, and safe refactoring with preview.
Package and access
Local package with source-attributed installation metadata. Koskamo does not execute packages during review.
What you can do with it
- Perform deep semantic analysis of C# codebases
- Detect dead code and complexity metrics
- Execute safe refactoring with preview
- Find async methods missing CancellationToken
Source and maintenance
- Maintenance checked
Packages and installation
Source-provided package data. Koskamo has not executed or live-probed this package.
sharplens-mcp 1.5.3
{
"version": "1.5.3",
"transport": "stdio",
"identifier": "sharplens-mcp",
"runtimeHint": "npx",
"registryType": "npm",
"environmentVariables": [
{
"name": "DOTNET_SOLUTION_PATH",
"format": "string",
"description": "Path to .sln or .slnx file to auto-load on startup"
},
{
"name": "ROSLYN_LOG_LEVEL",
"format": "string",
"default": "Information",
"description": "Logging verbosity: Trace, Debug, Information, Warning, Error"
},
{
"name": "ROSLYN_TIMEOUT_SECONDS",
"format": "number",
"default": "30",
"description": "Timeout for long-running operations"
}
]
}Tools
Reported by the attributed source; not independently observed by Koskamo.
Connect from your client
Each snippet configures the same source-provided package; replace placeholders before use.
Cursor
{
"mcpServers": {
"sharplens-mcp": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp@1.5.3"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Cline
{
"mcpServers": {
"sharplens-mcp": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp@1.5.3"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}VS Code
{
"servers": {
"sharplens-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sharplens-mcp@1.5.3"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Claude Desktop
{
"mcpServers": {
"sharplens-mcp": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp@1.5.3"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Let your agent find its tools
Find servers like SharpLens MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.