> ## Documentation Index
> Fetch the complete documentation index at: https://mcp-eval.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generating Tests with LLMs

> Use the generator to discover tools, create scenarios, refine assertions, and emit tests or datasets.

We recommend Anthropic Sonnet/Opus for higher‑quality generation and judging.

### Generate

```bash theme={null}
mcp-eval generate --style pytest --n-examples 8 --provider anthropic [--model ...]
```

What happens:

* Detect credentials and write/update configs
* Discover server tools
* Generate scenarios with an LLM
* Refine assertions (tool/judge/path)
* Emit a single test file or dataset

### Update an existing file

```bash theme={null}
mcp-eval generate --update tests/test_fetch_generated.py --style pytest --n-examples 4
```

### Implementation

* Generator: [generator.py](https://github.com/lastmile-ai/mcp-eval/blob/main/src/mcp_eval/cli/generator.py)
* Scenario creation: [generation.py](https://github.com/lastmile-ai/mcp-eval/blob/main/src/mcp_eval/generation.py)
