Docs/patterns/optimization pattern/mcps

Optimization Pattern — MCP recommendations

Pattern: Optimization
Component: mcps.md
Version: 1.1 | Updated: 2026-07-29


Purpose

Least-privilege MCP servers for the Optimization pattern. Keep mcpServers: {} until a human enables stubs after MCP when and how.

MCP Why for this pattern
Datadog Latency/error baselines
Grafana Optional dashboards
Sentry Error regression watch

When to enable for Optimization

Datadog/Grafana/Sentry provide baselines and regression watch. Enable them before changing hot paths; keep write/deploy tools off.

Enable rules (this pattern)

  1. Optimization MCPs are measurement planes — never auto-tune production
  2. Never commit tokens; map secrets outside git
  3. Record allowlist + data class in MODEL_POLICY / SoA before write tools
  4. Freeze dashboard queries that define the baseline so they cannot silently change mid-run

Anti-patterns

  • Optimizing against a dashboard that was edited during the experiment
  • Shipping a hot-path change because p50 improved while p99 was ignored
  • Using MCP to mutate feature flags without a correctness oracle

Checklist

  • Optimization MCPs mapped to env secrets outside git
  • Unused servers remain disabled after the optimization gate
  • Injection / tool PEP reviewed if tools can act