mcp_probe library

Test harness and conformance checks for MCP servers, built on the official dart_mcp client.

McpServerHarness runs an MCP server as a child process and exposes the dart_mcp client API for it with per-request timeouts and guaranteed process cleanup. checkServer runs a fixed set of conformance rules against a server command and returns a ConformanceReport.

The expect... helpers for package:test live in the separate package:mcp_probe/testing.dart entrypoint.

Classes

ConformanceFinding
A single observation produced by a conformance rule.
ConformanceReport
The result of running checkServer against an MCP server.
ConformanceRules
The names of the conformance rules applied by checkServer, as they appear in ConformanceFinding.rule.
McpServerHarness
Runs an MCP server as a child process and talks to it over stdio using the dart_mcp client, so tests can exercise the server end to end.

Enums

ConformanceSeverity
The severity of a ConformanceFinding.

Constants

harnessVersion → const String
The version reported to servers as the harness client version.

Functions

checkServer(String command, {List<String> args = const <String>[], Map<String, String>? environment, String? workingDirectory, Duration timeout = const Duration(seconds: 10), bool callTools = false}) Future<ConformanceReport>
Starts command args, runs every conformance rule in ConformanceRules against it, shuts it down, and returns the collected findings.

Exceptions / Errors

McpHandshakeException
An error that occurred while starting an MCP server and performing the initialize handshake with it.