| Crates.io | mandrel-mcp-th |
| lib.rs | mandrel-mcp-th |
| version | 0.4.6 |
| created_at | 2025-07-31 19:53:07.469306+00 |
| updated_at | 2025-07-31 20:35:52.218477+00 |
| description | Mandrel MCP Test Harness - Professional testing and reporting for MCP servers |
| homepage | |
| repository | https://github.com/user/dragonscale |
| max_upload_size | |
| id | 1775626 |
| size | 1,351,535 |
Mandrel is a modern, comprehensive testing framework for MCP (Model Context Protocol) servers built on the official Rust SDK. It provides validation, compliance testing, and detailed reporting for MCP server implementations.
The project includes the moth binary (MOdel context protocol Test Harness) for command-line testing operations.
# Install from source (in project root)
cargo install --path crates/mandrel-mcp-th
# Verify installation
moth --version
# Run tests from a specification file
moth run my-server.yaml
# Validate a test specification
moth validate my-server.yaml
# Generate reports from test results
moth report --format html --output results.html
# Show version information
moth --version
name: "Filesystem MCP Server"
version: "1.0.0"
description: "Test specification for filesystem operations"
capabilities:
tools: true
resources: true
server:
command: "node"
args: ["filesystem-server.js", "--sandbox", "/allowed/path"]
transport: "stdio"
startup_timeout_seconds: 10
tools:
- name: "read_file"
description: "Read file contents"
tests:
- name: "read_existing_file"
input:
path: "/allowed/path/test.txt"
expected:
error: false
schema:
type: object
required: ["content"]
properties:
content:
type: string
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Config │───▶│ Client │───▶│ Executor │
│ (YAML) │ │ (MCP/rmcp) │ │ (Test Run) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Validation │ │ Server │ │ Reporting │
│ (Schema) │ │ (Process) │ │ (JSON/HTML) │
└─────────────┘ └─────────────┘ └─────────────┘
moth runRun test specifications against MCP servers.
moth run [OPTIONS] <SPEC>
Options:
--output <DIR> Output directory for test results
--formats <FORMAT> Output formats (json, html, junit)
moth validateValidate test specification syntax and structure.
moth validate <SPEC>
moth reportGenerate reports from test execution results.
moth report [OPTIONS]
Options:
--format <FORMAT> Report format (json, html, junit)
--output <FILE> Output file path
Mandrel can also be used as a library in your Rust projects:
use mandrel_mcp_th::{cli::Commands, error::Result};
#[tokio::main]
async fn main() -> Result<()> {
// Use Mandrel programmatically
// Implementation details coming soon...
Ok(())
}
# Build the project
cargo build
# Run tests
cargo test
# Build release version
cargo build --release
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name
For complete documentation, see:
See our Contributing Guide for detailed development instructions.
This project is licensed under the MIT License - see the LICENSE file for details.