Sherlock MCP for .NET
Sherlock MCP for .NET is a comprehensive Model Context Protocol (MCP) server that provides deep introspection capabilities for .NET assemblies. It enables Language Learning Models (LLMs) to analyze and understand your .NET code with precision, delivering accurate and context-aware responses for complex development scenarios.
This tool is essential for developers who want to harness LLM capabilities for:
- Deep codebase analysis - Understanding complex .NET architectures and dependencies
- Precise type information - Getting detailed metadata about types, members, and their signatures
- Automated documentation - Extracting and utilizing XML documentation and attributes
- Custom tooling - Building sophisticated tools that interact with .NET assemblies
- Code generation - Creating accurate code based on existing type structures
Key Features
- Comprehensive MCP Server: Provides 47 specialized tools for .NET assembly analysis, with an optional 24-tool
core profile whose other tools load on demand in groups
- Advanced Assembly Introspection: Deep reflection-based analysis of types, members, and metadata
- Rich Member Analysis: Detailed inspection of methods, properties, fields, events, and constructors
- Smart Filtering & Pagination: Advanced filtering by name/attributes with efficient pagination for large datasets
- XML Documentation Integration: Automatic extraction of summary, parameters, returns, and remarks
- Performance Optimized: Caching, pagination, and memory-efficient processing
- Stable JSON API: Consistent envelopes with versioning and structured error codes
- Modern .NET: Targets .NET 10 and 11
- Project Integration: Solution and project file analysis with dependency resolution
- Workflow Prompts:
explore_package, explain_type and who_calls prompts give one-click entry points into common analysis workflows
- Current MCP SDK: Built on
ModelContextProtocol 2.1.0 (GA)
- Current MCP Specification: Speaks protocol revision
2026-07-28, and negotiates down automatically for clients on earlier revisions
What's New in 3.0.0
- .NET 11 and C# 14/15 assemblies: Sherlock reads assemblies built with the .NET 11 SDK accurately (#124).
- Async methods read through their bodies:
get_method_calls and IL callers in find_references_to follow compiler state machines and understand .NET 11 runtime async, so classic and runtime-async builds give the same answer; bodyKind says which a method is.
- Unions and closed hierarchies:
get_type_info reports a union's cases and a closed type's permitted subclasses, get_type_hierarchy lists them without a scan, and compare_api_surface flags added cases and subclasses as breaking.
- Extension blocks: extension properties, indexers and methods appear once, as declared and grouped by receiver, in
get_type_members, search_members, find_extension_methods_for and the API diff, instead of as compiler-generated types and accessor methods.
- net11 apps: when the .NET 11 targeting pack is missing, the nine
Microsoft.Extensions.* assemblies that moved into the shared framework resolve from the local NuGet cache; if the cache doesn't have them either, the error says to install the .NET 11 SDK or targeting pack.
- Breaking: the server now needs the .NET 10 runtime or later (it ships
net10.0 and net11.0 builds). See CHANGELOG.md for full details.
Installation
Sherlock runs on the .NET 10 runtime or later; its package ships net10.0 and net11.0 builds. Version 2.15.0 is the last release that runs on .NET 8 or .NET 9.
With the .NET 10 SDK or later, install the global .NET tool from NuGet (adds sherlock-mcp to your PATH):
dotnet tool install -g Sherlock.MCP.Server
To upgrade an existing installation:
dotnet tool update -g Sherlock.MCP.Server
Alternatively, during development you can run the server locally from source:
dotnet run --project src/server/Sherlock.MCP.Server.csproj
Configure Your MCP Client
Sherlock runs as a standard MCP server over stdio using the sherlock-mcp command. No arguments are required — the server self-registers all tools when launched.
CLI agents
claude mcp add sherlock -- sherlock-mcp
codex mcp add sherlock -- sherlock-mcp
gemini mcp add sherlock sherlock-mcp
JSON configuration
VS Code (.vscode/mcp.json) and Visual Studio (.mcp.json):
{
"servers": {
"sherlock": {
"type": "stdio",
"command": "sherlock-mcp"
}
}
}
Antigravity (agy CLI, App, and IDE), Cursor, Claude Desktop, Windsurf, and other mcpServers-based clients: