Skip to main content
Glama
jcucci

dotnet-sherlock-mcp

.NET용 Sherlock MCP

.NET용 Sherlock MCP는 .NET 어셈블리에 대한 심층적인 인트로스펙션(introspection) 기능을 제공하는 포괄적인 MCP(Model Context Protocol) 서버입니다. 이 서버를 통해 LLM(거대 언어 모델)은 .NET 코드를 정밀하게 분석하고 이해하여, 복잡한 개발 시나리오에 대해 정확하고 문맥을 파악한 응답을 제공할 수 있습니다.

이 도구는 다음과 같은 LLM 기능을 활용하려는 개발자에게 필수적입니다:

  • 심층 코드베이스 분석 - 복잡한 .NET 아키텍처 및 종속성 이해

  • 정밀한 타입 정보 - 타입, 멤버 및 해당 시그니처에 대한 상세 메타데이터 획득

  • 자동화된 문서화 - XML 문서 및 속성 추출 및 활용

  • 커스텀 도구 제작 - .NET 어셈블리와 상호작용하는 정교한 도구 구축

  • 코드 생성 - 기존 타입 구조를 기반으로 정확한 코드 생성

주요 기능

  • 포괄적인 MCP 서버: .NET 어셈블리 분석을 위한 31개 이상의 특화 도구 제공

  • 고급 어셈블리 인트로스펙션: 타입, 멤버 및 메타데이터에 대한 심층적인 리플렉션 기반 분석

  • 풍부한 멤버 분석: 메서드, 속성, 필드, 이벤트 및 생성자에 대한 상세 검사

  • 스마트 필터링 및 페이징: 대규모 데이터셋을 위한 효율적인 페이징과 이름/속성별 고급 필터링

  • XML 문서 통합: 요약, 매개변수, 반환값 및 비고 자동 추출

  • 성능 최적화: 캐싱, 스트리밍 및 메모리 효율적인 처리

  • 안정적인 JSON API: 버전 관리 및 구조화된 오류 코드가 포함된 일관된 엔벨로프

  • .NET 9.0 네이티브: 최신 C# 기능을 갖춘 최신 .NET 플랫폼 기반

  • 프로젝트 통합: 종속성 해결을 포함한 솔루션 및 프로젝트 파일 분석

설치

NuGet에서 글로벌 도구를 설치합니다 (sherlock-mcp를 PATH에 추가):

dotnet tool install -g Sherlock.MCP.Server

또는 개발 중에 서버를 로컬에서 실행할 수 있습니다:

dotnet run --project src/server/Sherlock.MCP.Server.csproj

MCP 클라이언트 구성

Sherlock은 stdio를 통해 통신하는 표준 MCP 서버로 실행됩니다.

  • Cursor: 설정 → MCP / 커스텀 도구 → 도구 추가 → 명령: sherlock-mcp

  • Claude Desktop / 기타 MCP 클라이언트: sherlock-mcp 명령을 가리키는 서버 항목을 추가합니다. 예시 JSON 항목 (정확한 파일 위치/형식은 클라이언트 문서를 참조하세요):

{
  "servers": {
    "sherlock": {
      "command": "sherlock-mcp"
    }
  }
}

인수는 필요하지 않습니다. 서버는 시작 시 모든 도구를 자체 등록합니다.

.NET 프로젝트 자동 구성

.NET 코드로 작업할 때 Sherlock을 자동으로 사용하려면 다음 구성을 추가하세요:

Claude Code (CLAUDE.md)

프로젝트의 CLAUDE.md 파일에 다음을 추가하세요:

## .NET Assembly Analysis

This project uses Sherlock MCP for .NET assembly analysis. When analyzing .NET types, methods, or assemblies:

1. Use sherlock-mcp tools instead of guessing about .NET APIs
2. For type analysis: `GetTypeInfo`, `GetTypeMethods`, `GetTypeProperties`
3. For assembly overview: `AnalyzeAssembly` or `GetTypesFromAssembly`
4. For project structure: `AnalyzeProject`, `AnalyzeSolution`
5. Assembly paths are typically: `./bin/Debug/net9.0/ProjectName.dll`

Always include assembly path, prefer full type names, and use pagination for large results.

Cursor (.cursorrules)

프로젝트의 .cursorrules 파일에 다음을 추가하세요:

