---
title: "Grafana: setup for Claude, Cursor, Codex · DotsAgent"
description: "Search dashboards, query Prometheus and Loki data sources, and manage alerts and incidents in Grafana. Set up Grafana in 13 MCP clients."
url: https://dotsagent.io/mcp/servers/grafana
---

Observability · Grafana Labs

# Set up Grafana

Search dashboards, query Prometheus and Loki data sources, and manage alerts and incidents in Grafana.

- **Publisher**: Grafana Labs Official
- **Run locally**: `uvx mcp-grafana`
- **Transports**: stdio, sse, streamable-http
- **Authentication**: A Grafana service account token, plus the instance address in GRAFANA_URL.
- **Environment**: `GRAFANA_URL``GRAFANA_SERVICE_ACCOUNT_TOKEN`
- **What it can touch**: Read and write; --disable-write makes it read-only.
- **Licence**: Apache-2.0
- **Source**: [github.com/grafana/mcp-grafana](https://github.com/grafana/mcp-grafana)
- **Status**: Active

## Install

This server runs on your machine as a child process of the client. You need the runtime its command uses, such as Node.js for npx, uv for uvx or Docker, plus any variables listed under Environment.

### Claude Code

`shell`

```
claude mcp add --scope project --env GRAFANA_URL='<GRAFANA_URL>' --env GRAFANA_SERVICE_ACCOUNT_TOKEN='<GRAFANA_SERVICE_ACCOUNT_TOKEN>' grafana -- uvx mcp-grafana
```

### Cursor

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana"
      ],
      "env": {
        "GRAFANA_URL": "${env:GRAFANA_URL}",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "${env:GRAFANA_SERVICE_ACCOUNT_TOKEN}"
      }
    }
  }
}
```

### Codex

`~/.codex/config.toml`

```
[mcp_servers.grafana]
command = "uvx"
args = ["mcp-grafana"]
env_vars = ["GRAFANA_URL", "GRAFANA_SERVICE_ACCOUNT_TOKEN"]
```

[Config for other clients →](https://dotsagent.io/mcp/config#add=grafana)

## Other servers in observability

- [Sentry](https://dotsagent.io/mcp/servers/sentry): Look up Sentry issues, events, traces and releases, and start Seer root-cause analysis, hosted or locally.

- [Datadog](https://dotsagent.io/mcp/servers/datadog): Query Datadog logs, metrics, traces, monitors and incidents. Add ?toolsets= to the URL to limit the tools.

- [PagerDuty](https://dotsagent.io/mcp/servers/pagerduty): PagerDuty's hosted server for incidents, services, schedules and on-call rotations.

## Sources

1. [github.com](https://github.com/grafana/mcp-grafana)/grafana/mcp-grafana

Independent reference for people who build AI agents. Not affiliated with any vendor named here.

© 2026 DotsAgent · Facts checked October 1, 2026
