Conjecture.Mcp
MCP server exposing Conjecture.NET property-based testing tools to AI assistants
Ask AI about Conjecture.Mcp
Powered by Claude Β· Grounded in docs
I know everything about Conjecture.Mcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation

What is it?
Hypothesis's engine, reimagined for idiomatic C#. Write tests that describe what your code should do, and let Conjecture generate hundreds of random inputs to find the edge cases you'd never think of. When it finds a failure, it automatically shrinks the input to the smallest possible counterexample β no hand-written cases required.
Install
Pick the adapter for your test framework:
dotnet add package Conjecture.Xunit # xUnit v2
dotnet add package Conjecture.Xunit.V3 # xUnit v3
dotnet add package Conjecture.NUnit # NUnit
dotnet add package Conjecture.MSTest # MSTest
Quick Example
using Conjecture.Xunit;
public class SortTests
{
[Property]
public bool Sorting_is_idempotent(List<int> items)
{
List<int> sorted = items.OrderBy(x => x).ToList();
List<int> sortedTwice = sorted.OrderBy(x => x).ToList();
return sorted.SequenceEqual(sortedTwice);
}
}
Run with dotnet test. Conjecture generates random lists, runs the property 100 times, and if it fails, shrinks the input to the minimal failing case.
Features
- Automatic test generation β generates random inputs from type-aware strategies
- Intelligent shrinking β finds the smallest failing input via byte-stream minimization
- LINQ composition β build complex strategies with
Select,Where,SelectMany - All major test frameworks β xUnit v2, xUnit v3, NUnit, MSTest, Microsoft Testing Platform
- F# support β idiomatic
Gen<'a>wrapper plus an Expecto integration - Source generators β derive strategies for your types with
[Arbitrary] - Roslyn analyzers β catch common mistakes at compile time
- Stateful testing β model systems as state machines and explore command sequences
- Targeted testing β steer generation toward extremes with
Target.Maximize/Target.Minimize - Recursive strategies β generate bounded-depth trees and self-referential types
- Example database β persist failing inputs for automatic regression prevention
- Reproduction export β write a runnable
.csrepro of any failing input viaExportReproductionOnFailure - Structured logging β structured events for generation, shrinking, and targeting phases
- HTTP / gRPC / messaging / EF Core / ASP.NET Core / Aspire integrations β model real distributed systems as
IInteractionTargets and dispatch composed interactions through one state machine - MCP server + dotnet tool β generate strategies and standalone test data from the CLI or AI assistants
Packages
| Package | Purpose |
|---|---|
| Test adapters | |
Conjecture.Core | Core engine, analyzers, source generator. Required by every adapter. |
Conjecture.Xunit | xUnit v2 adapter. |
Conjecture.Xunit.V3 | xUnit v3 adapter. |
Conjecture.NUnit | NUnit adapter. |
Conjecture.MSTest | MSTest adapter. |
Conjecture.TestingPlatform | Microsoft Testing Platform adapter. |
| Domain strategies | |
Conjecture.Time | Boundary-aware DateTimeOffset, DST/leap edges, FakeTimeProvider. |
Conjecture.Money | ISO 4217 currency codes, scaled decimal amounts, rounding modes. |
Conjecture.Regex | Regex-driven strings, common formats (URL/UUID/email/IP), ReDoS hunter. |
Conjecture.JsonSchema | Strategies that conform to a JSON Schema. |
Conjecture.Protobuf | Strategies shaped by a Protobuf MessageDescriptor. |
| Output & visualization | |
Conjecture.Formatters | JSON / NDJSON formatters for standalone data generation. |
Conjecture.Interactive | Strategy preview, histograms, shrink traces (plain text). |
Conjecture.LinqPad | LINQPad rich HTML formatters and shrink-trace visualizers. |
| Interactions | |
Conjecture.Interactions | Transport-agnostic abstractions: IInteraction, InteractionStateMachine<TState>. |
Conjecture.Http | HttpInteraction and IHttpTarget. |
Conjecture.Grpc | GrpcInteraction and IGrpcTarget covering all four RPC modes. |
Conjecture.Messaging | Transport-agnostic message bus interactions + in-memory bus. |
Conjecture.Messaging.AzureServiceBus | Azure Service Bus adapter. |
Conjecture.Messaging.RabbitMq | RabbitMQ adapter. |
| Web & data | |
Conjecture.AspNetCore | Metadata-driven request synthesis for ASP.NET Core minimal APIs and MVC. |
Conjecture.EFCore | Entity-graph strategies, roundtrip + migration invariants, IDbTarget. |
Conjecture.AspNetCore.EFCore | Bridge for ASP.NET Core + EF Core integration tests. |
Conjecture.OpenApi | Strategies derived from an OpenAPI 3 document. |
| Distributed | |
Conjecture.Aspire | Stateful property tests against .NET Aspire DistributedApplication. |
Conjecture.Aspire.EFCore | Aspire + EF Core bridge with composite invariants. |
| Tooling | |
Conjecture.Mcp | Model Context Protocol server exposing Conjecture to AI assistants. |
Conjecture.Tool | dotnet conjecture CLI for standalone data generation (in repo). |
| F# | |
Conjecture.FSharp | Idiomatic F# Gen<'a> wrappers and a PropertyRunner. |
Conjecture.FSharp.Expecto | Expecto integration for Conjecture.FSharp. |
Documentation
Full documentation is at ommundsen.dev/Conjecture:
- Quick Start β write your first property test in 5 minutes
- Tutorials β learn property-based testing step by step
- API Reference β auto-generated from source
- Porting Guide β coming from Python Hypothesis?
- Changelog
Credit
Conjecture is a .NET implementation of Hypothesis's property-based testing engine. The shrinking algorithm, choice-sequence IR, targeting, and example database all derive from the work of David R. MacIver, Zac Hatfield-Dodds, and the broader Hypothesis contributors. The C# API surface, source generators, and analyzer integrations are original to this project.
