testing library
Expectation helpers for testing MCP servers with package:test.
This entrypoint is separate from package:mcp_probe/mcp_probe.dart so
that only code which actually asserts inside tests pulls in the
package:test surface; the harness and the conformance checks do not
need it.
Functions
-
expectResourceExists(
McpServerHarness harness, String uri) → Future< void> -
Fails the current test if the server behind
harnessdoes not list a resource with the givenuri. -
expectToolCallFails(
McpServerHarness harness, String name, {Map< String, Object?> ? arguments}) → Future<CallToolResult> -
Calls the tool
namewithargumentsand fails the current test unless the call reports an in-band error (isError: true). -
expectToolCallSucceeds(
McpServerHarness harness, String name, {Map< String, Object?> ? arguments}) → Future<CallToolResult> -
Calls the tool
namewithargumentsand fails the current test if the call reports an in-band error. -
expectToolExists(
McpServerHarness harness, String name) → Future< void> -
Fails the current test if the server behind
harnessdoes not list a tool namedname.