ExplainExceptionMCP 1.0.1

dotnet tool install --global ExplainExceptionMCP --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ExplainExceptionMCP --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ExplainExceptionMCP&version=1.0.1
                    
nuke :add-package ExplainExceptionMCP --version 1.0.1
                    

explain-exception-mcp

A stdio MCP server for analyzing C#/.NET exceptions.

It helps MCP clients:

  1. Parse source file paths, line numbers, and method names from exception text or .NET stack traces.
  2. Read the matching source code context from a local workspace.
  3. Build an exception analysis prompt that the client-side LLM can use to explain the likely root cause and suggest fixes.

Tools

  • ParseStackTrace: Parses source file paths, line numbers, and method names from exception text or a .NET stack trace.
  • GetCodeContext: Reads code around a target line in a source file.
  • AnalyzeException: Combines an exception and code context into an analysis prompt. It does not call an LLM directly.
  • ExplainException: Runs the end-to-end flow: parse the stack trace, read code context, and build the analysis prompt.

Installation

Install from NuGet as a .NET global tool:

dotnet tool install -g ExplainExceptionMCP

Update an existing installation:

dotnet tool update -g ExplainExceptionMCP

Verify that the command is available:

explain-exception-mcp

This is a stdio MCP server, so it waits for MCP JSON-RPC messages on standard input. It is normal for the process to keep running without printing an HTTP URL.

MCP Client Configuration

After installing the NuGet global tool, configure your MCP client to run the tool command directly.

{
  "mcpServers": {
    "explain-exception-mcp": {
      "command": "explain-exception-mcp"
    }
  }
}

If your MCP client cannot find .NET global tools from PATH, use the full path to the generated shim.

Windows example:

{
  "mcpServers": {
    "explain-exception-mcp": {
      "command": "C:\\Users\\YOUR_USER_NAME\\.dotnet\\tools\\explain-exception-mcp.exe"
    }
  }
}

macOS/Linux example:

{
  "mcpServers": {
    "explain-exception-mcp": {
      "command": "/home/YOUR_USER_NAME/.dotnet/tools/explain-exception-mcp"
    }
  }
}

Usage Example

Ask your MCP client to call ExplainException with a .NET stack trace and, when useful, the local workspace root:

Use explain-exception-mcp to analyze this exception.
workspaceRoot: C:\path\to\your\repo

System.NullReferenceException: Object reference not set to an instance of an object.
   at Demo.Services.OrderService.CalculateTotal() in C:\path\to\your\repo\Services\OrderService.cs:line 42

Local Development

Run the server from source:

dotnet run --project .\ExplainExceptionMCP\ExplainExceptionMCP.csproj

Run tests:

dotnet test .\ExplainExceptionMCP.Tests\ExplainExceptionMCP.Tests.csproj
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.1 84 5/7/2026
1.0.0 77 5/7/2026