Registry Mirror
Skip to content

Conversation

@shaktisingh404

Copy link
Copy Markdown
Contributor

Fixes #3287

The bundled grafana-mcp chart has no consumer since the observability agent was removed. A default install still deployed it without Grafana or credentials.

Changes

  • Delete helm/tools/grafana-mcp
  • Remove the umbrella chart dependency, the grafana-mcp: values block, and the NOTES.txt entry
  • Remove the helm-tools Make target (it only packaged this chart) and its helm-version prerequisite
  • Update the packaging test and CI (e2e values, helm unittest step)

contrib/ is untouched (tracked in #2819). The UI mock fixtures and Playwright spec only use "grafana-mcp" as seed data, so they are left as is. This also supersedes #3136.

Upgrade note

helm upgrade removes the grafana-mcp Deployment, Service, Secret and RemoteMCPServer. Agents still bound to it lose those tools.

Testing

  • bash scripts/package-release-charts_test.sh
  • make helm-version
  • helm unittest helm/kagent (326 passed)
  • helm template renders no grafana-mcp resources

The grafana-mcp chart no longer has a consumer since the observability
agent was removed. A default install still deployed it without Grafana
or credentials, with a stale base URL and no caller authentication.

Remove helm/tools/grafana-mcp and its wiring: the umbrella chart
dependency, values, NOTES entry, the helm-tools Make target, release
packaging test, and CI steps. contrib/ manifests are out of scope
(tracked in kagent-dev#2819).

Fixes kagent-dev#3287

Signed-off-by: shaktisingh404 <127668520+shaktisingh404@users.noreply.github.com>
@EItanya
EItanya added this pull request to the merge queue Oct 21, 2026
Merged via the queue into kagent-dev:main with commit 1b9c9a2 Oct 21, 2026
31 checks passed
alan-bentley-pgh pushed a commit to alan-bentley-pgh/kagent that referenced this pull request Nov 23, 2026
…by size (kagent-dev#3246)

---
*Written by 🤖 (start)*

## Changelog

Chat shows images that MCP tools return, such as Grafana's
`get_panel_image`, and a chat full of images still loads.

Closes kagent-dev#2432, closes kagent-dev#3445

## Testing

**Unit:** `cd go/adk && go test ./pkg/mcp/ ./pkg/a2a/`, `cd go/api && go
test ./a2a/`, `cd go/core && go test ./internal/service/taskstore/
./internal/service/session/`, and `cd ui && yarn test
src/components/chat`.

**Live, with a real Grafana panel.** The goal is to see
`get_panel_image` render inline in the chat.

1. **Cluster and kagent from this branch.** This needs an
`OPENAI_API_KEY` in your env.
   ```sh
   make create-kind-cluster
   make kagent-cli-install
   ```
2. **Prometheus, then Grafana with the remote image renderer and a CPU
dashboard.** The [`grafana.yaml`](#grafanayaml) manifest is below.
   ```sh
helm repo add prometheus-community
https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/prometheus -n monitoring
--create-namespace \
--set alertmanager.enabled=false --set
prometheus-pushgateway.enabled=false
   kubectl apply -f grafana.yaml
   ```
3. **A Grafana service-account token, plus Grafana MCP.** The
`grafana-mcp` chart was removed from `main` in kagent-dev#3294,
so check it out from the commit before.
   - Create the token:
     ```sh
     kubectl -n monitoring port-forward svc/grafana 3000:3000 &
     SA=$(curl -s -u admin:admin -H 'Content-Type: application/json' \
-d '{"name":"mcp","role":"Viewer"}' localhost:3000/api/serviceaccounts |
jq .id)
TOKEN=$(curl -s -u admin:admin -H 'Content-Type: application/json' \
-d '{"name":"mcp"}' localhost:3000/api/serviceaccounts/$SA/tokens | jq
-r .key)
     ```
- Install Grafana MCP. The agent reaches it by its full
`.svc.cluster.local` name, so `allowedHosts` must include that host, or
mcp-grafana answers `initialize: Forbidden`.
     ```sh
     git checkout 1b9c9a2^ -- helm/tools/grafana-mcp
     helm install grafana-mcp helm/tools/grafana-mcp -n kagent \
       --set grafana.url=http://grafana.monitoring.svc:3000 \
       --set grafana.serviceAccountToken="$TOKEN" \
--set
allowedHosts='grafana-mcp.kagent.svc.cluster.local\,grafana-mcp.kagent.svc.cluster.local:8000\,localhost:8000\,127.0.0.1:8000'
     kubectl -n kagent patch remotemcpserver grafana-mcp --type merge \
-p
'{"spec":{"url":"http://grafana-mcp.kagent.svc.cluster.local:8000/mcp"}}'
     ```
4. **The agent.** Apply [`agent.yaml`](#agentyaml), below.
5. **Chat.** Wait a few minutes for Prometheus data, open the UI, start
a chat with `grafana-panels`, and ask:
   > Show me the CPU panel image from dashboard cluster-cpu, panel 1

- **Expected:** the `get_panel_image` card renders the panel PNG inline.
- **On `main`:** the card shows only `[MCP image: mimeType="image/png",
size=… bytes]`.

<details><summary id="grafanayaml"><code>grafana.yaml</code></summary>

```yaml
apiVersion: v1
kind: Namespace
metadata:
  name: monitoring
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-provisioning
  namespace: monitoring
data:
  datasources.yaml: |
    apiVersion: 1
    datasources:
      - name: Prometheus
        uid: prometheus
        type: prometheus
        access: proxy
        url: http://prometheus-server.monitoring.svc
        isDefault: true
  dashboards.yaml: |
    apiVersion: 1
    providers:
      - name: default
        type: file
        options:
          path: /var/lib/grafana/dashboards
  cluster-cpu.json: |
    {
      "uid": "cluster-cpu",
      "title": "Cluster CPU",
      "schemaVersion": 39,
      "time": {"from": "now-15m", "to": "now"},
      "refresh": "30s",
      "panels": [
        {
          "id": 1,
          "type": "timeseries",
          "title": "CPU usage by namespace (cores)",
          "datasource": {"type": "prometheus", "uid": "prometheus"},
          "gridPos": {"h": 10, "w": 24, "x": 0, "y": 0},
          "fieldConfig": {"defaults": {"unit": "short", "custom": {"lineWidth": 2, "fillOpacity": 10}}, "overrides": []},
          "options": {"legend": {"displayMode": "list", "placement": "bottom"}},
          "targets": [
            {
              "refId": "A",
              "datasource": {"type": "prometheus", "uid": "prometheus"},
              "expr": "sum by (namespace) (rate(container_cpu_usage_seconds_total{container!=\"\", namespace!=\"\"}[1m]))",
              "legendFormat": "{{namespace}}"
            }
          ]
        }
      ]
    }
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
spec:
  replicas: 1
  selector: {matchLabels: {app: grafana}}
  template:
    metadata: {labels: {app: grafana}}
    spec:
      containers:
        - name: grafana
          image: grafana/grafana:12.2.0
          ports: [{containerPort: 3000}]
          env:
            - {name: GF_SECURITY_ADMIN_USER, value: admin}
            - {name: GF_SECURITY_ADMIN_PASSWORD, value: admin}
            - {name: GF_RENDERING_SERVER_URL, value: "http://grafana-renderer.monitoring.svc:8081/render"}
            - {name: GF_RENDERING_CALLBACK_URL, value: "http://grafana.monitoring.svc:3000/"}
            - {name: GF_RENDERING_RENDERER_TOKEN, value: "demo-renderer-token"}
            - {name: GF_LOG_FILTERS, value: "rendering:debug"}
          volumeMounts:
            - {name: prov, mountPath: /etc/grafana/provisioning/datasources/datasources.yaml, subPath: datasources.yaml}
            - {name: prov, mountPath: /etc/grafana/provisioning/dashboards/dashboards.yaml, subPath: dashboards.yaml}
            - {name: prov, mountPath: /var/lib/grafana/dashboards/cluster-cpu.json, subPath: cluster-cpu.json}
          readinessProbe:
            httpGet: {path: /api/health, port: 3000}
      volumes:
        - name: prov
          configMap: {name: grafana-provisioning}
---
apiVersion: v1
kind: Service
metadata:
  name: grafana
  namespace: monitoring
spec:
  selector: {app: grafana}
  ports: [{port: 3000, targetPort: 3000}]
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-renderer
  namespace: monitoring
spec:
  replicas: 1
  selector: {matchLabels: {app: grafana-renderer}}
  template:
    metadata: {labels: {app: grafana-renderer}}
    spec:
      containers:
        - name: renderer
          image: grafana/grafana-image-renderer:latest
          ports: [{containerPort: 8081}]
          env:
            - {name: AUTH_TOKEN, value: "demo-renderer-token"}
---
apiVersion: v1
kind: Service
metadata:
  name: grafana-renderer
  namespace: monitoring
spec:
  selector: {app: grafana-renderer}
  ports: [{port: 8081, targetPort: 8081}]
```
</details>

<details><summary id="agentyaml"><code>agent.yaml</code></summary>

```yaml
apiVersion: api.kagent.dev/v1alpha3
kind: Harness
metadata:
  name: kagent
  namespace: kagent
spec:
  kagent: {}
  substrate:
    workerPoolRef:
      name: kagent-default
    snapshotPolicy:
      location: gs://ate-snapshots/kagent/
---
apiVersion: api.kagent.dev/v1alpha3
kind: AgentTemplate
metadata:
  name: grafana-panels
  namespace: kagent
spec:
  description: Shows Grafana panel images
  modelConfig:
    name: default-model-config
  systemPrompt: |
    You help users look at Grafana dashboards. When asked for a panel image, call
    get_panel_image with the dashboard uid and panel id the user gives you, then
    briefly describe what the panel shows in one or two sentences.
  tools:
    - mcp:
        server:
          kind: RemoteMCPServer
          name: grafana-mcp
        tools: [get_panel_image, search_dashboards]
---
apiVersion: api.kagent.dev/v1alpha3
kind: Agent
metadata:
  name: grafana-panels
  namespace: kagent
spec:
  template:
    ref:
      name: grafana-panels
  harnessRef:
    name: kagent
```
</details>

---
*Written by 🤖 (end)*

---------

Signed-off-by: Nicholas Bucher <behappy54321@gmail.com>
Co-authored-by: Nicholas Bucher <behappy54321@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the bundled Grafana MCP chart

2 participants