Learn proven patterns for testing MCP servers and agents. Each workflow includes practical examples and tips from real-world usage.
Write your first test
Choose a test style
Add meaningful assertions
Run and iterate
Test an MCP server comprehensively
Identify server capabilities
Create test scenarios for each tool
Test error handling
Create a comprehensive dataset
Create and enforce a golden path
Ensure your agent follows the optimal execution path:Define the ideal tool sequence
Add path efficiency assertion
Debug path violations
Refine agent instructions
Build quality gates with LLM judges
Start with a simple rubric
Combine with structural checks
Use multi-criteria for complex evaluation
Calibrate thresholds
Integrate with CI/CD
Add GitHub Actions workflow
.github/workflows/mcp-eval.yml using the reusable workflow:- Runs tests and generates reports
- Posts PR comments with results
- Uploads artifacts
- Deploys badges and HTML reports to GitHub Pages (on main branch)
Enable GitHub Pages
- Go to Settings → Pages
- Source: Deploy from a branch
- Branch: gh-pages (created automatically by the workflow)
- Save the settings
- Badges:
https://YOUR_USERNAME.github.io/YOUR_REPO/badges/ - Report:
https://YOUR_USERNAME.github.io/YOUR_REPO/
Add test badges from GitHub Pages
Configure failure conditions
Generate tests with AI
Use the generate command
Review and customize
Update existing tests
Debug failing tests
Enable verbose output
Examine OTEL traces
test-reports/test_name_*/trace.jsonl:Use doctor and validate commands
Add debug assertions