# .NET Analysis Rules
When working with .NET code, assemblies, or types:
- Use sherlock-mcp tools for accurate type/member information
- Assembly paths: ./bin/Debug/net9.0/*.dll or ./bin/Release/net9.0/*.dll
- For unknown types: GetTypesFromAssembly -> GetTypeInfo -> GetTypeMethods/Properties
- For code analysis: AnalyzeAssembly for overview, GetTypeInfo for details
- Use pagination (maxItems=50) for large results to avoid token limits

전역 구성

시스템 전체에서 사용하려면 전역 Claude Code 설정 또는 Cursor 구성에 추가하세요:

For .NET development: Use sherlock-mcp tools when analyzing assemblies, types, methods, or project structure. Prefer these over guessing .NET API details.

프롬프트 사용 방법

아래는 빠르게 생산성을 높이기 위해 채팅에 붙여넣을 수 있는 간결한 프롬프트 스니펫입니다. 경로를 로컬 DLL에 맞게 조정하세요.

일반 설정

You have access to an MCP server named "sherlock" that can analyze .NET assemblies. Prefer these tools for .NET questions and include short reasoning for which tool you chose. Ask me for the assembly path if missing.

타입의 멤버 열거

Analyze: /absolute/path/to/MyLib/bin/Debug/net9.0/MyLib.dll
Type: MyNamespace.MyType
List methods, including non-public, filter name contains "Async", include attributes, return JSON.

멤버에 대한 XML 문서 가져오기

Use GetXmlDocsForMember on /abs/path/MyLib.dll, type MyNamespace.MyType, member TryParse. Summarize the summary + params.

타입 찾기 및 상세 분석

List types from /abs/path/MyLib.dll; then get type info for the first result and list its nested types.

페이징 및 필터 조정

Use GetTypeMethods on /abs/path/MyLib.dll, type MyNamespace.MyType, sortBy name, sortOrder asc, skip 0, take 25, hasAttributeContains Obsolete.

도구 개요

어셈블리 탐색 및 분석

  • AnalyzeAssembly: 공개 타입 및 메타데이터를 포함한 전체 어셈블리 개요

  • FindAssemblyByClassName: 특정 클래스 이름이 포함된 어셈블리 찾기

  • FindAssemblyByFileName: 일반적인 빌드 경로에서 파일 이름으로 어셈블리 찾기

타입 인트로스펙션

  • GetTypesFromAssembly: 메타데이터가 포함된 모든 공개 타입 나열 (페이징 처리)

  • AnalyzeType: 모든 멤버를 포함한 포괄적인 타입 분석

  • GetTypeInfo: 상세 타입 메타데이터 (접근성, 제네릭, 중첩 타입)

  • GetTypeHierarchy: 상속 체인 및 인터페이스 구현

  • GetGenericTypeInfo: 제네릭 매개변수, 인수 및 가변성 정보

  • GetTypeAttributes: 타입에 선언된 커스텀 속성

  • GetNestedTypes: 중첩 타입 선언

멤버 분석 (필터링 및 페이징 가능)

  • GetAllTypeMembers: 모든 카테고리의 모든 멤버

  • GetTypeMethods: 메서드 시그니처, 오버로드 및 메타데이터

  • GetTypeProperties: getter/setter 및 인덱서를 포함한 속성 세부 정보

  • GetTypeFields: 상수 및 읽기 전용 필드를 포함한 필드 정보

  • GetTypeEvents: 핸들러 타입이 포함된 이벤트 선언

  • GetTypeConstructors: 생성자 시그니처 및 매개변수

  • AnalyzeMethod: 오버로드 및 속성을 포함한 심층 메서드 분석

역방향 조회

  • FindImplementationsOf: 인터페이스를 구현하거나 기본 클래스에서 파생된 타입

  • FindMethodsReturning: 반환 타입이 주어진 타입과 일치하는 메서드 (오픈 제네릭 일치 지원)

  • FindReferencesTo: 매개변수, 필드, 속성, 이벤트 및 제네릭 인수에 대한 광범위한 검색

속성 및 메타데이터

  • GetMemberAttributes: 특정 멤버에 대한 속성

  • GetParameterAttributes: 매개변수 수준의 속성 정보

XML 문서화

  • GetXmlDocsForType: 타입 수준의 XML 문서 추출

  • GetXmlDocsForMember: 멤버별 문서 (요약/매개변수/반환값/비고)

프로젝트 및 솔루션 분석

  • AnalyzeSolution: .sln 파일 파싱 및 프로젝트 열거

  • AnalyzeProject: 프로젝트 메타데이터, 참조 및 빌드 구성

  • GetProjectOutputPaths: 다양한 구성에 대한 출력 디렉토리 확인

  • ResolvePackageReferences: NuGet 패키지를 캐시된 어셈블리에 매핑

  • FindDepsJsonDependencies: 런타임 종속성을 위해 deps.json 파싱

구성 및 런타임

  • GetRuntimeOptions: 현재 서버 구성 및 기본값

  • UpdateRuntimeOptions: 페이징, 캐싱 및 검색 동작 수정

고급 필터링 및 페이징

모든 멤버 분석 도구는 포괄적인 필터링 및 페이징을 지원합니다:

필터링 옵션:

  • caseSensitive (bool): 대소문자 구분 타입/멤버 일치

  • nameContains (string): 멤버 이름 부분 문자열로 필터링

  • hasAttributeContains (string): 속성 타입 부분 문자열로 필터링

  • includePublic / includeNonPublic (bool): 가시성 필터링

  • includeStatic / includeInstance (bool): 멤버 타입 필터링

페이징:

  • skip / take (int): 표준 오프셋 페이징

  • maxItems (int): 요청당 최대 결과 수

  • continuationToken (string): 대규모 데이터셋을 위한 토큰 기반 페이징

  • sortBy / sortOrder (string): 이름/접근성 기준 오름차순/내림차순 정렬

타입 확인:

  • 전체 이름 (Namespace.Type), 단순 이름 (Type) 및 중첩 타입 (Outer+Inner) 지원

  • caseSensitive 매개변수로 대소문자 구분 제어

  • 모호한 타입 이름에 대한 자동 대체 확인

응답 스키마

모든 도구는 안정적인 JSON 엔벨로프를 반환합니다:

{ "kind": "type.list|member.methods|...", "version": "1.0.0", "data": { /* result */ } }

