Testing utilities for the MCP SDK.
This crate provides mocks, fixtures, and assertions for testing MCP servers and clients. It includes:
- Mock servers and clients for unit testing
- Test fixtures with pre-configured tools/resources
- Custom assertions for MCP-specific scenarios
Overview
Mock Server
use ;
use ToolOutput;
let server = new
.tool
.build;
// Use in tests with MemoryTransport
Test Fixtures
use fixtures;
let tools = sample_tools;
let resources = sample_resources;
Assertions
use assert_tool_result;
use CallToolResult;
let result = text;
assert_tool_result!;