Skip to content

feat: MCP behavioral evaluation with mcpchecker - #116

Merged
IlonaShishov merged 3 commits into
mcp-evaluation-pipelinefrom
phase3-behavioral-eval
Oct 25, 2026
Merged

IlonaShishov merged 3 commits into
mcp-evaluation-pipelinefrom
phase3-behavioral-eval

Conversation

@IlonaShishov

@IlonaShishov IlonaShishov commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

This PR introduces Phase 3 behavioral evaluation capabilities through mcpchecker integration and refactors the existing evaluation phases for improved clarity and execution model.

Key changes:

  • Phase 3 Behavioral Evaluation: New mcp-behavioral-eval Tekton Task that deploys a mcpchecker Job on the target cluster, collects results, and aggregates them via aggregate_mcpchecker.py
  • Consolidated Containerfile: Single multi-stage build combining mcpchecker binary from source with Phase 1/2 scanners
  • Job-based Execution Model: Converted Phase 1/2 to Job-based execution with raw log dumps for better observability
  • Naming Refactor: Renamed evaluation phases for clarity:
    • Phase 1 → Static Evaluation (static-eval)
    • Phase 2 → Conformance Evaluation (conformance-eval)
    • Phase 3 → Behavioral Evaluation (behavioral-eval)
  • Default Test Suite: Added suites/mcp/default/ with tool-correctness, edge-case-handling, and sensitive-data-redaction tests
  • PR Label Gating: Configurable mcpchecker execution via Pipelines as Code and Tekton CEL expressions (MCPCHECKER_LABEL parameter)
  • Pipeline Improvements: Refactored parse-snapshot task to expose generic pr-labels passthrough result

Associated Jira: APPENG-6673

🤖 Generated with Claude Code

Refactor Phase 1 (static) and Phase 2 (conformance) tasks to use
Kubernetes Jobs for probe execution, enabling cluster-internal testing
and better log visibility.

**Phase 2 Job-based execution:**
- New mcp-conformance-eval-job.yaml template for probe Job
- Job runs phase2_conformance_probe and phase2_compass_probe
- Single-line JSON markers (===REPORT_JSON:filename===) for reliable extraction
- Raw log dump in run-probe-job step for debugging
- Parse reports from logs instead of oc cp (works after pod completes)

**Phase 1 improvements:**
- Add parse-snapshot task integration
- Update mcp-phase1-static for Job compatibility

**RBAC refactoring:**
- Scope SA permissions to ephemeral namespaces via RoleBinding
- Remove ClusterRoleBinding (was granting cluster-wide access)
- create-namespace task creates RoleBinding to activate mcp-eval-ephemeral-access
- Remove runAsUser constraint to allow package installation in Jobs

**Container image:**
- Add Phase 2 Job template to mcp-eval image
- Add envsubst for runtime config injection
- Update comments to reflect Job-based architecture

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@IlonaShishov
IlonaShishov force-pushed the phase3-behavioral-eval branch 2 times, most recently from 3913ed0 to 3950004 Compare October 25, 2026 10:46
Add Phase 3 behavioral evaluation using mcpchecker for LLM agent-based
testing of tool correctness, edge-case handling, and sensitive data
redaction. Includes PR label gating and parallel phase execution.

**Phase 3 Behavioral Evaluation:**
- mcp-behavioral-eval task with Kubernetes Job execution
- mcpchecker integration with configurable agent/judge LLM models
- Default task suite: tool-correctness, edge-case-handling, sensitive-data-redaction
- mcp-behavioral-eval-job.yaml template with LLM env vars
- Raw log dump for debugging mcpchecker runs (matches Phase 2 pattern)
- Report aggregation with configurable pass threshold (default 0.7)
- 1800s Job timeout (30 minutes for LLM-based evaluation)

**PR Label Gating:**
- check-label task fetches PR labels from GitHub API
- External task design for cross-cluster PR metadata access
- Gate Phase 3 execution on "mcpchecker" label presence
- Added to integration pipeline with conditional execution

**Pipeline Integration:**
- Add Phase 3 to konflux-mcp-eval-pipelinerun.yaml
- Parallel execution of Phase 1, Phase 2, and Phase 3
- Update Makefile with check-label and mcp-behavioral-eval tasks

**mcpchecker Suite:**
- suites/mcp/default/eval.yaml: suite configuration
- suites/mcp/default/mcp-config.yaml: MCP server connection config
- suites/mcp/default/tasks/*.yaml: task definitions
- Baked into mcp-eval container image

**Container Updates:**
- mcpchecker-runner multi-stage build for binary/Node.js
- Copy mcpchecker suite files to /opt/suites/mcp/default
- Add aggregate_mcpchecker.py for result processing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@IlonaShishov
IlonaShishov force-pushed the phase3-behavioral-eval branch 2 times, most recently from 7178e27 to 6a8bdf8 Compare October 25, 2026 14:15
- Separate summaries and detailed results into reports/ and results/
- Rename phase-based to evaluation-type naming convention
- Fix submission-name semantics and flatten directory structure
- Remove debug print steps and simplify log collection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@IlonaShishov
IlonaShishov force-pushed the phase3-behavioral-eval branch from 6a8bdf8 to e93d62d Compare October 25, 2026 14:17
@IlonaShishov
IlonaShishov merged commit d8c2ae0 into mcp-evaluation-pipeline Oct 25, 2026
2 checks passed
operetz-rh added a commit that referenced this pull request Oct 26, 2026
Integrate Phase 3 behavioral evaluation results (from PR #116) into
Compass SoundCheck publishing. Adds BehavioralEvalSummary model, Phase 3
check mappings (tool-correctness, edge-case-handling, sensitive-data-
redaction), and Compass track with 3 behavioral checks.

- Support behavioral-eval-summary.json parsing and fact publishing
- Add Phase 3 to bootstrap_compass_track (fixes 400 error on track update)
- Fix timestamp consistency across all fact payloads (single evaluated_at)
- Fix Phase 3 naming via lookup table (consistency with Phase 1/2)
- Fix Phase 3 optional payload fields (False/0 vs None for schema)

Validated: 31 unit tests pass, real openshift-mcp-server eval published
to Compass staging (HTTP 200), track visible with all phases.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
operetz-rh added a commit that referenced this pull request Oct 26, 2026
Integrate Phase 3 behavioral evaluation results (from PR #116) into
Compass SoundCheck publishing. Adds BehavioralEvalSummary model, Phase 3
check mappings (tool-correctness, edge-case-handling, sensitive-data-
redaction), and Compass track with 3 behavioral checks.

- Support behavioral-eval-summary.json parsing and fact publishing
- Add Phase 3 to bootstrap_compass_track (fixes 400 error on track update)
- Fix timestamp consistency across all fact payloads (single evaluated_at)
- Fix Phase 3 naming via lookup table (consistency with Phase 1/2)
- Fix Phase 3 optional payload fields (False/0 vs None for schema)

Validated: 31 unit tests pass, real openshift-mcp-server eval published
to Compass staging (HTTP 200), track visible with all phases.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant