| Crates.io | mcpkit-testing |
| lib.rs | mcpkit-testing |
| version | 0.5.0 |
| created_at | 2025-12-11 17:31:17.973453+00 |
| updated_at | 2025-12-26 00:55:32.665757+00 |
| description | Testing utilities for mcpkit |
| homepage | |
| repository | https://github.com/praxiomlabs/mcpkit |
| max_upload_size | |
| id | 1980160 |
| size | 138,839 |
Testing utilities for the Model Context Protocol (MCP).
This crate provides mocks, fixtures, and assertions for testing MCP servers and clients.
use mcpkit_testing::{MockServer, MockTool};
use mcpkit_core::types::ToolOutput;
let server = MockServer::new()
.tool(MockTool::new("add")
.description("Add two numbers")
.handler(|args| Ok(ToolOutput::text("42"))))
.build();
// Use in tests with MemoryTransport
use mcpkit_testing::fixtures;
let tools = fixtures::sample_tools();
let resources = fixtures::sample_resources();
use mcpkit_testing::assert_tool_result;
use mcpkit_core::types::CallToolResult;
let result = CallToolResult::text("42");
assert_tool_result!(result, "42");
| Export | Purpose |
|---|---|
MockServer |
Mock MCP server for testing |
MockServerBuilder |
Builder for mock servers |
MockTool |
Mock tool definition |
assert_tool_success |
Assert tool call succeeded |
assert_tool_error |
Assert tool call failed |
sample_tools |
Pre-configured test tools |
sample_resources |
Pre-configured test resources |
This crate is part of the mcpkit SDK. For most use cases, depend on mcpkit directly rather than this crate.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.