오류는 일관된 형태를 사용합니다:

{ "kind": "error", "version": "1.0.0", "code": "AssemblyNotFound|TypeNotFound|InvalidArgument|InternalError", "message": "...", "details": { } }

Common error codes include `AssemblyNotFound`, `TypeNotFound`, `MemberNotFound`, `InvalidArgument`, and `InternalError`.

기여

기여를 환영합니다. 이 저장소에는 최신 C# 기본 설정(파일 범위 네임스페이스, 식 본문 멤버, 4칸 들여쓰기)이 포함된 .editorconfig가 있습니다.

커밋 메시지 형식

이 프로젝트는 자동 변경 로그 생성을 위해 Conventional Commits를 사용합니다. 모든 커밋은 이 형식을 따라야 합니다:

type(scope): description

유효한 타입:

  • feat - 새로운 기능

  • fix - 버그 수정

  • docs - 문서 변경만

  • style - 코드 스타일 변경 (포맷팅, 세미콜론 등)

  • refactor - 버그 수정이나 기능 추가가 없는 코드 변경

  • perf - 성능 개선

  • test - 테스트 추가 또는 수정

  • build - 빌드 시스템 또는 종속성 변경

  • ci - CI 구성 변경

  • chore - 소스나 테스트 파일을 수정하지 않는 기타 변경

  • revert - 이전 커밋 되돌리기

예시:

git commit -m "feat(tools): add new assembly analysis tool"
git commit -m "fix: resolve null reference in type loader"
git commit -m "docs(readme): update installation instructions"

개발 설정

# Restore .NET tools (versionize, husky)
dotnet tool restore

# Install git hooks for commit validation
dotnet husky install

가이드라인

  • 변경 사항을 작고 집중적으로 유지하세요. 새로운 동작에 대한 단위 테스트를 추가하세요.

  • 도구를 추가할 때 응답 엔벨로프 및 오류 코드 규칙을 따르세요.

  • PR을 열기 전에 로컬에서 dotnet builddotnet test를 실행하세요.

릴리스 생성

관리자는 다음을 사용하여 릴리스를 생성할 수 있습니다:

# Restore tools if not already done
dotnet tool restore

# Preview what will change
dotnet versionize --dry-run

# Create release (bumps version, updates changelog, creates git tag)
dotnet versionize

# Push changes and tag to trigger release workflow
git push --follow-tags

릴리스 워크플로는 자동으로 다음을 수행합니다:

  1. 프로젝트 빌드 및 테스트

  2. 변경 로그 노트와 함께 GitHub 릴리스 생성

  3. NuGet 패키지 게시

  4. 새 버전으로 server.json 업데이트

MCP 레지스트리

mcp-name: io.github.jcucci/dotnet-sherlock-mcp

라이선스

.NET용 Sherlock MCP는 MIT 라이선스에 따라 라이선스가 부여됩니다.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
7dResponse time
8wRelease cycle
3Releases (12mo)
Issues opened vs closed

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jcucci/dotnet-sherlock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server