pzalutski-pixel/sharplens-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
AI 구동을 위한 Roslyn-powered MCP 서버 C# semantic 분석, 재구성 및 코드 생성
개요
.NET/C# semantic 부호 분석, 항법, refactoring 및 Microsoft Roslyn를 사용하여 코드 생성을 제공하는 모형 Context 의정서 (MCP) 서버. AI 코딩 에이전트를 위해 내장 - AI가 읽기 소스 파일에서 삽입 할 수없는 컴파일러-accurate 코드 이해를 제공합니다. 4. Claude를 요청하여 Roslyn 서버에 건강 검사를 실행하십시오. Claude Code에는 기본 네비게이션(go-to-definition)에 대한 기본 LSP 지원이 있습니다. SharpLensMcp는 추가합니다: 마지막 4개의 변수의 pre-1.6.0 ROSLYN * 맞춤법은 여전히 하나의 릴리스에 대한 fallback으로 읽습니다. SHARPLENS * 맞춤법은 둘 다 설정할 때 승리합니다. DOTNET SOLUTION PATH가 설정되지 않으면 다른 도구를 사용하기 전에 load solution 도구를 호출해야합니다. 도구 이름은 더 이상 roslyn을 수행하지 않습니다 : 접두사 - 식민지는 MCP 도구 이름 패턴을 위반 (^[a-zA-Z0-9 -]{1,64}$), 어떤 클라이언트의 집행. 모든 도구는 이름을 minus the prefix: 도구 / 목록은 새 이름 만 게시합니다.
개요(AI 번역)
Model Context Protocol (MCP) 서버 제공 92 AI 최적화 도구 .NET/C# semantic 코드 분석, 탐색, 복원 및 Microsoft Roslyn을 사용하여 코드 생성.
AI 코딩 에이전트를 위해 내장 - AI가 읽기 소스 파일에서 삽입 할 수없는 컴파일러-accurate 코드 이해를 제공합니다.
설치
비아 NuGet (추천)
그런 다음:
npm을 통해
소스에서 빌드
Claude 코드 설정
-
공구(pick one):
-
** 프로젝트 루트에서
.mcp.json를 선택하십시오 **: -
**Restart Claude Code ** MCP 서버로드
-
Verify Claude를 요청하여 Roslyn 서버에서 건강 검사를 실행하십시오.
왜 Claude 코드로 이것을 사용합니까?
Claude Code에는 기본 네비게이션(go-to-definition)에 대한 기본 LSP 지원이 있습니다. SharpLensMcp addsdeep semantic 분석:
| 기능 | 네이티브 LSP | 샤프런스Mcp |
|---|---|---|
| 이미지 | ✅ | |
| 자주 묻는 질문 | ✅ | |
| 자주 묻는 질문 토큰 | ❌ | ✅ |
| 충격 분석(무엇이?) | ❌ | ✅ |
| 데드코드 탐지 | ❌ | ✅ |
| 복합 미터 | ❌ | ✅ |
| 인포메이션 | ❌ | ✅ |
| 배치 운영 | ❌ | ✅ |
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
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 SharpLensMcp
Then run with:
sharplens
Via npm
npx -y sharplens-mcp
Build from Source
dotnet build -c Release
dotnet publish -c Release -o ./publish
Claude Code Setup
- Install the tool (pick one):
dotnet tool install -g SharpLensMcp
# or
npx -y sharplens-mcp
- Create
.mcp.jsonin 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:
| 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 a .sln, .slnx or .slnf file (or a directory holding exactly one) to auto-load on startup; the load runs beside the request loop, so initialize answers immediately |
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 |
Cache the file-path to document lookup | true (set to false to disable) |
설치
npx -y sharplens-mcp설정
{
"mcpServers": {
"sharplens": {
"type": "stdio",
"command": "npx",
"args": ["-y", "sharplens-mcp"],
"env": {
"DOTNET_SOLUTION_PATH": "/path/to/your/Solution.sln (or .slnx)"
}
}
}
}