CLI reference
Complete reference for MCP-Eval command-line interface, including commands and flags.
CLI commands
Setup & Configuration
init
Initialize a new MCP-Eval project with interactive setup.
What it does:
- Creates
mcpeval.yamlandmcpeval.secrets.yaml - Prompts for LLM provider and API key
- Auto-detects and imports servers from
.cursor/mcp.jsonor.vscode/mcp.json - Configures default agent with instructions
- Sets up judge configuration for test evaluation
server add
Add MCP server to configuration.
Source: generator.py:1529-1633
agent add
Add test agent configuration.
Source: generator.py:1635-1701
Test Generation
generate
Generate test scenarios and write test files for MCP servers.
What it does:
- Discovers server tools via MCP protocol
- Generates test scenarios with AI
- Refines assertions for each scenario
- Validates generated Python code
- Outputs test files or datasets
--update, the command appends new tests to an existing file rather than creating a new one. The file path provided to --update becomes the target file.
Example:
Test Execution
run
Execute test files and generate reports.
Accepts all standard pytest options
Source: runner.py
dataset
Run dataset evaluation.run command.
Source: runner.py
Inspection & Validation
server list
List configured MCP servers.
Source: list_command.py:20-102
agent list
List configured agents.
Source: list_command.py:104-185
validate
Validate MCP-Eval configuration and connections.
What it checks:
- API keys are configured
- Judge model is set
- Servers can be connected to
- Agents reference valid servers
- LLM connections work
Debugging & Diagnostics
doctor
Comprehensive diagnostics for troubleshooting.
What it checks:
- Python version and packages
- Configuration files
- Environment variables
- System information
- Recent test errors
- Provides fix suggestions
issue
Create GitHub issues with diagnostic information.
Source: issue.py
version
Show version information.Configuration Files
MCP-Eval uses two primary configuration files:mcpeval.yaml
Main configuration containing:- Server definitions (transport, command, args, env)
- Agent definitions (name, instruction, server_names)
- Judge configuration (provider, model, min_score)
- Default agent setting
- Reporting configuration
mcpeval.secrets.yaml
Sensitive configuration containing:- API keys for LLM providers
- Authentication tokens
- Other secrets
mcp-eval init and can be edited manually.
Environment Variables
MCP-Eval respects these environment variables:Typical Workflow
1. Initialize Project
2. Configure Servers & Agents
3. Validate Setup
4. Generate Tests
5. Execute Tests
6. Debug Issues
Test Styles
MCP-Eval supports three test formats:pytest
Standard pytest format with test functions and assertions. Best for integration with existing Python test suites.decorators
MCP-Eval’s decorator-based format using@task and @setup.
Provides rich async support and session management.
dataset
YAML-based test cases for batch evaluation. Ideal for non-programmers and test data management.See also
- Quickstart guide - Getting started with MCP-Eval
- Test Generation - Generating tests with AI
- Writing Tests - Manual test creation
- Configuration - Detailed configuration options
- GitHub Repository - Source code and issues