What is the SharpLens MCP server?
67 semantic C#/.NET analysis tools via Roslyn: navigation, refactoring, codegen, audit.
How to install SharpLens
Copy-paste configuration for popular MCP clients.
transport: stdio
Config generated by PluginBench — verify against the source before use.Environment / auth
DOTNET_SOLUTION_PATHPath to .sln or .slnx file to auto-load on startup
ROSLYN_LOG_LEVELLogging verbosity: Trace, Debug, Information, Warning, Error
ROSLYN_TIMEOUT_SECONDSTimeout for long-running operations
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"sharplens": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"sharplens": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Windsurf
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"sharplens": {
"command": "npx",
"args": [
"-y",
"sharplens-mcp"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}VS Code
.vscode/mcp.json
{
"servers": {
"sharplens": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"sharplens-mcp"
],
"env": {
"DOTNET_SOLUTION_PATH": "<YOUR_DOTNET_SOLUTION_PATH>",
"ROSLYN_LOG_LEVEL": "<YOUR_ROSLYN_LOG_LEVEL>",
"ROSLYN_TIMEOUT_SECONDS": "<YOUR_ROSLYN_TIMEOUT_SECONDS>"
}
}
}
}Claude Code
claude mcp add sharplens --env DOTNET_SOLUTION_PATH=<YOUR_DOTNET_SOLUTION_PATH> --env ROSLYN_LOG_LEVEL=<YOUR_ROSLYN_LOG_LEVEL> --env ROSLYN_TIMEOUT_SECONDS=<YOUR_ROSLYN_TIMEOUT_SECONDS> -- npx -y sharplens-mcpRelated MCP servers
15 semantic GDScript analysis tools via Godot's built-in LSP: navigation, references, rename.
View repository →63 semantic Java analysis tools via Eclipse JDT: navigation, refactoring, code intelligence.
View repository →