claude mcp add sharplens-mcp -- npx -y sharplens-mcp
A pasteable skeleton generated from the repository name. Check the project README for the exact package and arguments.
Star count
37 โ ยท pzalutski-pixel/sharplens-mcp ยท read from the GitHub search API ยท (checked 2026-10-16 20:00:20)
Source
collected from the punkpeye/awesome-mcp-servers list ยท type: MCP server
Harvest history
first seen 2026-10-09 ยท last seen 2026-10-16 ยท seen 32ร ยท listed by 7 sources
Score
score 703 ยท 37 โ ยท 7 sources ยท mcp
FAQ (answers come from our records)
How do I install it?
We did not find an install command for this repository (our install coverage is only about 4%). Check its README or releases page.
Who is it for?
We filed it under these tags: MCP ๆๅก. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository pzalutski-pixel/sharplens-mcp๏ผfirst catalogued 2026-10-09๏ผlast seen 2026-10-16ใThere is no official certification or quality rating here โ we record sources and dates only.
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) Then run with: Via npm Build from Source Claude Code Setup 1. **Install the tool** (pick one): 2. **Create .mcp.json in your project root**: 3. **Restart Claude Code** to load the MCP server 4. **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**: | Capability | Native LSP | SharpLensMcp | |------------|------------|--------------| | Go to definition | โ | โ | | Find references | โ | โ | | Find async methods missing CancellationToken | โ | โ | | Impact analysis (what breaks?) | โ | โ | | Dead code detection | โ | โ | | Complexity metrics | โ | โ | | Safe refactoring with preview | โ | โ | | Batch operations | โ | โ | Configuration | Environment Variable | Description | Default | |---------------------|-------------|---------| | DOTNET_SOLUTION_PATH | Path to .sln or .slnx file to auto-load on startup | None (must call load_solution) | | SHARPLENS_ABSOLUTE_PATHS | Use absolute paths instead of relative | false (relative paths save tokens) | | SHARPLENS_LOG_LEVEL | Logging verbosity: Trace, Debug, Information, Warning, Error | Information | | SHARPLENS_TIMEOUT_SECONDS | Timeout for long-running operations | 30 | | SHARPLENS_MAX_DIAGNOSTICS | Maximum diagnostics to return | 100 | | SHARPLENS_ENABLE_SEMANTIC_CACHE | Enable semantic model caching | true (set to false to disable) | 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 DOTNET_SOLUTION_PATH 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: | 1.5.x name | 1.6.0 name | |------------|------------| | roslyn:load_solution | load_solution | | roslyn:get_diagnostics | get_diagnostics | | roslyn:rename_symbol | rename_symbol | | ...same rule for all tools... | drop the roslyn: 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:** 1. **Claude Code**: Add to your project's CLAUDE.md: 2. **Other MCP clients**: Configure tool priority in your agent's system prompt The semantic analysis from Roslyn is more accurate than text-based search, especially for overloaded methods, partial classes, and inheritance hierarchies. Agent Responsibility: Document Synchronization **Important:** SharpLensMcp maintains an in-memory representation of your solution for fast queries. When files are modified externally (via Edit/Write tools), the agent is responsible for synchronizing changes. When to call sync_documents: | Action | Call sync_documents? | |--------|---------------------| | Used Edit tool to modify .cs files | โ **Yes** | | Used Write tool to create new .cs files | โ **Yes** | | Deleted .cs files | โ **Yes** | | Used SharpLensMcp refactoring tools (rename, extract, etc.) | โ No (auto-updated) | | Modified .csproj files | โ No (use load_solution instead) | Usage: Why this design? This mirrors how LSP (Language Server Protocol) works - the client (editor) notifies the server of changes. This approach: - Eliminates race conditions (agent controls timing) - Avoids file watcher complexity and platform quirks