ZeroMcp.TestKit
0.1.3.4
dotnet add package ZeroMcp.TestKit --version 0.1.3.4
NuGet\Install-Package ZeroMcp.TestKit -Version 0.1.3.4
<PackageReference Include="ZeroMcp.TestKit" Version="0.1.3.4" />
<PackageVersion Include="ZeroMcp.TestKit" Version="0.1.3.4" />
<PackageReference Include="ZeroMcp.TestKit" />
paket add ZeroMcp.TestKit --version 0.1.3.4
#r "nuget: ZeroMcp.TestKit, 0.1.3.4"
#:package ZeroMcp.TestKit@0.1.3.4
#addin nuget:?package=ZeroMcp.TestKit&version=0.1.3.4
#tool nuget:?package=ZeroMcp.TestKit&version=0.1.3.4
ZeroMcp.TestKit
A fluent .NET API for testing MCP (Model Context Protocol) servers. Define expectations in code and run them against any MCP endpoint — HTTP, WebSocket, or stdio.
Powered by the mcptest engine (bundled as native assets).
Install
dotnet add package ZeroMcp.TestKit
For xUnit integration (recommended):
dotnet add package ZeroMcp.TestKit.Xunit
Quick Start
using ZeroMcp.TestKit;
await McpTest
.Server("http://localhost:8000/mcp")
.Tool("search")
.WithParams(new { query = "hello" })
.ExpectSchemaMatch()
.ExpectDeterministic()
.RunAsync();
RunAsync() throws McpTestException with detailed error messages if any check fails — integrates naturally with any test framework.
What You Can Test
| Expectation | Method |
|---|---|
| Output matches declared JSON Schema | .ExpectSchemaMatch() |
| Identical output across N runs | .ExpectDeterministic() |
| Tool returns an error response | .ExpectError() / .ExpectErrorCode(code) |
| Streaming produces enough chunks | .ExpectMinStreamChunks(n) |
| Tool completes within a deadline | .WithTimeout(TimeSpan) |
Fluent API
await McpTest
.Server("http://localhost:8000/mcp")
.WithTimeout(TimeSpan.FromSeconds(30))
.WithDeterminismRuns(5)
.Tool("search")
.WithParams(new { query = "hello" })
.ExpectSchemaMatch()
.ExpectDeterministic()
.WithIgnorePaths("$.result.timestamp")
.Tool("echo")
.WithParams(new { text = "world" })
.ExpectSchemaMatch()
.RunAsync();
Inspect Responses
Use RunWithoutThrowAsync() to get the result without throwing, then inspect tool responses:
var result = await McpTest
.Server("http://localhost:8000/mcp")
.Tool("get_customer")
.WithParams(new { id = 1 })
.RunWithoutThrowAsync();
result.ForTool("get_customer")
.Passed()
.HasReturnProperty("id")
.HasReturnProperty("name")
.HasReturnValue("email", "alice@example.com");
Engine Resolution
The mcptest binary is located automatically:
MCPTEST_PATHenvironment variable- NuGet native assets (
runtimes/{rid}/native/mcptest) — bundled with this package - System
PATH
Links
| Product | Versions 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ZeroMcp.TestKit:
| Package | Downloads |
|---|---|
|
ZeroMcp.TestKit.Xunit
xUnit integration for ZeroMcp.TestKit — adds [McpFact] and [McpTheory] attributes, McpAssert static helpers, and fluent assertion chains for testing MCP servers in Visual Studio Test Explorer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial preview release — fluent DSL, engine resolver, native asset bundling.