-
Notifications
You must be signed in to change notification settings - Fork 0
ROX-33010: Add MCP Gateway integraton to Helm chart #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| {{- if .Values.mcpGateway.enabled }} | ||
| {{- if not (.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1") }} | ||
| {{- fail "MCP Gateway integration requires the Gateway API (gateway.networking.k8s.io/v1). Install Gateway API CRDs before enabling mcpGateway." }} | ||
| {{- end }} | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: {{ include "stackrox-mcp.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "stackrox-mcp.labels" . | nindent 4 }} | ||
| spec: | ||
| parentRefs: | ||
| - name: {{ .Values.mcpGateway.gateway.name }} | ||
| namespace: {{ .Values.mcpGateway.gateway.namespace }} | ||
| {{- with .Values.mcpGateway.hostname }} | ||
| hostnames: | ||
| - {{ . | quote }} | ||
| {{- end }} | ||
| rules: | ||
| - matches: | ||
| - path: | ||
| type: PathPrefix | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I fully understand your question. Matches are required for HTTPRoute. Here is an example: https://docs.kuadrant.io/1.4.x/kuadrant-backstage-plugin/docs/getting-started/#step-2-create-the-gateway-and-httproute Maybe we can change to |
||
| value: /mcp | ||
| backendRefs: | ||
| - name: {{ include "stackrox-mcp.fullname" . }} | ||
| port: {{ .Values.service.port }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| {{- if .Values.mcpGateway.enabled }} | ||
| {{- if not (.Capabilities.APIVersions.Has "mcp.kagenti.com/v1alpha1") }} | ||
| {{- fail "MCP Gateway integration requires the MCPServerRegistration CRD (mcp.kagenti.com/v1alpha1). Install MCP Gateway (https://github.com/Kuadrant/mcp-gateway) before enabling mcpGateway." }} | ||
| {{- end }} | ||
| apiVersion: mcp.kagenti.com/v1alpha1 | ||
|
sourcery-ai[bot] marked this conversation as resolved.
|
||
| kind: MCPServerRegistration | ||
| metadata: | ||
| name: {{ include "stackrox-mcp.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "stackrox-mcp.labels" . | nindent 4 }} | ||
| spec: | ||
| toolPrefix: {{ .Values.mcpGateway.toolPrefix }} | ||
| targetRef: | ||
| group: gateway.networking.k8s.io | ||
| kind: HTTPRoute | ||
| name: {{ include "stackrox-mcp.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # MCP Gateway Integration | ||
|
|
||
| This guide describes how to integrate the StackRox MCP server with [MCP Gateway](https://github.com/Kuadrant/mcp-gateway), enabling tool aggregation behind a centralized gateway endpoint. | ||
|
|
||
| ## Overview | ||
|
|
||
| MCP Gateway is an Envoy-based system that aggregates multiple MCP servers behind a single endpoint. It uses Gateway API resources and a custom `MCPServerRegistration` CRD to discover and route requests to backend MCP servers. | ||
|
|
||
| When enabled, the Helm chart creates: | ||
| - **HTTPRoute** — routes `/mcp` traffic from the gateway to the StackRox MCP service | ||
| - **MCPServerRegistration** — registers the server with the gateway using a tool prefix to avoid naming conflicts | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [MCP Gateway](https://github.com/Kuadrant/mcp-gateway) installed on the cluster ([OpenShift installation guide](https://github.com/Kuadrant/mcp-gateway/tree/main/config/openshift)) | ||
|
|
||
| The Helm chart validates that the required CRDs are available and fails with a descriptive error if they are not. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| helm install stackrox-mcp charts/stackrox-mcp \ | ||
| --namespace stackrox-mcp \ | ||
| --create-namespace \ | ||
| --set mcpGateway.enabled=true \ | ||
| --set mcpGateway.hostname=stackrox-mcp.mcp.local \ | ||
| --set config.central.url=<your-central-url> | ||
| ``` | ||
|
|
||
| ## Configuration Reference | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `mcpGateway.enabled` | Enable MCP Gateway integration | `false` | | ||
| | `mcpGateway.gateway.name` | Name of the MCP Gateway resource | `stackrox-mcp-gateway` | | ||
| | `mcpGateway.gateway.namespace` | Namespace of the MCP Gateway resource | `gateway-system` | | ||
| | `mcpGateway.hostname` | Hostname for the HTTPRoute | `""` | | ||
| | `mcpGateway.toolPrefix` | Prefix for tools exposed via the gateway | `stackrox_` | | ||
|
|
||
| ## Verification | ||
|
|
||
| ```bash | ||
| curl -X POST https://$(oc get routes -n gateway-system -o jsonpath='{ .items[0].spec.host }')/mcp \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| MCP Client | ||
| → MCP Gateway (gateway-system namespace) | ||
| → HTTPRoute (/mcp) | ||
| → StackRox MCP Service (stackrox-mcp namespace) | ||
| → StackRox MCP Pod(s) | ||
| → StackRox Central API | ||
| ``` | ||
|
|
||
| The gateway aggregates tools from all registered MCP servers. StackRox MCP tools are exposed with the configured prefix (e.g., `stackrox_get_deployments_for_cve`). |
Uh oh!
There was an error while loading. Please reload this page.