Understand the fundamental concepts and architecture of mcp-eval for effective testing.
Master these core concepts to write effective tests with mcp-eval. Each concept builds on the previous ones to create a complete testing framework.
TestSession
is the orchestrator that manages the entire test lifecycle. It configures OpenTelemetry tracing, runs the agent, collects spans, computes metrics, and saves artifacts.
TestAgent
is a wrapper around the runtime agent that provides testing-specific functionality and connects assertions to the session.
generate_str()
for string responsesagent.assert_that()
shortcutcontains
, regex
)was_called
, count
, sequence
)response_time_under
, max_iterations
)@task
, @setup
, @teardown
, @parametrize
mcp_session
, mcp_agent
), markers (@pytest.mark.mcp_agent
)
MCPEvalSettings
for judge model/provider defaults.
Sources: