End-to-end tests for the StackRox MCP server using mcpchecker.
Validate configuration and build without running actual agents:
cd e2e-tests
./scripts/smoke-test.shThis is useful for CI and quickly checking that everything compiles.
- Go 1.25+
- Google Cloud Project with Vertex AI enabled (for Claude agent)
- OpenAI API Key (for LLM judge)
cd e2e-tests
./scripts/build-mcpchecker.shCreate .env file:
# Required: GCP Project for Vertex AI (Claude agent)
ANTHROPIC_VERTEX_PROJECT_ID=<GCP Project ID>
# Required: OpenAI API Key (for LLM judge)
OPENAI_API_KEY=<OpenAI API Key>
# Optional: Vertex AI region (defaults to us-east5)
CLOUD_ML_REGION=us-east5
# Optional: Judge configuration (defaults to OpenAI)
JUDGE_MODEL_NAME=gpt-5-nanoNote: No StackRox API token required - tests use WireMock mock service.
Run tests against the WireMock mock service:
./scripts/run-tests.shThe test suite:
- Starts WireMock automatically on localhost:8081
- Uses deterministic test fixtures
- Requires no StackRox API tokens
- Fast and reliable for development and CI
Results are saved to mcpchecker/mcpchecker-stackrox-mcp-e2e-out.json.
# Summary
jq '.[] | {taskName, taskPassed}' mcpchecker/mcpchecker-stackrox-mcp-e2e-out.json
# Tool calls
jq '[.[] | .callHistory.ToolCalls[]? | {name: .request.Params.name, arguments: .request.Params.arguments}]' mcpchecker/mcpchecker-stackrox-mcp-e2e-out.json| Test | Description | Tool |
|---|---|---|
list-clusters |
List all clusters | list_clusters |
cve-detected-workloads |
CVE detected in deployments | get_deployments_for_cve |
cve-detected-clusters |
CVE detected in clusters | get_clusters_with_orchestrator_cve |
cve-nonexistent |
Handle non-existent CVE | get_clusters_with_orchestrator_cve |
cve-cluster-does-exist |
CVE with cluster filter | get_clusters_with_orchestrator_cve |
cve-cluster-does-not-exist |
CVE with non-existent cluster | list_clusters |
cve-clusters-general |
General CVE query | get_clusters_with_orchestrator_cve |
cve-cluster-list |
CVE across clusters | get_clusters_with_orchestrator_cve |
cve-log4shell |
Well-known CVE (log4shell) | get_deployments_for_cve |
cve-multiple |
Multiple CVEs in one prompt | get_deployments_for_cve |
rhsa-not-supported |
RHSA detection (should fail) | None |
mcpchecker/eval.yaml: Test configuration, agent settings, assertionsmcpchecker/mcp-config-mock.yaml: MCP server configuration for WireMockmcpchecker/tasks/*.yaml: Individual test task definitions
mcpchecker uses a proxy architecture to intercept MCP tool calls:
- AI agent receives task prompt
- Agent calls MCP tool
- mcpchecker proxy intercepts and records the call
- Call forwarded to StackRox MCP server
- Server executes and returns result
- mcpchecker validates assertions and response quality
Tests fail - no tools called
- Verify WireMock is running:
make mock-status - Check WireMock logs:
make mock-logs
Build errors
go mod tidy
./scripts/build-mcpchecker.sh