Skip to main content
The best way to test an MCP server is to connect it to an agent and exercise realistic flows.

Typical assertions

  • Correctness: Expect.content.contains, Expect.tools.output_matches
  • Tool usage: Expect.tools.was_called, called_with, count, success_rate, failed
  • Efficiency: Expect.performance.max_iterations, Expect.path.efficiency, Expect.tools.sequence
  • Quality: Expect.judge.llm (rubric‑based)

Examples

Golden paths & sequences

Use Expect.path.efficiency and Expect.tools.sequence to encode expected tool paths and detect backtracking/repeats.

Artifacts

  • Per‑test JSON and OTEL .jsonl traces in ./test-reports
  • Combined JSON/Markdown/HTML via runner options
Sources: