Skip to main content
Configuration is the foundation of flexible testing. mcp-eval provides multiple ways to configure your tests, from simple YAML files to sophisticated programmatic control.

Configuration hierarchy

mcp-eval uses a layered configuration system (highest priority first):
  1. Programmatic overrides - Set in code
  2. Environment variables - Set in shell or CI
  3. Config files - mcpeval.yaml and mcpeval.secrets.yaml
  4. Defaults - Built-in sensible defaults

The MCPEvalSettings model

The complete configuration structure:

Loading configuration

Automatic discovery

Manual loading

Updating configuration

Global updates

Scoped configuration

Agent configuration

Using named agents

Agent factory pattern

Direct agent objects

Agent configuration in tests

Programmatic defaults

Set global defaults programmatically:

Environment variables

Provider configuration

Execution control

Reporting

Configuration validation

Validate on load

Custom validation

Advanced patterns

Dynamic configuration based on environment

Configuration inheritance

Config hot-reloading

Best practices

Separate secrets: Always keep API keys and sensitive data in mcpeval.secrets.yaml or environment variables, never in your main config file.
Validate early: Validate your configuration at the start of your test runs to catch issues before tests begin executing.
Use environment-specific configs: Different environments (dev, staging, prod) should have different configuration profiles for appropriate testing rigor.

Debugging configuration

See also

Configuration Guide

Complete configuration reference

Agent Setup

Configuring test agents

Environment Setup

Initial setup and configuration

Best Practices

Configuration best practices