DotnetTest.Mcp 0.0.1-beta.4

This is a prerelease version of DotnetTest.Mcp.
dotnet tool install --global DotnetTest.Mcp --version 0.0.1-beta.4
                    
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 DotnetTest.Mcp --version 0.0.1-beta.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=DotnetTest.Mcp&version=0.0.1-beta.4&prerelease
                    
nuke :add-package DotnetTest.Mcp --version 0.0.1-beta.4
                    

dotnet-test-mcp

NuGet Version NuGet Downloads License: MIT .NET

An MCP server that lets AI assistants discover and run .NET tests via dotnet test. Designed exclusively for projects using Microsoft Testing Platform (MTP) v2 — VSTest-based projects are not supported.

Tools

Tool Description
ListTestProjects List all test projects in the solution
ListTestsSummary Get test counts and names, with optional prefix filter
RunSingleTest Run a test by fully qualified method name
RunAllTests Run all tests in the solution
RunAllTestsForProject Run all tests in a specific project
RunAllTestsInClass Run all tests in a class

Requirements

  • .NET 10.0 SDK
  • Test projects using Microsoft Testing Platform (MTP) v2 — VSTest-based projects are not supported. MTP v2 is supported by all major test frameworks (xUnit, NUnit, MSTest, TUnit).
  • xUnit (required for CTRF report generation)

Note: MTP v2 requires opting in via global.json at your repository or solution root:

{
  "test": {
    "runner": "Microsoft.Testing.Platform"
  }
}

Installation

Install as a global .NET tool from NuGet:

dotnet tool install --global DotnetTest.Mcp

Or as a local tool in your project/solution:

dotnet tool install --local DotnetTest.Mcp

Setup

Add to your MCP client config (e.g. claude_desktop_config.json):

Using the installed NuGet tool (recommended):

{
  "mcpServers": {
    "dotnet-test-mcp": {
      "command": "dotnet-test-mcp"
    }
  }
}

Using dotnet run from source:

{
  "mcpServers": {
    "dotnet-test-mcp": {
      "command": "dotnet",
      "args": ["run", "--project", "/path/to/dotnet-test-mcp/src/DotnetTest.Mcp", "-c", "Release"]
    }
  }
}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Environment Variables

These are only needed in special cases. By default, the server uses the directory it is launched from as the working directory, which most AI tools set automatically to the root of your open project.

Variable Description Default
WORKING_DIRECTORY Override the solution root (e.g. if the server runs elsewhere) Current directory
TESTS_DIRECTORY_NAME Override the folder name containing test projects tests

Building

git clone https://github.com/jonasha/dotnet-test-mcp.git
cd dotnet-test-mcp
dotnet build -c Release

Troubleshooting

  • No test projects found: Check WORKING_DIRECTORY and TESTS_DIRECTORY_NAME match your structure
  • No tests matched: Use ListTestsSummary first to find the correct fully qualified name
  • CTRF errors: Confirm you're using xUnit 3.0+ with CTRF support

License

MIT — see LICENSE

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
0.0.1-beta.4 65 2/18/2026
0.0.1-beta.3 49 2/17/2026
0.0.1-beta.2 51 2/17/2026
0.0.1-beta.1 51 2/17/2026