grafana/skills

assistant-mcp

Connect AI coding agents (Claude Code, Cursor, VS Code, OpenAI Codex) to Grafana Cloud via the mcp-grafana Model Context Protocol server.

Vedi sorgente
Documento Skill originale

Contenuto dal repository con titoli, esempi, codice, tabelle, link e immagini preservati.

Grafana Cloud MCP Server Setup

The Grafana MCP server exposes Grafana Cloud capabilities as tools that AI agents can call via the Model Context Protocol. Agents can then query metrics, search dashboards, manage alerts, investigate incidents, and interact with Fleet Management without leaving the coding environment.

Transports: stdio (agent spawns the server as a subprocess, simplest), or SSE (server runs independently, agents connect via HTTP — see references/sse-transport.md).

Common Workflows

Connecting Claude Code to Grafana (stdio)

bash
# 1. Install the server
go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest

# 2. Verify the binary
mcp-grafana --version
# If "command not found": ensure $GOPATH/bin (or $HOME/go/bin) is on PATH.
  1. Get a service-account token: Grafana Cloud → Administration → Service Accounts → create with Viewer role (add Editor only if you need writes) → generate token. Note the Grafana URL (e.g. https://myorg.grafana.net).
  1. Wire `~/.claude/settings.json` (or project-local .claude/settings.json):
json
   {
     "mcpServers": {
       "grafana": {
         "command": "mcp-grafana",
         "args": ["--disable-write"],
         "env": {
           "GRAFANA_URL": "https://myorg.grafana.net",
           "GRAFANA_API_KEY": "glsa_xxxx"
         }
       }
     }
   }

--disable-write is the safer default — drop it once you've verified the read path works.

  1. Restart Claude Code, then verify:
   /mcp

The grafana server should appear with its tool list. Then ask:

   What data sources are configured in my Grafana instance?

A clean response = working. If the tool call fails:

  • Check GRAFANA_URL has no trailing slash
  • Confirm the API key hasn't expired
  • Re-run with mcp-grafana --debug to see raw request/response

Connecting Cursor

Same Grafana token. Settings → Features → MCP Servers (or edit ~/.cursor/mcp.json):

json
{
  "mcpServers": {
    "grafana": {
      "command": "mcp-grafana",
      "args": ["--disable-write"],
      "env": {
        "GRAFANA_URL": "https://myorg.grafana.net",
        "GRAFANA_API_KEY": "glsa_xxxx"
      }
    }
  }
}

Verify the same way — Cursor surfaces MCP servers in its agent panel; run a query like "list dashboards tagged kubernetes".

Sharing the server across a team (SSE)

Switch from stdio to SSE so the server runs once and many agents connect to it. Full setup with VS Code config in references/sse-transport.md.

Security considerations

  • API keys belong in env vars or a secrets manager — never in committed files.
  • Use --disable-write for shared environments and CI; only lift it on the specific machine where the agent should be allowed to mutate Grafana.
  • Scope service-account permissions to the minimum: Viewer is enough for queries and dashboard reads. Only grant Editor when the agent needs to create dashboards or annotations.
  • Rotate tokens periodically via Administration → Service Accounts.

References

  • `references/tools.md` — full list of MCP tools exposed (query / dashboard / alerting / Fleet Management / annotations) and how to discover the live set
  • `references/sse-transport.md` — SSE setup for team sharing and VS Code, with stdio-vs-SSE decision matrix + common failure modes
  • `references/a2a.md` — Agent-to-Agent (A2A) protocol for delegating reasoning to the Grafana Assistant (vs direct tool calls via MCP)

External resources

dallo stesso repository

Altri Skills

Tutti gli Skills
grafana
Community

alerting-irm

Configure Grafana Alerting, Incident Response Management (IRM), and SLOs end-to-end — provisions Grafana-managed and data-source-managed alert rules, contact points (Slack/PagerDuty/email/webhook), notification policies with hierarchical matchers, silences, mute timings, on-call schedules and escalation chains, incident-management integrations, and SLOs with multi-window burn-rate alerts. Use when configuring alerts, debugging notification routing, setting up on-call rotations, declaring or managing incidents, defining SLOs, provisioning alerting via YAML or API, picking matchers for a notification policy, building a PagerDuty/Slack webhook receiver, or troubleshooting why an alert isn't firing — even when the user says "page me on errors", "alert me when X happens", "route this to the platform team", or "set up an SLO" without naming Alerting or IRM.

installazioni
5
GitHub Stars
246
Aggiornato
8 set
grafana
Community

alloy

Build a unified telemetry pipeline with Grafana Alloy — one OpenTelemetry-compatible binary that collects metrics, logs, traces, and profiles and ships to Grafana Cloud / Prometheus / Loki / Tempo / Pyroscope. Covers the Alloy config language (blocks, sys.env, component refs), prometheus.scrape → remotewrite, loki.source.file + loki.process → loki.write, otelcol.receiver.otlp → otelcol.exporter.otlp, pyroscope.scrape, K8s / Docker / EC2 discovery, relabeling, modules (import.file/git/http), clustering, Fleet Management remotecfg, the Alloy UI at :12345, and alloy fmt / alloy validate. Use when writing a config.alloy, replacing Grafana Agent / OTel Collector, scraping K8s pods, parsing logs, ingesting OTLP, or debugging "Alloy isn't sending anything" — even when the user says "set up the agent", "write me a scrape config", "drop these logs before sending", or "OTel collector config" without naming Alloy.

installazioni
5
GitHub Stars
246
Aggiornato
8 set
grafana
Community

beyla

Auto-instrument an application's HTTP / gRPC / DB traffic with Grafana Beyla eBPF — no code changes, no SDK, no restart. Covers requirements (Linux 5.8+ with BTF, CAPSYSADMIN, host PID), language matrix (Go / Java / Python / Ruby / Node / .NET / Rust / C++ / PHP), Docker + Helm + DaemonSet install, port- / process- / Kubernetes-metadata discovery, OTLP traces + Prometheus metrics export, routes decorator (cardinality control), trace sampling, and Grafana Cloud via Alloy. Use when adding observability to a service you can't recompile, instrumenting a closed-source binary, getting RED metrics + spans onto Tempo/Mimir without touching the app, or rolling Beyla as a cluster-wide DaemonSet — even when the user says "zero-code APM", "instrument legacy app", "trace this binary", "eBPF observability", or "no SDK" without naming Beyla.

installazioni
5
GitHub Stars
246
Aggiornato
8 set
grafana
Community

dashboarding

Build, modify, and ship Grafana dashboards as JSON via the HTTP API — panel types (timeseries / stat / gauge / table / heatmap / logs / traces / node-graph), gridPos 24-column layout, units, thresholds, template + datasource + chained variables, transformations (organize / calculateField / filterByValue), panel + dashboard links with ${field.labels.x} / ${from}, and Loki/Prometheus annotations. Use when scripting dashboard creation, writing the dashboard JSON for a new service, adding a $job dropdown variable, computing an "Error %" column with a transformation, overlaying deploys as annotations, or pushing a dashboard via POST /api/dashboards/db — even when the user says "create a dashboard for this metric", "add a service dropdown", "show errors as percentage", "overlay our deploys", or "export the dashboard JSON" without naming the API or schema. After every API push, verify with the returned version plus a GET on the dashboard UID.

installazioni
5
GitHub Stars
246
Aggiornato
8 set