From grafana-app-sdk
Connects AI coding agents like Claude Code, Cursor, VS Code to Grafana Cloud via MCP server for querying metrics, dashboards, alerts, and Fleet Management.
npx claudepluginhub grafana/skills --plugin grafana-app-sdkThis skill uses the workspace's default tool permissions.
The Grafana MCP server exposes Grafana Cloud capabilities as tools that AI agents can call via
Guides Grafana OSS features: building dashboards, configuring panels and data sources, provisioning YAML, template variables, alerting, RBAC, users, and PromQL/LogQL/TraceQL queries.
Deploys monitoring stacks like Prometheus, Grafana, Datadog with exporters, scrape targets, alerting rules, Grafana dashboards for Kubernetes or Docker.
Share bugs, ideas, or general feedback.
The Grafana MCP server exposes Grafana Cloud capabilities as tools that AI agents can call via the Model Context Protocol. Once connected, agents can query metrics, search dashboards, manage alerts, investigate incidents, and interact with Fleet Management - all without leaving their coding environment.
Available transports:
stdio - agent spawns the server as a subprocess (simplest, works everywhere)SSE - server runs independently, agent connects via HTTPYou need a Service Account token with appropriate scopes.
Viewer role (add Editor if you need write operations)https://myorg.grafana.net) and the tokenFor Grafana Cloud Prometheus/Loki/Tempo access you may also need:
# Via Go (recommended - always gets latest)
go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest
# Verify
mcp-grafana --version
Alternatively, download a pre-built binary from the releases page.
Add the server to Claude Code's MCP configuration. The config file is at:
~/.claude/settings.json or the project's .claude/settings.json{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "https://myorg.grafana.net",
"GRAFANA_API_KEY": "glsa_xxxx"
}
}
}
}
Read-only mode (safer for exploration - disables all write tools):
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": ["--disable-write"],
"env": {
"GRAFANA_URL": "https://myorg.grafana.net",
"GRAFANA_API_KEY": "glsa_xxxx"
}
}
}
}
Restart Claude Code after editing settings. Run /mcp in Claude Code to verify the server appears and its tools are listed.
In Cursor: Settings > Features > MCP Servers (or edit ~/.cursor/mcp.json):
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "https://myorg.grafana.net",
"GRAFANA_API_KEY": "glsa_xxxx"
}
}
}
}
Run the server as a long-lived SSE process instead of per-session stdio:
GRAFANA_URL=https://myorg.grafana.net \
GRAFANA_API_KEY=glsa_xxxx \
mcp-grafana --transport sse --port 3001
Then point agents at http://localhost:3001/sse.
VS Code MCP extension config (settings.json):
{
"mcp.servers": {
"grafana": {
"type": "sse",
"url": "http://localhost:3001/sse"
}
}
}
Once connected, the agent can call:
Query tools:
query_prometheus - run PromQL queries against Grafana Cloud Metricsquery_loki - run LogQL queries against Grafana Cloud Logsquery_tempo - run TraceQL queries against Grafana Cloud Traceslist_datasources - enumerate configured data sourcesDashboard tools:
search_dashboards - find dashboards by name, tag, or folderget_dashboard - retrieve full dashboard JSONcreate_dashboard - create or update a dashboard (requires Editor role)Alerting and incident tools:
list_alert_rules - list firing and pending alertsget_alert_rule - get details of a specific alert rulelist_incidents - list active incidents (requires IRM)Fleet Management tools (if collector-app is installed):
list_collectors - list Alloy collectors and their health statuslist_pipelines - list remote configuration pipelinesget_pipeline - get pipeline YAML contentAnnotation tools:
list_annotations - search dashboard annotations by time rangecreate_annotation - add an annotation to a dashboardIn Claude Code, ask the agent to use a Grafana tool:
What data sources are configured in my Grafana instance?
Or:
Show me dashboards tagged with "kubernetes" in my Grafana.
If the tool call fails:
GRAFANA_URL has no trailing slashmcp-grafana --debug to see raw request/response logsIf you have the grafana-core skills installed, the agent already knows:
grafana-core/promql)grafana-core/dashboarding)grafana-cloud/fleet-management)Combined with the MCP tools, the agent can answer questions like:
The Grafana Assistant supports the A2A protocol for agent-to-agent communication. External agents can discover available Grafana agents at:
GET https://<GRAFANA_ASSISTANT_HOST>/.well-known/agent.json
This returns an Agent Card describing the supervisor agent's capabilities. Use this for programmatic integration when building agents that need to delegate observability reasoning to the Grafana Assistant.
--disable-write) for shared or CI environments