← Back to Pull requests

fix(configurable): require opt-in for stdio MCP configs #2497

Closed
unknown closed this pull request without merging on Nov 25, 2026 10:41 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 00:54 UTC
Author

Linked issue

  • Closes: #1569
  • Problem: An agent config can select a local command for an stdio McpToolset without operator opt-in.

    Solution: Require ADK_ALLOW_CONFIG_STDIO_MCP_SERVERS before argument parsing. The Go config factory only supports stdio, so it can check the switch at entry. The accepted values match ADK Python (config guard, environment parser).

    Behavior change

    The internal config loader now rejects stdio MCP configs by default. Set ADK_ALLOW_CONFIG_STDIO_MCP_SERVERS to 1 or true (case-insensitive) only if you trust every config the process loads. Go callers can still use mcptoolset.New directly without setting the variable.

    Testing Plan

    Unit Tests:

  • All unit tests pass locally.

  • Build, race tests, lint, formatting, and go mod tidy -diff passed in both modules.

  • A WebSocket test failed once on a separate rerun and passed 20 isolated reruns.
  • With your source change reverted and your tests kept, which test fails?

    TestResolveToolReferenceMcpToolsetStdioOptIn fails in the rejection cases.

    Manual End-to-End (E2E) Tests:

    Ran adkcli --help with a stdio MCP config. The CLI rejected it with 0 and loaded it with TrUe.

    Checklist

  • I have read the CONTRIBUTING.md document.

  • I have performed a self-review of my own code.

  • I have commented my code, particularly in hard-to-understand areas.

  • I have added tests that prove my fix is effective or that my feature works.

  • New and existing unit tests pass locally with my changes.

  • I have manually tested my changes end-to-end through CLI configuration loading.

  • Any dependent changes have been merged and published in downstream modules. (N/A)
  • Additional context

    Supersedes #1591. Maintainer request.

    Diff: 273 lines (+204 / -69) across 3 files Reviewer: ktsoator Review duration: 586m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.63) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 273 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.336
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #2497"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.7% (MEDIUM) · Higher = larger blast radius
    62.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.1% · Safe to merge
    27.1%
    Repository