Add MCP Service to Helm chart - #37
Open
ravikiranvm wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The README update introduces inconsistencies (many remaining “engine” references and outdated config examples) that can mislead users about current chart values and components.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an opt-in MCP server to the OpenOps Helm chart, including routing through nginx, gated secret/values handling, and CI rendering to keep the MCP-enabled path validated.
Changes:
- Introduce a new
mcpvalues block (with schema + example overlay) and API-side OAuth env derived frommcp.enabled+global.publicUrl. - Add MCP Kubernetes resources (Deployment/Service/SA/PDB/HPA) plus nginx routing and NetworkPolicy rules when enabled.
- Extend secret/external-secret generation and Helm validation logic to support MCP-only env and required secret validation.
File summaries
| File | Description |
|---|---|
| README.md | Documents MCP usage and updates component list/repo layout (but still contains outdated “engine” sections elsewhere). |
| chart/values.yaml | Adds MCP configuration + derived OAuth env vars and MCP-specific env wiring. |
| chart/values.schema.json | Adds schema for the new mcp values block. |
| chart/values.mcp-example.yaml | Provides a CI-rendered example overlay that enables MCP. |
| chart/values.ci.yaml | Keeps MCP disabled in CI while providing resource/PDB defaults. |
| chart/templates/serviceaccount-mcp.yaml | ServiceAccount for MCP (gated on mcp.enabled). |
| chart/templates/service-mcp.yaml | ClusterIP service for MCP (gated on mcp.enabled). |
| chart/templates/secret-env.yaml | Includes MCP env-derived secret keys only when MCP is enabled. |
| chart/templates/pdb-mcp.yaml | PDB for MCP (gated on mcp.enabled). |
| chart/templates/NOTES.txt | Adds MCP connection instructions when enabled. |
| chart/templates/networkpolicy.yaml | Allows nginx → MCP traffic and adds an MCP-specific NetworkPolicy when enabled. |
| chart/templates/hpa-mcp.yaml | Optional HPA for MCP (gated on mcp.enabled + autoscaling). |
| chart/templates/external-secret.yaml | Adds MCP env-derived secret entries only when MCP is enabled. |
| chart/templates/deployment-mcp.yaml | MCP Deployment with restricted env injection and metadata-based probes. |
| chart/templates/configmap-nginx.yaml | Adds /mcp and RFC 9728 metadata proxy routes when enabled. |
| chart/templates/_helpers.tpl | Adds openops.mcpServiceUrl and openops.validateMcp validation helper. |
| chart/.gitignore | Ensures values.mcp-example.yaml is included in the chart repo. |
| AGENTS.md | Updates repository structure + production features to include MCP. |
| .github/workflows/helm-validate.yaml | Adds CI templating pass for the MCP-enabled example overlay. |
Review details
Suppressed comments (1)
README.md:22
- This section switches terminology to "worker", but large parts of the README still reference "engine" (e.g., production overlay notes, scaling examples, and autoscaling examples). Since the chart values use
worker:/ per-componentautoscaling:blocks, the remaining README sections should be updated to match the current values keys and component names.
- **openops-app**: Main application server.
- **openops-worker**: Workflow execution worker.
- **openops-mcp** (opt-in): MCP server that lets external agents such as Claude Code or Codex operate OpenOps over OAuth.
- Files reviewed: 19/19 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of OPS-4801
What this adds
An optional MCP server component (
openops-mcp) so external agents such as Claude Code or Codex can operate OpenOps. When enabled, it runs as its own Deployment behind nginx at<publicUrl>/mcpand authenticates agents with OAuth issued by the OpenOps API. Turning it on is one flag,mcp.enabled: true, plus one shared secret,OPS_OAUTH_RS_CLIENT_SECRET. The chart derives the API's OAuth settings from that flag andglobal.publicUrl, so the API and the MCP server always agree on issuer and resource URLs.Impact on existing installs
MCP is off by default. With it off, the only rendered change is three new plain environment variables on the app and worker pods (
OPS_OAUTH_ENABLED=falseplus the two derived URLs), which causes one rolling restart on upgrade. No Secret or ExternalSecret entries change, so environments backed by Key Vault are unaffected. Verified by rendering the dev, staging, prod and pentest values files against this branch and the base branch and diffing the output.Image and CI
The MCP image is only published to the private registry
openopsprivate.azurecr.iountil its first public release, so that is the defaultmcp.repository, matching the docker-compose setup. Because the kind cluster in the e2e workflow cannot pull from a private registry, MCP stays disabled there. The enabled path is covered instead by a newvalues.mcp-example.yaml, which the validation workflow renders on every PR. Once a public image exists, the default can flip and e2e can enable it.Follow-ups (outside this repo)
mg/OPS-4456after merge.Container Registry Repository Readeron the private registry (Terraform, Owner apply). Without it the MCP pod cannot pull its image.OPS_OAUTH_RS_CLIENT_SECRETintoazure-<env>-infra-secretsvia Terraform (openops-cloud/devops#). Replaces the manual Key Vault edit; this chart PR routes the key to the infra secret.mcp.enabled: true,mcp.tag, and declareOPS_OAUTH_RS_CLIENT_SECRET: ""invalues.dev.yaml; bumpCHART_VERSIONin the deploy-helm action./.well-known/oauth-protected-resource/mcpreturns the expected resource, then connect withclaude mcp add --transport http openops https://dev.internal.openops.com/mcp./mcpand/.well-known/*traffic.mainonce OPS-4456 merges.