🔧 Having trouble? Don’t worry! This comprehensive guide will help you diagnose and fix common issues quickly. We’ve got your back!

Quick diagnostics

Before diving into specific issues, let’s run a quick health check:

System Check

mcp-eval doctor
Comprehensive system diagnosis

Validate Config

mcp-eval validate
Verify configuration and API keys

Test Connection

mcp-eval validate --servers
Check server connectivity

Common error messages and solutions

🔑 Authentication errors

🔌 Server connection issues

⏱️ Timeout and performance issues

🧪 Test execution problems

Debug mode walkthrough

When tests fail mysteriously, enable debug mode for detailed insights:

Step 1: Enable debug output

# Maximum verbosity
mcp-eval run tests/ -vvv

# Or set in config
# mcpeval.yaml
debug:
  enabled: true
  log_level: DEBUG
  save_traces: true
  save_llm_calls: true

Step 2: Examine the debug output

Look for these key sections:
[DEBUG] Starting test: test_fetch_example
[DEBUG] Agent configuration: {name: "test_agent", servers: ["fetch"]}
[DEBUG] Sending prompt: "Fetch https://example.com"
[DEBUG] LLM Response: "I'll fetch that URL for you..."
[DEBUG] Tool call: fetch(url="https://example.com")
[DEBUG] Tool response: {"content": "Example Domain..."}
[DEBUG] Final response: "The page contains..."
[DEBUG] Assertion 'content_check' passed

Step 3: Inspect OTEL traces

# View trace for specific test
cat test-reports/traces/test_fetch_example.jsonl | jq '.'

# Or use the trace viewer
mcp-eval trace view test-reports/traces/test_fetch_example.jsonl
Key things to look for in traces:
  • Tool call sequences
  • Error spans
  • Timing information
  • Token usage per call

Network and connectivity debugging

Testing behind a proxy

# mcpeval.yaml
network:
  proxy:
    http: "http://proxy.company.com:8080"
    https: "https://proxy.company.com:8080"
  timeout: 30
  retry_on_connection_error: true

Debugging SSL/TLS issues

# Disable SSL verification (development only!)
export CURL_CA_BUNDLE=""
export REQUESTS_CA_BUNDLE=""

# Or configure trusted certificates
export SSL_CERT_FILE="/path/to/cacert.pem"

Testing with local servers

# For localhost servers
mcp:
  servers:
    local_server:
      command: "python"
      args: ["server.py"]
      env:
        HOST: "127.0.0.1"
        PORT: "8080"
      startup_timeout: 10  # Wait for server to start

Performance troubleshooting

Identifying bottlenecks

# Save a machine-readable report and analyze offline
mcp-eval run tests/ --json profile.json

# Analyze the report (custom scripts)
cat profile.json | jq '.' | less
Key metrics to watch:
  • llm_time_ms: Time spent in LLM calls
  • tool_time_ms: Time in tool execution
  • idle_time_ms: Wasted time between operations
  • max_concurrent_operations: Parallelism level

Optimization strategies

Reduce LLM calls

# Batch multiple checks
response = await agent.generate_str(
    "Fetch A, analyze it, then fetch B"
)

Parallel execution

# Run tests concurrently
@pytest.mark.parametrize("url", urls)
@pytest.mark.parallel

Cache results

cache:
  enabled: true
  ttl: 3600

Optimize prompts

# Be specific to reduce iterations
"Get the title from example.com"
# Not: "Tell me about example.com"

Platform-specific issues

macOS

Windows

Linux/Docker

Getting help

Self-service debugging

  1. Run diagnostics:
    mcp-eval doctor --full > diagnosis.txt
    
  2. Check logs:
    # View recent test logs
    tail -f test-reports/logs/mcp-eval.log
    
  3. Validate everything:
    mcp-eval validate
    

Prepare an issue report

If you’re still stuck, let’s gather information for a bug report:
# Automatically collect diagnostics
mcp-eval issue

# This will:
# 1. Run system diagnostics
# 2. Collect configuration (sanitized)
# 3. Get recent error logs
# 4. Generate issue template
# 5. Open GitHub issue page

Community support

Quick reference: Error codes

CodeMeaningQuick Fix
AUTH001Invalid API keyCheck environment variables
SRV001Server not foundVerify server name in config
SRV002Server failed to startCheck command and dependencies
TOOL001Tool not foundVerify server implements tool
TIMEOUT001Test timeoutIncrease timeout_seconds
ASSERT001Assertion failedCheck expected vs actual values
NET001Network errorCheck connectivity and proxy
RATE001Rate limitedReduce concurrency or add delays

Still stuck? Don’t hesitate to reach out! We’re here to help you succeed with mcp-eval. Remember, every great developer has faced these issues - you’re in good company! 🚀